From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A12673858C33; Thu, 3 Nov 2022 13:46:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A12673858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667483186; bh=jHizb1TFjUYAT5dW0aYRZPZktnvRkmzzDvTYWGWkQwg=; h=From:To:Subject:Date:From; b=PJZ+11tQdTeKZdnespjtvjLOkBntXyPmrMebgpC46vOyiuJ+bBQwlBlZsustu6nxb tg8EzDYwqoMIMxIkD2qiYHBmoEpO8+Wc2C4NcgnI6UCZhV8eDQQ74N8Bz1rKkJDZh1 N7z2jx6/QxbETgh2mLkUIJ+9f7NC1RdzL8gmGA4M= From: "simark at simark dot ca" To: gdb-prs@sourceware.org Subject: [Bug gdb/29747] New: Crash when stepping over printf without debug symbols Date: Thu, 03 Nov 2022 13:46:07 +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: simark at simark dot ca 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=3D29747 Bug ID: 29747 Summary: Crash when stepping over printf without debug symbols Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: simark at simark dot ca Target Milestone: --- $ cat test.c #include int main() { printf("Hi\n"); return 0; } $ gcc test.c -O0 -o test=20 $ ./gdb -q -nx --data-directory=3Ddata-directory test -ex start -ex s Reading symbols from test... (No debugging symbols found in test) Temporary breakpoint 1 at 0x1151 Starting program: /home/smarchi/build/binutils-gdb/gdb/test=20 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Temporary breakpoint 1, 0x0000555555555151 in main () Single stepping until exit from function main, which has no line number information. /home/smarchi/src/binutils-gdb/gdb/infrun.c:6960:64: runtime error: member = call on null pointer of type 'struct symbol' The crash happens here: #0 __sanitizer::Die () at ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cpp:50 #1 0x00007ffff5dd7128 in __ubsan::__ubsan_handle_type_mismatch_v1_abort (Data=3D, Pointer=3D) at ../../../../src/libsanitizer/ubsan/ubsan_handlers.cpp:148 #2 0x000055556183e1a7 in process_event_stop_test (ecs=3D0x7fffffffccd0) at /home/smarchi/src/binutils-gdb/gdb/infrun.c:6960 #3 0x0000555561838ea4 in handle_signal_stop (ecs=3D0x7fffffffccd0) at /home/smarchi/src/binutils-gdb/gdb/infrun.c:6615 #4 0x000055556182f77b in handle_inferior_event (ecs=3D0x7fffffffccd0) at /home/smarchi/src/binutils-gdb/gdb/infrun.c:5866 In this code: if (execution_direction !=3D EXEC_REVERSE && ecs->event_thread->control.step_over_calls =3D=3D STEP_OVER_UNDEBU= GGABLE && in_solib_dynsym_resolve_code (ecs->event_thread->stop_pc ()) && !in_solib_dynsym_resolve_code ( ecs->event_thread->control.step_start_function->value_block () ->entry_pc ())) ecs->event_thread->control.step_start_function is nullptr and gets dereferenced. --=20 You are receiving this mail because: You are on the CC list for the bug.=