Bug 31626 - [gdb/symtab] data races in gdb.rust/dwindex.exp
Summary: [gdb/symtab] data races in gdb.rust/dwindex.exp
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: symtab (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 29366 31751
  Show dependency treegraph
 
Reported: 2024-04-10 11:27 UTC by Tom de Vries
Modified: 2024-05-17 14:25 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
gdb.log (6.80 KB, text/x-log)
2024-04-10 11:27 UTC, Tom de Vries
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom de Vries 2024-04-10 11:27:58 UTC
Created attachment 15457 [details]
gdb.log

I did a run with fedora asahi 39 and -fsanitize=thread, and ran into a issues I haven't seen before in test-case gdb.rust/dwindex.exp:
...
SUMMARY: ThreadSanitizer: data race bfd.h:2449 in bfd_get_section_limit_octets
SUMMARY: ThreadSanitizer: data race /home/vries/gdb/src/bfd/bfdio.c:514 in bfd_seek
...

Rust compiler version:
...
$ rustc --version
rustc 1.77.0 (aedd173a2 2024-03-17) (Fedora 1.77.0-1.fc39)
...
Comment 1 Tom Tromey 2024-05-17 14:25:54 UTC
Both load_auto_scripts_for_objfile and gdb_bfd_map_section call
bfd_get_full_section_contents, which might seek/read.

The BFD threading approach is that really only one thread
can use a BFD at a time, so in this case we probably need
the locking in gdb.