public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug dap/30680] [gdb/dap] ThreadSanitizer: data race gdbsupport/event-pipe.h:44 in event_pipe::is_open() const
Date: Tue, 25 Jul 2023 10:46:35 +0000	[thread overview]
Message-ID: <bug-30680-4717-cTKM5YkHta@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30680-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=30680

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
A bit more elaborate.

WARNING: ThreadSanitizer: data race (pid=22165)
  Read of size 4 at 0x00000261ca40 by thread T13:
    #0 event_pipe::is_open() const
/data/vries/gdb/src/gdb/../gdbsupport/event-pipe.h:44 (gdb+0x92f381) (BuildId:
c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #1 inf_ptrace_target::async_file_mark_if_open()
/data/vries/gdb/src/gdb/inf-ptrace.h:73 (gdb+0x92f381)
    #2 sigchld_handler /data/vries/gdb/src/gdb/linux-nat.c:4238 (gdb+0x92f381)
    #3 <null> <null> (libtsan.so.2+0x3e2cc) (BuildId:
8f2a9be581a0fcb3d7109755a6067408093b9dbd)
    #4 _Py_read <null> (libpython3.11.so.1.0+0x2590e9) (BuildId:
e08746d8f4494e69c6a275f48c30104fb13e6d81)

  Previous write of size 4 at 0x00000261ca40 by main thread:
    #0 event_pipe::close_pipe() /data/vries/gdb/src/gdbsupport/event-pipe.cc:62
