From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A3A473858D33; Sun, 25 Dec 2022 20:47:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3A473858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1672001265; bh=KpVhihvXJdJkdY/NeM/a1MjZ4Pq4JPFkZeX2liL1dWc=; h=From:To:Subject:Date:From; b=J5KohKiU8vte1IksbWOlSCVczM3Rla5vapUUBFgDKenfP9VaWRcn85KrrwyNptbRE cbDbPXHAmK5QbgBIrzl8oUGqhR6cIF+nFph5JGs94xMC5cBEiEAo3S58ZLWQBNB1Gj QHjJp/NfyZzj8r9e5fG0VTyenzAP4gXBJbtrTjcE= From: "philippe.waroquiers at skynet dot be" To: gdb-prs@sourceware.org Subject: [Bug gdb/29941] New: Inferior call strlen(p) gives segfaults in GDB 13, (somewhat?) works in GDB11 and GDB12 Date: Sun, 25 Dec 2022 20:47:44 +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: philippe.waroquiers at skynet dot be 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29941 Bug ID: 29941 Summary: Inferior call strlen(p) gives segfaults in GDB 13, (somewhat?) works in GDB11 and GDB12 Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: philippe.waroquiers at skynet dot be Target Milestone: --- Compile the below with gcc -g -o m m.c #include int main() { char p[10]; p[0] =3D 'a'; p[1] =3D 0; return strlen(p); } gdb --nx ./m --ex 'b 7' --ex 'run' --ex 'print strlen(p)' --ex 'continue' -= -ex quit With GDB 11.1, it sometimes works, sometimes gives Aborted but seems to work when the print strlen is done interactive. With GDB 12.1, same behaviour With GDB 13.0.50.20221218, it systematically gives a segfault. (stacktrace given below). Fatal signal: Segmentation fault ----- Backtrace ----- 0x55adb64e7159 gdb_internal_backtrace_1 ../../gdb-13.0.50.20221218/gdb/bt-utils.c:122 0x55adb64e7159 _Z22gdb_internal_backtracev ../../gdb-13.0.50.20221218/gdb/bt-utils.c:168 0x55adb65fef8f handle_fatal_signal ../../gdb-13.0.50.20221218/gdb/event-top.c:956 0x55adb65ff0fe handle_sigsegv ../../gdb-13.0.50.20221218/gdb/event-top.c:1029 0x7fb88929b13f ??? ./nptl/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0 0x55adb66226bf _Z14get_frame_arch14frame_info_ptr ../../gdb-13.0.50.20221218/gdb/frame.c:2909 0x55adb6623c75 _Z12get_frame_sp14frame_info_ptr ../../gdb-13.0.50.20221218/gdb/frame.c:2997 0x55adb6665eb8 _Z27call_function_by_hand_dummyP5valueP4typeN3gdb10array_viewIS0_EEPFvPviES= 6_ ../../gdb-13.0.50.20221218/gdb/infcall.c:898 0x55adb65fc940 _ZN4expr9operation16evaluate_funcallEP4typeP10expression6nosidePKcRKSt6vect= orISt10unique_ptrIS0_St14default_deleteIS0_EESaISC_EE ../../gdb-13.0.50.20221218/gdb/eval.c:702 0x55adb65f914d _ZN10expression8evaluateEP4type6noside ../../gdb-13.0.50.20221218/gdb/eval.c:101 0x55adb67359ff process_print_command_args ../../gdb-13.0.50.20221218/gdb/printcmd.c:1306 0x55adb6735eae print_command_1 ../../gdb-13.0.50.20221218/gdb/printcmd.c:1319 0x55adb651abc4 _Z8cmd_funcP16cmd_list_elementPKci ../../gdb-13.0.50.20221218/gdb/cli/cli-decode.c:2543 0x55adb6861541 _Z15execute_commandPKci ../../gdb-13.0.50.20221218/gdb/top.c:693 0x55adb66d4e75 catch_command_errors ../../gdb-13.0.50.20221218/gdb/main.c:513 0x55adb66d4f41 execute_cmdargs ../../gdb-13.0.50.20221218/gdb/main.c:608 0x55adb66d65a4 captured_main_1 ../../gdb-13.0.50.20221218/gdb/main.c:1299 0x55adb66d717a captured_main ../../gdb-13.0.50.20221218/gdb/main.c:1320 0x55adb66d717a _Z8gdb_mainP18captured_main_args ../../gdb-13.0.50.20221218/gdb/main.c:1345 0x55adb642cdfb main ../../gdb-13.0.50.20221218/gdb/gdb.c:32 --=20 You are receiving this mail because: You are on the CC list for the bug.=