[PATCH 0/2] Fix some races seen by thread sanitizer

Tom Tromey tom@tromey.com
Tue Apr 9 16:13:15 GMT 2024


>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:

Tom> PR gdb/31264 points out some reports from thread sanitizer when
Tom> running some gdb tests.

Tom> I couldn't reproduce exactly these reports, but I did find that
Tom> bfd_check_format_matches uses some globals without locking, which is
Tom> definitely not thread-safe.  These are fixed in patch #1.

Tom> And, when working on this, I did manage to get other thread sanitizer
Tom> reports from the same gdb test case -- a problem when
Tom> bfd_check_format_matches is called simultaneously with
Tom> bfd_cache_close_all.  This is fixed in patch #2.

Tom> For patch #1, the per-xvec error-emission code was written to fix some
Tom> fuzzer bug, but I don't have access to the original test file here, so
Tom> I wasn't really able to test that the reimplementation is correct.

Tom> For patch #2, see the note in that commit about the archive case in
Tom> bfd_cache_lookup_worker.

Tom> Let me know what you think.

Ping.

These patches are on the short list blocking GDB 15, see:

https://sourceware.org/pipermail/gdb-patches/2024-April/207885.html

Tom


More information about the Binutils mailing list