-
Notifications
You must be signed in to change notification settings - Fork 202
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
Data race or race condition during exiting/joining a thread #405
Comments
Ah and hte wasm that is produced looks like this: foo.wasm.gz |
Interesting point regarding the call to |
#409 (only build-tested) can fix this. |
i could reproduce the symptom with toywasm and wamr. |
the issue was pointed out by @alexcrichton in WebAssembly#405
* Fix a use-after-free bug for detached threads the issue was pointed out by @alexcrichton in #405 * Rename map_base_lazy_free_queue as it only keeps a single item Also, align the comment style with musl.
I don't believe that this is fixed at this time and I think is coming up again in the discussion of bytecodealliance/wasmtime#8652:
(with a different error each time) |
When I tried adding thread support to rustc in the browser I got weird crashes. I ended up giving up on it as a fair amount of browser devtool bugs made it impossible to debug it, but now that I see this bug, it may have been the case that I had been hitting this bug. |
you still need |
This is a program which spawns N threads. Each thread will then, M times, spawn a thread and join the thread. This is intended to exercise concurrently spawning threads.
This is then run with:
This will produce no output and exit with status zero, but not expectedly. The
ok!
is not printed at the end of themain
function. The reason for this appears to be that this exit is reached because a thread confuses itself as the last remaining thread.I did a bit of poking to see if this could be fixed. The
__tl_lock()
function, for example, is aliased to adummy_0
in many files. I wasn't able to fix it, however.While looking around in this file, however, I also noticed that
free
is used to deallocate a thread stack which I don't believe is correct because the thread stack is in use by the thread callingfree
, which means that after the memory has been deallocated some stack management may still be happening which may modify the free'd memory. I haven't run into this myself, though, and commenting out thefree
did not fix my issue above.cc @abrown
The text was updated successfully, but these errors were encountered: