From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A56A2385E037; Sat, 16 Mar 2024 07:42:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A56A2385E037 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1710574943; bh=WxTPrk0FezsdUa/4FBDzV43I0/wj69RQtPuQdzmMIao=; h=From:To:Subject:Date:From; b=EHIvCyrI6AsPouJmmMA0KDh+gIlMVyF0aWjLWd2jTeYpKN93aYXNopB5cd/Aa0qh/ 0S12VoZHkwyZCy+4FiB/AuRIbCQTRo/G8q4WslFvlqQnAy70fp1nJdBJB0MsD9aLty rO77VkiqMF79BpDb5dcH1s5mrs81Eo4VyAyPg2dw= From: "sungdgdhtryrt at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/31497] New: gdb internal fatal error while opening a core dump; binary built with '-gsplit-dwarf' Date: Sat, 16 Mar 2024 07:42:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sungdgdhtryrt at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31497 Bug ID: 31497 Summary: gdb internal fatal error while opening a core dump; binary built with '-gsplit-dwarf' Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: sungdgdhtryrt at gmail dot com Target Milestone: --- Created attachment 15406 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D15406&action=3Ded= it gdb crash dump gdb internal fatal error while opening a core dump. The binary is built with '-gsplit-dwarf', clang-16 using dwp. Dwarf version= 5 is used. Without split dwarf everything is good. The error occurs from commit 65067f1c2c842f001017638c4fe53613d6656263 until latest, previous commits work well. I did some debugging with gdb.core maybe it can help: read_dwo_str_index (...): read.c:~19427 { ... bfd *abfd =3D reader->dwo_file->sections.str_offsets.get_bfd_owner (); const gdb_byte *p =3D reader->dwo_file->sections.str_offsets.buffer; -> p is NULL -> SIGSEGV in read_initial_length() below /* Header: Initial length. */ read_initial_length (abfd, p + bytes_read, &bytes_read); ... } In create_dwo_unit_in_dwp_v5(): ~10794 uint32_t offset is NULL (incorrect), but uint32_t size is correct, see at the bottom the readelf dump section [ 6] --- In create_dwp_hash_table(): ~10127 The offsets and sizes will be set: htab->section_pool.v5.offsets =3D ids_ptr + sizeof (uint32_t) * nr_co= lumns; htab->section_pool.v5.sizes =3D ... -> It seems htab->section_pool.v5.offsets will be zero after the assignment, although sizes is correct. Here is the readelf section dump of the dwp file: readelf -W -S x.dwp There are 10 section headers, starting at offset 0x861d0: Section Headers: [Nr] Name Type Address Off Size = ES Flg Lk Inf Al [ 0] NULL 0000000000000000 000000 00000= 0 00 0 0 0 [ 1] .strtab STRTAB 0000000000000000 086138 00009= 1 00 0 0 1 [ 2] .debug_loclists.dwo PROGBITS 0000000000000000 000040 0000a= f 00 E 0 0 1 [ 3] .debug_abbrev.dwo PROGBITS 0000000000000000 0000ef 00116= b 00 E 0 0 1 [ 4] .debug_rnglists.dwo PROGBITS 0000000000000000 00125a 00015= 1 00 E 0 0 1 [ 5] .debug_str.dwo PROGBITS 0000000000000000 0013ab 05703= c 01 MSE 0 0 1 [ 6] .debug_str_offsets.dwo PROGBITS 0000000000000000 0583e7 0057f= 8 00 E 0 0 1 --- gdb/dwarf2/read.c:10821 [create_dwo_unit_in_dwp_v5] -> size=3D0x5= 7f8 correct but offset=3D0 wrong [ 7] .debug_info.dwo PROGBITS 0000000000000000 05dbdf 0284d= d 00 E 0 0 1 [ 8] .debug_cu_index PROGBITS 0000000000000000 0860bc 00006= 4 00 0 0 1 [ 9] .symtab SYMTAB 0000000000000000 086120 00001= 8 18 1 1 8 --=20 You are receiving this mail because: You are on the CC list for the bug.=