From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 612E23858D39; Sun, 24 Mar 2024 11:07:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 612E23858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1711278422; bh=lHXbJKNFy/NUpwof0O+Kntyxt/zp2P9TggZbkzD8gBs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ypn38eDCGv3Roud/g7ePqoiPy6XxwZSYP/tqpS8CKKDy4y4wbrcc2nAJJk3aDJ1xH b5Ynvcle7oXnUXr+7OXHNAP1JStfqZpyC4BRdHhoB7+PN7diydlvU1agAhwqT3IzuK /IJjLEaWbOQNLKCZVcM7S7g29yFaa0kwKzmeNx7I= From: "tsqurt at outlook dot com" To: gdb-prs@sourceware.org Subject: [Bug compile/31508] compile not working for some programs Date: Sun, 24 Mar 2024 11:07:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: compile X-Bugzilla-Version: 15.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tsqurt at outlook 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: Message-ID: In-Reply-To: References: 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=3D31508 --- Comment #1 from Tan Senqi --- A new test case to be added, which triggers a segmentation fault: void break_point() {} void foo(int n) { struct S { int i[n]; unsigned int b:1; int i2; } __attribute__ ((packed)) __attribute__ ((aligned (4))); struct S s; break_point();; // break here and run; then command `expr s.i2 =3D 0` } int main(void) { foo(4); return 0; } (gdb) expr s.i2=3D0 /tmp/gdbobj-FjNhCp/out1.c:50:43: error: redeclaration of =E2=80=98__gdb_pro= p_0x17c22c0=E2=80=99 with no linkage 50 | __attribute__ ((unused)) unsigned long __gdb_prop_0x17c22c0; | ^~~~~~~~~~~~~~~~~~~~ /tmp/gdbobj-FjNhCp/out1.c:30:43: note: previous declaration of =E2=80=98__gdb_prop_0x17c22c0=E2=80=99 with type =E2=80=98long unsigned int= =E2=80=99 30 | __attribute__ ((unused)) unsigned long __gdb_prop_0x17c22c0; | ^~~~~~~~~~~~~~~~~~~~ ../../binutils-gdb/gdb/gdbtypes.h:627: internal-error: loc_bitpos: Assertion `m_loc_kind =3D=3D FIELD_LOC_KIND_BITPOS' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. ----- Backtrace ----- 0x4e81b2 gdb_internal_backtrace_1 ../../binutils-gdb/gdb/bt-utils.c:122 0x4e81b2 _Z22gdb_internal_backtracev ../../binutils-gdb/gdb/bt-utils.c:168 0x8adea4 internal_vproblem ../../binutils-gdb/gdb/utils.c:421 0x8ae208 _Z15internal_verrorPKciS0_P13__va_list_tag ../../binutils-gdb/gdb/utils.c:501 0x9f9e31 _Z18internal_error_locPKciS0_z ../../binutils-gdb/gdbsupport/errors.cc:58 0x5324f8 _ZNK5field10loc_bitposEv ../../binutils-gdb/gdb/gdbtypes.h:627 0x5324f8 _ZNK5field10loc_bitposEv ../../binutils-gdb/gdb/gdbtypes.h:625 0x5324f8 convert_struct_or_union ../../binutils-gdb/gdb/compile/compile-c-types.c:118 0x5324f8 convert_type_basic ../../binutils-gdb/gdb/compile/compile-c-types.c:297 0x5324f8 _ZN18compile_c_instance12convert_typeEP4type ../../binutils-gdb/gdb/compile/compile-c-types.c:357 0x53138b convert_one_symbol ../../binutils-gdb/gdb/compile/compile-c-symbols.c:68 0x531a0d convert_symbol_sym ../../binutils-gdb/gdb/compile/compile-c-symbols.c:256 0x531a0d _Z18gcc_convert_symbolPvP13gcc_c_context20gcc_c_oracle_requestPKc ../../binutils-gdb/gdb/compile/compile-c-symbols.c:355 0x7f8fdcd399e7 c_call_binding_oracle ../../gcc/libcc1/libcc1.cc:79 0x7f8fdcd399e7 call<2, (anonymous namespace)::c_call_binding_oracle, gcc_c_oracle_request, char const*> ../../gcc/libcc1/libcc1.cc:148 0x7f8fdcd399e7 call<1, (anonymous namespace)::c_call_binding_oracle, gcc_c_oracle_request> ../../gcc/libcc1/rpc.hh:162 0x7f8fdcd399e7 call<0, (anonymous namespace)::c_call_binding_oracle> ../../gcc/libcc1/rpc.hh:162 0x7f8fdcd399e7 invoke<(anonymous namespace)::c_call_binding_oracle> ../../gcc/libcc1/rpc.hh:181 0x7f8fdcd43071 _ZN10cc1_plugin10connection7do_waitEb ../../gcc/libcc1/connection.cc:135 0x7f8fdcd3c70b _ZN10cc1_plugin10connection14wait_for_queryEv ../../gcc/libcc1/connection.hh:82 0x7f8fdcd3c70b _ZN10cc1_plugin15base_gdb_pluginI13gcc_c_contextE9fork_execEPPcPiS5_ ../../gcc/libcc1/gdbctx.hh:248 0x7f8fdcd3c70b _ZN10cc1_plugin15base_gdb_pluginI13gcc_c_contextE10do_compileEP16gcc_base_c= ontextPKc ../../gcc/libcc1/gdbctx.hh:315 0x541823 _ZN16compile_instance7compileEPKci ../../binutils-gdb/gdb/compile/compile.c:942 0x542333 compile_to_object ../../binutils-gdb/gdb/compile/compile.c:788 0x542333 _Z20eval_compile_commandP12command_linePKc21compile_i_scope_typesPv ../../binutils-gdb/gdb/compile/compile.c:817 0x5433bb compile_code_command ../../binutils-gdb/gdb/compile/compile.c:356 0x51b6f4 _Z8cmd_funcP16cmd_list_elementPKci ../../binutils-gdb/gdb/cli/cli-decode.c:2742 0x8438b6 _Z15execute_commandPKci ../../binutils-gdb/gdb/top.c:571 0x5f2f7f _Z15command_handlerPKc ../../binutils-gdb/gdb/event-top.c:567 0x5f450a _Z20command_line_handlerOSt10unique_ptrIcN3gdb13xfree_deleterIcEEE ../../binutils-gdb/gdb/event-top.c:803 0x5f378c gdb_rl_callback_handler ../../binutils-gdb/gdb/event-top.c:259 0x8f42a4 rl_callback_read_char ../../../binutils-gdb/readline/readline/callback.c:290 0x5f38ad gdb_rl_callback_read_char_wrapper_noexcept ../../binutils-gdb/gdb/event-top.c:195 0x5f3a2c gdb_rl_callback_read_char_wrapper ../../binutils-gdb/gdb/event-top.c:234 0x87e47f stdin_event_handler ../../binutils-gdb/gdb/ui.c:155 0x9faa45 gdb_wait_for_event ../../binutils-gdb/gdbsupport/event-loop.cc:716 0x9fb221 _Z16gdb_do_one_eventi ../../binutils-gdb/gdbsupport/event-loop.cc:264 0x6bcee9 start_event_loop ../../binutils-gdb/gdb/main.c:401 0x6bcee9 captured_command_loop ../../binutils-gdb/gdb/main.c:465 0x6bfa14 captured_main ../../binutils-gdb/gdb/main.c:1339 0x6bfa14 _Z8gdb_mainP18captured_main_args ../../binutils-gdb/gdb/main.c:1358 0x444d54 main ../../binutils-gdb/gdb/gdb.c:39 --------------------- ../../binutils-gdb/gdb/gdbtypes.h:627: internal-error: loc_bitpos: Assertion `m_loc_kind =3D=3D FIELD_LOC_KIND_BITPOS' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) y Please answer y or n. ../../binutils-gdb/gdb/gdbtypes.h:627: internal-error: loc_bitpos: Assertion `m_loc_kind =3D=3D FIELD_LOC_KIND_BITPOS' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) n This is a bug, please report it. For instructions, see: . --=20 You are receiving this mail because: You are on the CC list for the bug.=