parking_lot: Possible bug - UB
Based on recent reddit post there may be a bug in CondVar::wait_until_internal()
. Sadly the OP didn’t provide more information and I didn’t find anything wrong in the code. I didn’t check too deeply so it’d be nice if someone else tried to check too if I missed something.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 18 (7 by maintainers)
OP here! I’ve reproduced this bug in debug mode with the following stacktrace. As suspected it is happening in
grow_hashtable
Can you tell me more about it? It seems very strange that another library could affect the internals of
parking_lot
.I think there is a bug somewhere in
parking_lot
, but it is very difficult for me to debug this without having a way to reproduce the crash.Try passing
--target x86_64-unknown-linux-gnu
or whatever your system is to cargo. This will prevent cargo from usingRUSTFLAGS
when building host dependencies like proc macros and build scripts.Can you try compiling and running the program with
RUSTFLAGS=-Zsanitizer=address
?It it cleared here.
That shouldn’t matter since we are publishing a newer hash table.
lock_bucket
will immediately abort and retry with the new hash table, and never read the invalid pointers.