(gdb+0x1610e2d) (BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #1 inf_ptrace_target::async_file_close()
/data/vries/gdb/src/gdb/inf-ptrace.h:82 (gdb+0x93033c) (BuildId:
c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #2 linux_nat_target::async(bool) /data/vries/gdb/src/gdb/linux-nat.c:4279
(gdb+0x93033c)
    #3 target_ops::async(bool) /data/vries/gdb/src/gdb/target-delegates.c:2161
(gdb+0xce9b04) (BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #4 target_async(bool) /data/vries/gdb/src/gdb/target.c:4338 (gdb+0xcf987d)
(BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #5 inferior_event_handler(inferior_event_type)
/data/vries/gdb/src/gdb/inf-loop.c:52 (gdb+0x8b761a) (BuildId:
c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #6 fetch_inferior_event() /data/vries/gdb/src/gdb/infrun.c:4501
(gdb+0x8f564e) (BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #7 inferior_event_handler(inferior_event_type)
/data/vries/gdb/src/gdb/inf-loop.c:42 (gdb+0x8b758c) (BuildId:
c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #8 infrun_async_inferior_event_handler
/data/vries/gdb/src/gdb/infrun.c:9820 (gdb+0x8d4fc7) (BuildId:
c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #9 check_async_event_handlers() /data/vries/gdb/src/gdb/async-event.c:338
(gdb+0x5a640f) (BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #10 gdb_do_one_event(int) /data/vries/gdb/src/gdbsupport/event-loop.cc:221
(gdb+0x1600024) (BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #11 wait_sync_command_done() /data/vries/gdb/src/gdb/top.c:426
(gdb+0xd1874b) (BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #12 maybe_wait_sync_command_done(int) /data/vries/gdb/src/gdb/top.c:443
(gdb+0xd1cb4c) (BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #13 execute_command(char const*, int) /data/vries/gdb/src/gdb/top.c:576
(gdb+0xd1cb4c)
    #14 execute_control_command_1 /data/vries/gdb/src/gdb/cli/cli-script.c:529
(gdb+0x675883) (BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #15 execute_control_command(command_line*, int)
/data/vries/gdb/src/gdb/cli/cli-script.c:701 (gdb+0x675d0e) (BuildId:
c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #16 execute_control_commands(command_line*, int)
/data/vries/gdb/src/gdb/cli/cli-script.c:411 (gdb+0x675e59) (BuildId:
c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #17 operator() /data/vries/gdb/src/gdb/cli/cli-script.c:432 (gdb+0x675ef7)
(BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #18 __invoke_impl<void, execute_control_commands_to_string(command_line*,
int)::<lambda()>&> /usr/include/c++/13/bits/invoke.h:61 (gdb+0x675ef7)
    #19 __invoke_r<void, execute_control_commands_to_string(command_line*,
int)::<lambda()>&> /usr/include/c++/13/bits/invoke.h:111 (gdb+0x675ef7)
WROTE: <<<{"type": "event", "event": "output", "body": {"category": "stdout",
"output": "    #20 _M_invoke /usr/include/c++/13/bits/std_function.h:290
(gdb+0x675ef7)
    #21 std::function<void ()>::operator()() const
/usr/include/c++/13/bits/std_function.h:591 (gdb+0xd189c1) (BuildId:
c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #22 execute_fn_to_ui_file(ui_file*, std::function<void ()>)
/data/vries/gdb/src/gdb/top.c:630 (gdb+0xd189c1)
    #23 execute_fn_to_string(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >&, std::function<void ()>, bool)
/data/vries/gdb/src/gdb/top.c:644 (gdb+0xd18bab) (BuildId:
c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #24 execute_control_commands_to_string[abi:cxx11](command_line*, int)
/data/vries/gdb/src/gdb/cli/cli-script.c:430 (gdb+0x672034) (BuildId:
c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #25 execute_gdb_command /data/vries/gdb/src/gdb/python/python.c:690
(gdb+0xb1176e) (BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #26 <null> <null> (libpython3.11.so.1.0+0x1cd27c) (BuildId:
e08746d8f4494e69c6a275f48c30104fb13e6d81)
    #27 std::function<void ()>::operator()() const
/usr/include/c++/13/bits/std_function.h:591 (gdb+0xbc8db2) (BuildId:
c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #28 run_events /data/vries/gdb/src/gdb/run-on-main-thread.c:76
(gdb+0xbc8db2)
    #29 handle_file_event /data/vries/gdb/src/gdbsupport/event-loop.cc:573
(gdb+0x15fe861) (BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #30 gdb_wait_for_event /data/vries/gdb/src/gdbsupport/event-loop.cc:694
(gdb+0x15feead) (BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #31 gdb_do_one_event(int) /data/vries/gdb/src/gdbsupport/event-loop.cc:264
(gdb+0x15fff9a) (BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #32 start_event_loop /data/vries/gdb/src/gdb/main.c:412 (gdb+0x98ea81)
(BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #33 captured_command_loop /data/vries/gdb/src/gdb/main.c:476 (gdb+0x98ea81)
    #34 captured_main /data/vries/gdb/src/gdb/main.c:1320 (gdb+0x992784)
(BuildId: c3b5cbc2b30d2ab9521ca0586222e0001ad66898)
    #35 gdb_main(captured_main_args*) /data/vries/gdb/src/gdb/main.c:1339
(gdb+0x992784)
    #36 main /data/vries/gdb/src/gdb/gdb.c:32 (gdb+0x47ab01) (BuildId:
c3b5cbc2b30d2ab9521ca0586222e0001ad66898)

  Location is global 'inf_ptrace_target::m_event_pipe' of size 8 at
0x00000261ca40 (gdb+0x261ca40)

SUMMARY: ThreadSanitizer: data race
/data/vries/gdb/src/gdb/../gdbsupport/event-pipe.h:44 in event_pipe::is_open()
const"

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  reply	other threads:[~2023-07-25 10:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25 10:33 [Bug dap/30680] New: " vries at gcc dot gnu.org
2023-07-25 10:46 ` vries at gcc dot gnu.org [this message]
2023-07-25 11:10 ` [Bug dap/30680] " vries at gcc dot gnu.org
2023-07-25 11:51 ` vries at gcc dot gnu.org
2023-07-25 12:36 ` tromey at sourceware dot org
2023-07-26 12:12 ` vries at gcc dot gnu.org
2023-07-26 16:23 ` vries at gcc dot gnu.org
2023-07-26 16:57 ` vries at gcc dot gnu.org
2023-07-26 16:59 ` vries at gcc dot gnu.org
2023-07-28 11:01 ` vries at gcc dot gnu.org
2023-07-28 16:04 ` tromey at sourceware dot org
2023-07-28 16:20 ` vries at gcc dot gnu.org
2023-07-28 17:58 ` tromey at sourceware dot org
2023-07-28 18:10 ` tromey at sourceware dot org
2023-07-31 12:37 ` cvs-commit at gcc dot gnu.org
2023-07-31 12:38 ` tromey at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-30680-4717-cTKM5YkHta@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).