-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug - UB #278
Comments
|
Exactly that was my thinking. I was suspecting hashmap being empty when created first but that's not actually the case since it's always created with three elements. Maybe testing that part of code under fuzzer and miri would help. |
OP here! I've reproduced this bug in debug mode with the following stacktrace. As suspected it is happening in
|
How does
|
If you still have this open in GDB, can you go to frame 7 ( |
I attempted to "ask the compiler" by refactoring locking and unlocking a bit hoping it'd uncover the problem. Sadly it didn't but I thought the change could still be useful so I opened #279. Maybe more invariants can be checked this way, I just didn't find enough time to do it yet. |
Doesn't look correct to me but maybe I'm missing something? |
And |
It it cleared here.
That shouldn't matter since we are publishing a newer hash table. |
Time zones blow, Here is the output from another run of gdb
It looks like the old table has somehow been poisoned with a bad memory address
I'll keep trying to debug this to try and see what is poisoning the table |
Can you try compiling and running the program with |
Sorry for the late response I've only gotten around to trying this out now. I can't seem to compile with that flag on. Is there something silly im missing? It seems like any dependency I have which uses procedural macros doesn't like having this flag turned on:
As a side note, I tried disabling the parking_lot optimizations from tokio and now my reproducible example doesn't segfault. |
Try passing |
I've got a segfault on code in a similar area (caused by
I'm not yet convinced that this isn't my fault, though, so it could potentially be a red herring. |
Never mind, that segfault appears to have been caused by another library. |
Can you tell me more about it? It seems very strange that another library could affect the internals of I think there is a bug somewhere in |
I ran the same code with threadsan and saw a lot of race conditions caused by https://github.com/DoumanAsh/async-timer. After replacing async-timer with tokio::time the segfault went away 🤷🏻♂️ Unfortunately the code itself is closed source, otherwise I'd totally share it with you |
I had the thought of |
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.The text was updated successfully, but these errors were encountered: