-
-
Notifications
You must be signed in to change notification settings - Fork 651
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
Reliable compiler deadlock in odin build
and odin check
#4615
Comments
After instrumenting |
Reproduced (with exactly 2 structs) on all three configs ( Minimal thread count at The mutexes are copied correctly. Instrumented BlockingMutex(i32 state) : state_(state) {
printf("%s %p\n", names[state], this);
}
constexpr BlockingMutex() : state_{} {}
BlockingMutex(BlockingMutex const &other)
: state_(other.state().load(std::memory_order_acquire)) {
printf("%s %p %p\n", names[state_], this, &other);
} Built with and without Context of repro
I'm using a chain of scripts to launch the binary multiple times. I initially used multiple processes, but with MT on each process I just get more noise. I run the binary again and again until it deadlocks. Using # run_sequential.bash <logs directory>
mkdir -p $1
i=0
while true; do
(( i += 1 ))
echo -n .
if ! timeout -s IOT 5 bash run_one.bash $1; then
echo $1 :: $i
break
fi
done # run_one.bash <logs directory>
# NOTE: `rr record` does not work, it's too slow (apparently) to find this deadlock.
~/Odin/odin check . 2> $1/err.txt 1> $1/log.txt
exit 0 These points may be of use, may just be noise:
|
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
I also reproduced the error on debug builds on 597fba7
The following code (somewhat) reliably deadlocks the compiler:
Failure Information (for bugs)
running
odin check .
on the above resulting in 71 deadlocks when running it 1000 times. Duplicating the above code (addingStruct3
toStruct7
, along withclear
anditerate
calls) seemed to result in more failures with 116 deadlocks out of 1000 trials.I don't know if it fails at the same spot every time, but I'm seeing thread 1 blocking trying to lock a mutex:
While every other thread is blocking here:
Steps to Reproduce
odin check .
orodin build .
on the above script until it deadlocks (it's expected to fail the check, but this breaks on well-formed programs too)The text was updated successfully, but these errors were encountered: