From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1B2033858CD1; Fri, 8 Sep 2023 14:27:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B2033858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694183222; bh=H3uqQ5/Ra4PLMiFP9s8dDOQnS76CUNn/2Sg5uKD6McQ=; h=From:To:Subject:Date:From; b=S5A5UiEBlJ44S3HxvvwI6KjAkcIs3fw27j9OG6iO9QMSEecPLuMdMWVV4NVFLQ0WE 3wD4J4Lgmk7ZMCX9zpb1Lh7jeeGplK9Mm0sf4EKXWfCCL8ml9LVF+nvE7c+AjC9EYg K5u3cC2kthuyIFnvu0yXe3xCkzz9Kun0iNFKKuII= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/30837] New: [gdb/symtab, index-cache] data race on current_inferior_ Date: Fri, 08 Sep 2023 14:27:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org 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 attachments.created 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=3D30837 Bug ID: 30837 Summary: [gdb/symtab, index-cache] data race on current_inferior_ Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: symtab Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- Created attachment 15106 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D15106&action=3Ded= it gdb.log When building gdb with -fsanitize=3Dthreads and using soon to be submitted = target board cc-with-index-cache, I run into a data race in test-case gdb.ada/non-ascii-utf-8.exp ... =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D^M ^[[1m^[[31mWARNING: ThreadSanitizer: data race (pid=3D25220)^M ^[[1m^[[0m^[[1m^[[34m Read of size 8 at 0x000003342928 by thread T12:^M ^[[1m^[[0m #0 gdb::ref_ptr::get() const /data/vries/gdb/src/gdb/../gdbsupport/gdb_ref_ptr.h:132 (gdb+0xa690b8= )^M #1 current_inferior() /data/vries/gdb/src/gdb/inferior.c:57 (gdb+0xa63b74)^M #2 target_supports_terminal_ours() /data/vries/gdb/src/gdb/target.c:1121 (gdb+0xfaefd4)^M #3 vwarning(char const*, __va_list_tag*) /data/vries/gdb/src/gdb/utils.c:147 (gdb+0x10e54c5)^M #4 warning(char const*, ...) /data/vries/gdb/src/gdbsupport/errors.cc:34 (gdb+0x1dc04e4)^M #5 ada_encode_1 /data/vries/gdb/src/gdb/ada-lang.c:1000 (gdb+0x47d348)^M #6 ada_encode[abi:cxx11](char const*, bool) /data/vries/gdb/src/gdb/ada-lang.c:1159 (gdb+0x47dd12)^M #7 write_cooked_index /data/vries/gdb/src/gdb/dwarf2/index-write.c:1142 (gdb+0x832e42)^M #8 write_gdbindex /data/vries/gdb/src/gdb/dwarf2/index-write.c:1236 (gdb+0x83348b)^M ... ^M ^[[1m^[[34m Previous write of size 8 at 0x000003342928 by main thread:^M ^[[1m^[[0m #0 gdb::ref_ptr::reset(inferior*) /data/vries/gdb/src/gdb/../gdbsupport/gdb_ref_ptr.h:125 (gdb+0xa6a2bf)^M #1 gdb::ref_ptr::operator=3D(gdb::ref_ptr&&) /data/vries/gdb/src/gdb/../gdbsupport/gdb_ref_ptr.h:113 (gdb+0xa691cc)^M #2 set_current_inferior(inferior*) /data/vries/gdb/src/gdb/inferior.c:66 (gdb+0xa63bf6)^M #3 switch_to_inferior_no_thread(inferior*) /data/vries/gdb/src/gdb/inferior.c:714 (gdb+0xa66df9)^M #4 scoped_restore_current_thread::restore() /data/vries/gdb/src/gdb/thread.c:1397 (gdb+0xfe1f9b)^M #5 scoped_restore_current_thread::~scoped_restore_current_thread() /data/vries/gdb/src/gdb/thread.c:1415 (gdb+0xfe20c9)^M #6 scoped_restore_current_pspace_and_thread::~scoped_restore_current_pspace_an= d_thread() /data/vries/gdb/src/gdb/progspace-and-thread.h:29 (gdb+0x628ef7)^M #7 bp_loc_is_permanent /data/vries/gdb/src/gdb/breakpoint.c:8532 (gdb+0x609bed)^M #8 code_breakpoint::add_location(symtab_and_line const&) /data/vries/gdb/src/gdb/breakpoint.c:8509 (gdb+0x609acc)^M #9 internal_breakpoint::internal_breakpoint(gdbarch*, bptype, unsigned long) /data/vries/gdb/src/gdb/breakpoint.c:350 (gdb+0x6282a3)^M #10 create_internal_breakpoint /data/vries/gdb/src/gdb/breakpoint.c:3454 (gdb+0x5f71c0)^M #11 create_internal_breakpoint /data/vries/gdb/src/gdb/breakpoint.c:3485 (gdb+0x5f7346)^M #12 create_exception_master_breakpoint_hook /data/vries/gdb/src/gdb/breakpoint.c:3856 (gdb+0x5f86dc)^M #13 create_exception_master_breakpoint /data/vries/gdb/src/gdb/breakpoint.c:3882 (gdb+0x5f8899)^M #14 breakpoint_re_set() /data/vries/gdb/src/gdb/breakpoint.c:13262 (gdb+0x61c3f1)^M #15 symbol_file_command(char const*, int) /data/vries/gdb/src/gdb/symfile.c:1686 (gdb+0xf44c8d)^M #16 file_command /data/vries/gdb/src/gdb/exec.c:554 (gdb+0x94f99f)^M ... --=20 You are receiving this mail because: You are on the CC list for the bug.=