From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 11A393857C7C; Tue, 4 Aug 2020 03:20:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 11A393857C7C From: "kevinb at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/26336] New: corefile.exp regression for unix/-m32 on x86_64 Date: Tue, 04 Aug 2020 03:20:55 +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: kevinb at redhat dot com X-Bugzilla-Status: NEW 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 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 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 03:20:56 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26336 Bug ID: 26336 Summary: corefile.exp regression for unix/-m32 on x86_64 Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: kevinb at redhat dot com Target Milestone: --- Overview: gdb.base/corefile.exp is showing an unexpected failure and an unresolved testcase when testing against unix/-m32. Steps to Reproduce: 1) Fetch and build upstream GDB sources in the normal fashion for x86_64. 2) Test using the following command: make check RUNTESTFLAGS=3D"--target_board unix/-m32" TESTS=3D"gdb.base/core= file.exp Actual Results: =3D=3D=3D gdb Summary =3D=3D=3D # of expected passes 28 # of unexpected failures 1 # of unresolved testcases 1 Expected Results: =3D=3D=3D gdb Summary =3D=3D=3D # of expected passes 30 Build Date & Hardware: I first noticed this problem on July 29, 2020. Hardware is x86_64 VMs running on an x86_64 virtualization host. I've reproduced this problem using Fedora 28, 29, 31, and 32. Additional Information: I've isolated the commit which first caused the regression: >>From 5b6d1e4fa4fc6827c7b3f0e99ff120dfa14d65d2 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 10 Jan 2020 20:06:08 +0000 Subject: [PATCH] Multi-target support Below is the relevant portion of the log file. Once -m32 binaries and coref= ile are created, the sequence shown below (with a suitable pid for the attach) = may be used to reproduce the problem when running GDB by hand. spawn /mesquite2/sourceware-git/f29-bisect/bld/gdb/testsuite/outputs/gdb.base/cor= efile/corefile sleep spawn /mesquite2/sourceware-git/f29-bisect/bld/gdb/testsuite/../../gdb/gdb = -nw -nx -data-directory /mesquite2/sourceware-git/f29-bisect/bld/gdb/testsuite/../data-directory GNU gdb (GDB) 10.0.50.20200110-git Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word". (gdb) set height 0 (gdb) set width 0 (gdb) core-file /mesquite2/sourceware-git/f29-bisect/bld/gdb/testsuite/outputs/gdb.base/cor= efile/corefile.core [New LWP 15497] Core was generated by `/mesquite2/sourceware-git/f29-bisect/bld/gdb/testsuite/outputs/gdb.base/co= refil'. Program terminated with signal SIGABRT, Aborted. #0 0xf7f7cb29 in __kernel_vsyscall () (gdb) PASS: gdb.base/corefile.exp: attach: load core again info files Local core dump file: =20=20=20=20=20=20=20 `/mesquite2/sourceware-git/f29-bisect/bld/gdb/testsuite/outputs/gdb.base/co= refile/corefile.core', file type elf32-i386. 0x08048000 - 0x08049000 is load1 0x08049000 - 0x08049000 is load2 0x0804a000 - 0x0804a000 is load3 0x0804b000 - 0x0804c000 is load4 0x0804c000 - 0x0804d000 is load5 0x09a31000 - 0x09a53000 is load6 0xf7ccc000 - 0xf7ccd000 is load7a 0xf7ccd000 - 0xf7ccd000 is load7b 0xf7ce5000 - 0xf7ce5000 is load8 0xf7e09000 - 0xf7e09000 is load9 0xf7e6e000 - 0xf7e6e000 is load10 0xf7e6f000 - 0xf7e71000 is load11 0xf7e71000 - 0xf7e72000 is load12 0xf7e72000 - 0xf7e75000 is load13 0xf7e75000 - 0xf7e76000 is load14a 0xf7e76000 - 0xf7e76000 is load14b 0xf7e7f000 - 0xf7e7f000 is load15 0xf7f0e000 - 0xf7f0e000 is load16 0xf7f46000 - 0xf7f47000 is load17 0xf7f47000 - 0xf7f48000 is load18 0xf7f75000 - 0xf7f77000 is load19 0xf7f77000 - 0xf7f79000 is load20 0xf7f79000 - 0xf7f7c000 is load21 0xf7f7c000 - 0xf7f7d000 is load22 0xf7f7d000 - 0xf7f7e000 is load23 0xf7f7e000 - 0xf7f7e000 is load24 0xf7f9b000 - 0xf7f9b000 is load25 0xf7fa6000 - 0xf7fa7000 is load26 0xf7fa7000 - 0xf7fa8000 is load27 0xff9d1000 - 0xff9f3000 is load28 (gdb) PASS: gdb.base/corefile.exp: attach: sanity check we see the core file attach 15741 /ironwood1/sourceware-git/f29-bisect/bld/../../worktree-bisect/gdb/dwarf2-f= rame.c:1009: internal-error: dwarf2_frame_cache* dwarf2_frame_cache(frame_info*, void**): Assertion `fde !=3D NULL' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) FAIL: gdb.base/corefile.exp: attach: = with core (GDB internal error) Resyncing due to internal error. Partial backtrace against HEAD: #0 internal_error ( file=3D0xb71d48 "/ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefi= le/gdb/dwarf2/frame.c", line=3D1013,=20 fmt=3D0xb719df "%s: Assertion `%s' failed.") at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdbsupport/errors.cc:51 #1 0x00000000005a353d in dwarf2_frame_cache (this_frame=3D0x112a980, this_cache=3D0x112a998) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/dwarf2/frame.c:1013 #2 0x00000000005a3e1c in dwarf2_frame_this_id (this_frame=3D0x112a980, this_cache=3D0x112a998, this_id=3D0x112a9e0) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/dwarf2/frame.c:1226 #3 0x000000000066ba43 in compute_frame_id (fi=3D0x112a980) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/frame.c:561 #4 0x000000000066bb90 in get_frame_id (fi=3D0x112a980) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/frame.c:593 #5 0x0000000000944589 in scoped_restore_current_thread::scoped_restore_current_thread (During symbol reading: Child DIE 0x433e63 and its abstract origin 0x44ca00 have different parents this=3D0x7fffffffc8e8) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/thread.c:1458 #6 0x00000000004b4f19 in scoped_restore_current_pspace_and_thread::scoped_restore_current_pspace_and= _thread (During symbol reading: .debug_line address at offset 0x17268e is 0 [in mod= ule /mesquite2/sourceware-git/f32-amd64-corefile/bld-m32/gdb/gdb] this=3D0x7fffffffc8e0) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/progspace-and-thread.h:29 #7 0x00000000006554d3 in remove_target_sections (owner=3D0x12edf30) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/exec.c:798 #8 0x00000000008e45a2 in symfile_free_objfile (objfile=3D0x12edf30) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/symfile.c:3742 #9 0x00000000004458a4 in std::__invoke_impl ( __f=3D@0x114dca0: 0x8e4583 ) at /usr/include/c++/10/bits/invoke.h:60 #10 0x00000000004443a9 in std::__invoke_r ( __fn=3D@0x114dca0: 0x8e4583 ) at /usr/include/c++/10/bits/invoke.h:153 #11 0x0000000000442fec in std::_Function_handler::_M_invoke(std::_Any_data const&, objfile*&&) (__functor=3D.= .., __args#0=3D@0x7fffffffca60: 0x12edf30) at /usr/include/c++/10/bits/std_function.h:291 #12 0x00000000007c6167 in std::function::operator()(objfil= e*) const (this=3D0x114dca0, __args#0=3D0x12edf30) at /usr/include/c++/10/bits/std_function.h:622 #13 0x00000000007c5c58 in gdb::observers::observable::notify (this=3D0xfd2dc0 ,=20 args#0=3D0x12edf30) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/../gdbsupport/observable.h:106 #14 0x00000000007c275d in objfile::~objfile (this=3D0x12edf30, __in_chrg=3D) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/objfiles.c:521 #15 0x00000000007c7774 in std::_Sp_counted_ptr::_M_dispose (this=3D0x12ee190) at /usr/include/c++/10/bits/shared_ptr_base.h:380 #16 0x00000000004b97c9 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=3D0x12e= e190) at /usr/include/c++/10/bits/shared_ptr_base.h:158 #17 0x00000000004b57ab in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=3D0x1220308,=20 __in_chrg=3D) at /usr/include/c++/10/bits/shared_ptr_base.h:733 #18 0x00000000007c5668 in std::__shared_ptr::~__shared_ptr (this=3D0x1220300,=20 __in_chrg=3D) at /usr/include/c++/10/bits/shared_ptr_base.h:1183 #19 0x00000000007c5684 in std::shared_ptr::~shared_ptr (this=3D0x1220300, __in_chrg=3D) at /usr/include/c++/10/bits/shared_ptr.h:121 #20 0x00000000007f43f0 in __gnu_cxx::new_allocator > >::destroy > (this=3D0x1199e40, __p=3D0x1220300) at /usr/include/c++/10/ext/new_allocator.h:156 #21 0x00000000007f3df1 in std::allocator_traits > > >::destroy > (__a=3D..., __p=3D0x1220300) at /usr/include/c++/10/bits/alloc_traits.h:531 #22 0x00000000007f3a6e in std::__cxx11::list, std::allocator > >::_M_erase ( this=3D0x1199e40, __position=3Dstd::shared_ptr (expired, weak = count 1) =3D {get() =3D 0x12edf30}) at /usr/include/c++/10/bits/stl_list.h:1925 #23 0x00000000007f3462 in std::__cxx11::list, std::allocator > >::erase ( this=3D0x1199e40, __position=3Dstd::shared_ptr (expired, weak = count 1) =3D {get() =3D 0x12edf30}) at /usr/include/c++/10/bits/list.tcc:158 #24 0x00000000007f1e49 in program_space::remove_objfile (this=3D0x1199e00, objfile=3D0x12edf30) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/progspace.c:207 #25 0x00000000007c26e8 in objfile::unlink (this=3D0x12edf30) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/objfiles.c:497 #26 0x00000000007c39fa in objfile_purge_solibs () at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/objfiles.c:904 #27 0x00000000008b462f in no_shared_libraries (ignored=3D0x0, from_tty=3D1) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/solib.c:1236 #28 0x0000000000927a07 in target_pre_inferior (from_tty=3D1) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/target.c:1900 #29 0x00000000006ee394 in attach_command (args=3D0x12a9227 "140459", from_t= ty=3D1) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/infcmd.c:2582 I wondered about why x86_64 works, but -m32 does not. I ran them side-by-s= ide and found... x86_64: Thread 1 "gdb" hit Breakpoint 4, remove_target_sections (During symbol read= ing: incomplete CFI data; unspecified registers (e.g., rax) at 0x653ccc owner=3D0x12da6e0) at /ironwood1/sourceware-git/f32-amd64-corefile/bld/../../worktree-corefile/gd= b/exec.c:798 798 scoped_restore_current_pspace_and_thread restore_pspace_thread; (top-gdb) c Continuing. Thread 1 "gdb" hit Breakpoint 6, scoped_restore_current_thread::scoped_restore_current_thread (this=3D0x7fffffffc8f8) at /ironwood1/sourceware-git/f32-amd64-corefile/bld/../../worktree-corefile/gd= b/thread.c:1458 1458 m_selected_frame_id =3D get_frame_id (frame); (top-gdb) s get_frame_id (fi=3D0x1130bf0) at /ironwood1/sourceware-git/f32-amd64-corefile/bld/../../worktree-corefile/gd= b/frame.c:578 578 if (fi =3D=3D NULL) (top-gdb)=20 581 if (!fi->this_id.p) (top-gdb)=20 590 gdb_assert (fi->level =3D=3D 0); (top-gdb) n 593 compute_frame_id (fi); (top-gdb) s compute_frame_id (fi=3D0x1130bf0) at /ironwood1/sourceware-git/f32-amd64-corefile/bld/../../worktree-corefile/gd= b/frame.c:550 550 gdb_assert (!fi->this_id.p); (top-gdb) n 552 if (frame_debug) (top-gdb) n 556 if (fi->unwind =3D=3D NULL) (top-gdb)=20 560 fi->this_id.value =3D outer_frame_id; (top-gdb)=20 561 fi->unwind->this_id (fi, &fi->prologue_cache, &fi->this_id.value); (top-gdb) s amd64_frame_this_id (this_frame=3D0x1130bf0, this_cache=3D0x1130c08, this_id=3D0x1130c50) at /ironwood1/sourceware-git/f32-amd64-corefile/bld/../../worktree-corefile/gd= b/amd64-tdep.c:2686 2686 amd64_frame_cache (this_frame, this_cache); (top-gdb) up #1 0x000000000066a143 in compute_frame_id (fi=3D0x1130bf0) at /ironwood1/sourceware-git/f32-amd64-corefile/bld/../../worktree-corefile/gd= b/frame.c:561 561 fi->unwind->this_id (fi, &fi->prologue_cache, &fi->this_id.value); (top-gdb) p fi->unwind->this_id $10 =3D (frame_this_id_ftype *) 0x45ea70 (top-gdb)=20 -m32: Thread 1 "gdb" hit Breakpoint 4, remove_target_sections (During symbol read= ing: incomplete CFI data; unspecified registers (e.g., rax) at 0x6555cc owner=3D0x12cc960) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/exec.c:798 798 scoped_restore_current_pspace_and_thread restore_pspace_thread; (top-gdb) b thread.c:1458 Breakpoint 6 at 0x944572: file /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/thread.c, line 1458. (top-gdb) del 5 (top-gdb) c Continuing. Thread 1 "gdb" hit Breakpoint 6, scoped_restore_current_thread::scoped_restore_current_thread (this=3D0x7fffffffc8e8) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/thread.c:1458 1458 m_selected_frame_id =3D get_frame_id (frame); (top-gdb) s get_frame_id (fi=3D0x112a980) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/frame.c:578 578 if (fi =3D=3D NULL) (top-gdb) s 581 if (!fi->this_id.p) (top-gdb)=20 590 gdb_assert (fi->level =3D=3D 0); (top-gdb) n 593 compute_frame_id (fi); (top-gdb) s compute_frame_id (fi=3D0x112a980) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/frame.c:550 550 gdb_assert (!fi->this_id.p); (top-gdb) n 552 if (frame_debug) (top-gdb)=20 556 if (fi->unwind =3D=3D NULL) (top-gdb)=20 560 fi->this_id.value =3D outer_frame_id; (top-gdb)=20 561 fi->unwind->this_id (fi, &fi->prologue_cache, &fi->this_id.value); (top-gdb) s dwarf2_frame_this_id (this_frame=3D0x112a980, this_cache=3D0x112a998, this_id=3D0x112a9e0) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/dwarf2/frame.c:1226 1226 dwarf2_frame_cache (this_frame, this_cache); (top-gdb) up #1 0x000000000066ba43 in compute_frame_id (fi=3D0x112a980) at /ironwood1/sourceware-git/f32-amd64-corefile/bld-m32/../../worktree-corefil= e/gdb/frame.c:561 561 fi->unwind->this_id (fi, &fi->prologue_cache, &fi->this_id.value); (top-gdb) p fi->unwind->this_id $7 =3D (frame_this_id_ftype *) 0x5a3df4 I.e. x86_64 is using the amd64 unwinder, but -m32 is using the dwarf2 unwin= der. (But I'm thinking that for this particular scenario, just getting to this p= oint where we're mucking about with unwinders at all might be the problem.) --=20 You are receiving this mail because: You are on the CC list for the bug.=