From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D9B103858D32; Sun, 26 Feb 2023 20:19:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9B103858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677442792; bh=7PzFd2IICBps94u5UEecmxgTUA6ekgFXqmNfhVBZu/Q=; h=From:To:Subject:Date:From; b=eequJx0SDeXsMFkeud+BmsnfFWxy+UaaV8Xx8Zgm7rU6vKHUzj4ISrogrdox9q2vW JcCXCnWekkoqose9L4129qB6iLKAOzn3XDf5JB5KmiM9kkHVtcXHiE3Ku+9k43vtu3 iR3NclIPeoVYmHmLrVfpdjkNLUAgP9BFiKBJwvD4= From: "orgads at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/30175] New: stack smashing detected Date: Sun, 26 Feb 2023 20:19:51 +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: 13.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: orgads 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 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=3D30175 Bug ID: 30175 Summary: stack smashing detected Product: gdb Version: 13.1 Status: UNCONFIRMED Severity: critical Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: orgads at gmail dot com Target Milestone: --- I'm using gdb-multiarch on msys2/mingw32 (i686 host). When I open a core dump, GDB crashes with "stack smashing detected" error message. With x86_64 build (mingw64), it runs fine. My commands: set sysroot C:/sysroot/linux set osabi GNU/Linux -file-exec-file "C:/Users/orgads/AppData/Local/Temp/Core/app" -file-symbol-file "C:/Users/orgads/AppData/Local/Temp/Core/app" target core C:/Users/orgads/AppData/Local/Temp/Core/core Last words: =3Dlibrary-loaded,id=3D"/lib64/libresolv.so.2",target-name=3D"/lib64/libres= olv.so.2",host-name=3D"C:/sysroot/linux/lib64/libresolv.so.2",symbols-loade= d=3D"0",thread-group=3D"i1",ranges=3D[{from=3D"0x00007f8393775d00",to=3D"0x= 00007f8393781dbe"}] =3Dlibrary-loaded,id=3D"/lib64/libselinux.so.1",target-name=3D"/lib64/libse= linux.so.1",host-name=3D"C:/sysroot/linux/lib64/libselinux.so.1",symbols-lo= aded=3D"0",thread-group=3D"i1",ranges=3D[{from=3D"0x00007f839354eaa0",to=3D= "0x00007f83935668ff"}] =3Dlibrary-loaded,id=3D"/lib64/libpcre2-8.so.0",target-name=3D"/lib64/libpc= re2-8.so.0",host-name=3D"C:/sysroot/linux/lib64/libpcre2-8.so.0",symbols-lo= aded=3D"0",thread-group=3D"i1",ranges=3D[{from=3D"0x00007f83932c5380",to=3D= "0x00007f8393320933"}] *** stack smashing detected ***: terminated Looks like the next library it loads is libz.so.1 Full Backtrace: Thread 1 (Thread 9876.0x5864): #0 0x00e3f336 in bfd_check_format_matches (abfd=3Dabfd@entry=3D0x1b5abae0, format=3Dformat@entry=3Dbfd_object, matching=3Dmatching@entry=3D0x0) at ../../gdb-13.1/bfd/format.c:365 high_water =3D target =3D 0x1ea26e4 <_bfd_target_vector+548> matching_vector =3D 0x1cc05668 save_targ =3D 0x1ea4540 right_targ =3D 0x1ec5120 ar_right_targ =3D match_targ =3D 0x1ec5120 match_count =3D best_count =3D 1 best_match =3D 2 ar_match_index =3D 260 initial_section_id =3D 2591 preserve =3D {marker =3D 0x4708c0c8, tdata =3D 0x0, flags =3D 32768= , arch_info =3D 0x1e9eb80 , sections =3D 0x0, section_last =3D= 0x0, section_count =3D 0, section_id =3D 2591, section_htab =3D {table =3D 0x470= 940b0, newfunc =3D 0xe43650 , memory =3D 0x1b25a6c0, siz= e =3D 13, count =3D 0, entsize =3D 216, frozen =3D 0}, build_id =3D 0x0, cleanup =3D = 0x0} preserve_match =3D {marker =3D 0x47098558, tdata =3D 0x4708c0d0, fl= ags =3D 33104, arch_info =3D 0x1e9eb80 , sections =3D 0x47= 0950c8, section_last =3D 0x4709b530, section_count =3D 24, section_id =3D 2615, sec= tion_htab =3D {table =3D 0x470e7070, newfunc =3D 0xe43650 ,= memory =3D 0x1b25a3d8, size =3D 4051, count =3D 24, entsize =3D 216, frozen =3D 0}, bu= ild_id =3D 0x4708cf78, cleanup =3D 0xe40b10 <_bfd_void_bfd>} cleanup =3D 0x0 orig_error_handler =3D 0x99e2a0 in_check_format =3D 1 list =3D one =3D #1 0x00e3fd3f in bfd_check_format (abfd=3D0x1b5abae0, format=3Dbfd_object)= at ../../gdb-13.1/bfd/format.c:94 No locals. #2 0x00a891aa in find_separate_debug_file_in_section (objfile=3Dobjfile@entry=3D0x1cf7f9d0) at ../../gdb-13.1/gdb/minidebug.c:288 section =3D abfd =3D {m_obj =3D 0x1b5abae0} shared =3D filename =3D {_M_dataplus =3D {> =3D {> =3D {}, }, _M= _p =3D 0x470742b0 ".gnu_debugdata for C:/sysroot/linux/lib64/libz.so.1"}, _M_string_length =3D 59, {_M_local_buf =3D ";\000\000\000rintf\000t.plt", _M_allocated_capacity =3D 59}} #3 0x00c5933a in read_symbols (objfile=3Dobjfile@entry=3D0x1cf7f9d0, add_flags=3D..., add_flags@entry=3D...) at ../../gdb-13.1/gdb/symfile.c:782 abfd =3D {m_obj =3D 0xc58d25 } #4 0x00c58d2f in syms_from_objfile_1 (add_flags=3D..., addrs=3D0x5ef8b4, objfile=3D) at ../../gdb-13.1/gdb/symfile.c:968 local_addr =3D { >> =3D {_M_impl =3D {> =3D {> =3D {}, }, >::_Vector_impl_data> =3D {_M_start =3D 0x0, _M_finish =3D 0x0, _M_end_of_storage =3D 0x0}, }}, } mainline =3D 0 defer_clear_users =3D {{m_dummy =3D {}, m_item =3D {), clear_symtab_users, void(enum_flags)> >> =3D {m_released = =3D false}, m_bind_function =3D {)>> =3D {), false>> =3D {)>> =3D {}, }, }, _M_f =3D 0x0, _M_bound_args =3D { >> =3D {, false>> =3D {_M_head_impl =3D {m_enum_value = =3D 0}}, }, }}}, dont_use =3D 0 '\000'}, m_instantia= ted =3D false} objfile_holder =3D local_addr =3D mainline =3D defer_clear_users =3D objfile_holder =3D __func__ =3D num_sections =3D #5 syms_from_objfile (add_flags=3D..., addrs=3D0x5ef8b4, objfile=3D) at ../../gdb-13.1/gdb/symfile.c:985 No locals. #6 symbol_file_add_with_addrs (abfd=3D..., name=3D0x4451a348 "C:/sysroot/linux/lib64/libz.so.1", add_flags=3D..., addrs=3D0x5ef8b4, flag= s=3D..., parent=3D0x0) at ../../gdb-13.1/gdb/symfile.c:1088 objfile =3D from_tty =3D mainline =3D always_confirm =3D should_print =3D #7 0x00c5a27b in symbol_file_add_from_bfd (abfd=3D..., name=3D, name@entry=3D0x4451a348 "C:/sysroot/linux/lib64/libz.so.1", add_flags=3D..., add_flags@entry=3D..., addrs=3Daddrs@entry=3D0x5ef8b4, flags=3Dflags@entry= =3D..., parent=3Dparent@entry=3D0x0) at ../../gdb-13.1/gdb/symfile.c:1168 No locals. #8 0x00c1b35e in solib_read_symbols (so=3Dso@entry=3D0x4451a140, flags=3Dflags@entry=3D...) at ../../gdb-13.1/gdb/../gdbsupport/enum-flags.h= :143 sap =3D { >> =3D {_M_impl =3D {> =3D {> =3D {}, }, >::_Vector_impl_data> =3D {_M_start =3D 0x41= e3ea08, _M_finish =3D 0x41e3edc8, _M_end_of_storage =3D 0x41e3ef08}, }}, } tmp_bfd =3D {m_obj =3D 0x19485a98} #9 0x00c1cc6e in solib_add (pattern=3Dpattern@entry=3D0x0, from_tty=3Dfrom_tty@entry=3D0, readsyms=3D1) at ../../gdb-13.1/gdb/solib.c:= 1041 add_this_solib =3D 1 gdb =3D 0x4451a140 __for_range =3D __for_begin =3D __for_end =3D any_matches =3D true loaded_any_symbols =3D false add_flags =3D #10 0x009f6501 in post_create_inferior (from_tty=3Dfrom_tty@entry=3D1) at ../../gdb-13.1/gdb/infcmd.c:300 solib_add_generation =3D 1 restore_in_initial_library_scan =3D thr =3D #11 0x008cbbef in core_target_open (arg=3D0x1ce2287c "C:/Users/orgads/AppData/Local/Temp/Core/core", from_tty=3D1) at ../../gdb-13.1/gdb/corelow.c:573 p =3D siggy =3D scratch_chan =3D flags =3D filename =3D {_M_t =3D { >> =3D {_M_t =3D { >> =3D { >> =3D {, true>> =3D {_M_head_impl= =3D {}}, }, > =3D {_M_head_impl =3D 0x195b0c40 "C:/Users/orgads/AppData/Local/Temp/Core/core"= }, }, }}, }} temp_bfd =3D {m_obj =3D 0x0} target =3D 0x1daad0b8 target_holder =3D {_M_t =3D {> =3D {_M_t =3D {> =3D {> =3D {> =3D {_M_head_impl =3D {}}, }, > =3D {_M_head_impl =3D 0x0}, }, }}, }} reg_sect =3D 0x46ee1690 #12 0x00c95397 in open_target (args=3D0x1ce2287c "C:/Users/orgads/AppData/Local/Temp/Core/core", from_tty=3D1, command=3D0x1= 9442cb0) at ../../gdb-13.1/gdb/target.c:853 ti =3D 0x15e7908 func =3D 0x8cb920 #13 0x008983a5 in cmd_func (cmd=3Dcmd@entry=3D0x19442cb0, args=3Dargs@entry=3D0x1ce2287c "C:/Users/orgads/AppData/Local/Temp/Core/cor= e", from_tty=3Dfrom_tty@entry=3D1) at ../../gdb-13.1/gdb/cli/cli-decode.c:2543 restore_suppress =3D #14 0x00ca5c6f in execute_command (p=3D, p@entry=3D0x1ce22870 "target core C:/Users/orgads/AppData/Local/Temp/Core/core", from_tty=3D1) at ../../gdb-13.1/gdb/top.c:688 default_args_and_arg =3D {_M_dataplus =3D {> = =3D {> =3D {}, }, _M= _p =3D 0x5efba0 ""}, _M_string_length =3D 0, {_M_local_buf =3D "\000b=EF=BF=BD=EF=BF=BD=EF=BF=BD\374^\000\034\375^\000\304{\333w", _M_allo= cated_capacity =3D 3807470080}} without_whitespace =3D {_M_dataplus =3D {> =3D {> =3D {}, }, _M= _p =3D 0x5efbb8 ""}, _M_string_length =3D 0, {_M_local_buf =3D "\000\364=EF=BF=BD=EF=BF=BD\034\b\000\000\000\000\000\000\000\066\000\022", _M_allocated_capacity =3D 483390464}} cmd2 =3D 0x2 cmd =3D 0x1ce2287c "C:/Users/orgads/AppData/Local/Temp/Core/core" arg =3D 0x1ce2287c "C:/Users/orgads/AppData/Local/Temp/Core/core" default_args =3D {_M_dataplus =3D {> =3D {> =3D {}, }, _M= _p =3D 0x5efbd0 ""}, _M_string_length =3D 0, {_M_local_buf =3D "\000\364=EF=BF=BD=EF=BF=BD\034\000\000=EF=BF=BD\027=EF=BF=BD=EF=BF=BD=EF= =BF=BD\034\374\373^", _M_allocated_capacity =3D 483390464}} was_sync =3D 0 save_repeat_args =3D args_pointer =3D 0x1ce2287c "C:/Users/orgads/AppData/Local/Temp/Core/core" c =3D 0x19442cb0 line =3D cmd_start =3D 0x1ce22870 "target core C:/Users/orgads/AppData/Local/Temp/Core/core" cleanup_if_error =3D cleanup =3D {m_value =3D 0x0} __func__ =3D "execute_command" #15 0x0089c769 in safe_execute_command (from_tty=3D1, command=3D0x1ce22870 = "target core C:/Users/orgads/AppData/Local/Temp/Core/core", command_uiout=3D) at ../../gdb-13.1/gdb/cli/cli-interp.c:354 e =3D saved_uiout =3D e =3D saved_uiout =3D exception =3D #16 cli_interp::exec (this=3D0x1946a368, command_str=3D0x1ce22870 "target c= ore C:/Users/orgads/AppData/Local/Temp/Core/core") at ../../gdb-13.1/gdb/cli/cli-interp.c:331 old_stream =3D 0x1918e878 result =3D {reason =3D 0, error =3D GDB_NO_ERROR, message =3D {, std::allocator >, (__gnu_cxx::_Lock_policy)2>> =3D {, std::allocator >, (__gnu_cxx::_Lock_policy)2, false, false>> =3D {}, _M_ptr =3D 0x0, _M_refcount =3D {_M_= pi =3D 0x0}}, }} #17 0x00a162a8 in interp_exec (interp=3Dinterp@entry=3D0x1946a368, command_str=3D0x1ce22870 "target core C:/Users/orgads/AppData/Local/Temp/Core/core") at ../../gdb-13.1/gdb/interps.c:344 ui_interp =3D save_command_interp =3D #18 0x00a77bec in mi_cmd_interpreter_exec (command=3Dcommand@entry=3D0x163f= b48 "-interpreter-exec", argv=3Dargv@entry=3D0x5efd38, argc=3Dargc@entry=3D2) at ../../gdb-13.1/gdb/mi/mi-interp.c:244 e =3D {reason =3D 0, error =3D GDB_NO_ERROR, message =3D {, std::allocator >, (__gnu_cxx::_Lock_policy)2>> =3D {, std::allocator >, (__gnu_cxx::_Lock_policy)2, false, false>> =3D {}, _M_ptr =3D 0x0, _M_refcount =3D {_M_= pi =3D 0x0}}, }} interp_to_use =3D 0x1946a368 i =3D 1 scope_exit_237 =3D { > >> =3D {m_released =3D false}, m_exit_function =3D {}} #19 0x00a80bdf in captured_mi_execute_command (context=3D0x1b29f350, uiout=3D0x1948ea38) at ../../gdb-13.1/gdb/mi/mi-main.c:1855 argv =3D {0x163fb40 "console", 0x1ce22870 "target core C:/Users/orgads/AppData/Local/Temp/Core/core"} mi =3D 0x1948f440 save_token =3D mi =3D save_token =3D argv =3D #20 mi_execute_command (cmd=3D0x46d747f8 "target core C:/Users/orgads/AppData/Local/Temp/Core/core", from_tty=3D1) at ../../gdb-13.1/gdb/mi/mi-main.c:1941 token =3D 0x1b29b520 "" command =3D {_M_t =3D { >> =3D {_M_t =3D { >> =3D { >> =3D {, true>> =3D {_M_head_impl =3D {}}, }, > =3D {_M_head_impl= =3D 0x1b29f350}, }, }}, }} #21 0x00a7519c in mi_execute_command_wrapper (cmd=3D) at ../../gdb-13.1/gdb/mi/mi-interp.c:281 ui =3D 0x190b9308 ui =3D #22 mi_execute_command_input_handler (cmd=3D...) at ../../gdb-13.1/gdb/mi/mi-interp.c:310 mi =3D 0x1948f440 ui =3D 0x190b9308 #23 0x009688d5 in gdb_readline_no_editing_callback (client_data=3D0x190b930= 8) at ../../gdb-13.1/gdb/event-top.c:917 c =3D result =3D line_buffer =3D {buffer =3D 0x0, buffer_size =3D 0, used_size =3D 0} ui =3D 0x190b9308 stream =3D __func__ =3D "gdb_readline_no_editing_callback" #24 0x00968bf0 in stdin_event_handler (error=3D0, client_data=3D0x190b9308)= at ../../gdb-13.1/gdb/event-top.c:541 ui =3D 0x190b9308 #25 0x0125fe69 in handle_file_event (ready_mask=3D, file_ptr=3D) at ../../gdb-13.1/gdbsupport/event-loop.cc:573 mask =3D mask =3D __func__ =3D #26 gdb_wait_for_event (block=3Dblock@entry=3D0) at ../../gdb-13.1/gdbsupport/event-loop.cc:716 mask =3D file_ptr =3D 0x1951c8f8 num_found =3D #27 0x01260756 in gdb_wait_for_event (block=3D0) at ../../gdb-13.1/gdbsupport/event-loop.cc:593 file_ptr =3D num_found =3D 0 select_timeout =3D timeout_p =3D mask =3D #28 gdb_do_one_event (mstimeout=3Dmstimeout@entry=3D-1) at ../../gdb-13.1/gdbsupport/event-loop.cc:217 res =3D event_source_head =3D 1 number_of_sources =3D 3 current =3D timer_id =3D {{m_dummy =3D {}, m_item =3D 0, dont_u= se =3D 0 '\000'}, m_instantiated =3D false} scope_exit_251 =3D #29 0x00a5872c in start_event_loop () at ../../gdb-13.1/gdb/main.c:411 result =3D 0 #30 captured_command_loop () at ../../gdb-13.1/gdb/main.c:471 ui =3D 0x190b9308 #31 0x00a5a635 in captured_main (data=3D0x5efec4) at ../../gdb-13.1/gdb/main.c:1330 context =3D 0x5efec4 context =3D ex =3D #32 gdb_main (args=3Dargs@entry=3D0x5efec4) at ../../gdb-13.1/gdb/main.c:13= 45 No locals. #33 0x0139f100 in main (argc=3D3, argv=3D0x17a14d78) at ../../gdb-13.1/gdb/= gdb.c:32 args =3D {argc =3D 3, argv =3D 0x17a14d78, interpreter_p =3D 0x158a= 044 "console"} --=20 You are receiving this mail because: You are on the CC list for the bug.=