-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
ASan hit on background threads broken with "TypeError: Cannot read property 'length' of undefined" #13205
Comments
This works for me with ToT... at least it generates an asan warning:
But that looks like a separate issue. Can you confirm that the latest emscripten ToT works for you too? (and close this issue if so). |
Works for me on "tot" too, so it's been fixed by one of the recent pthreads/asan fixes. Thanks! |
Reopening this - I believe it still reproes, but only when running it in the browser (and not in Node). That was the crucial part that was mentioned in the initial comment and forgotten later; apologies for missing it when closing the issue. I've double-checked that the issue is present on a fresh ToT release (release-4d185e1410f1d5f159498fa776279df88d124f54, emscripten commit 3307679). A fuller stack trace (collected by adding
|
Hello, is there any workaround for this issue? (Besides running the program under Node, since it's not possible for the real-world program I'm trying to debug, due to it relying on the Extension APIs.) |
I'm not aware of any fix this yet |
I'm seeing a similar issue when running nontrivial programs under Node.js as well:
(no minified repro for this) |
In my case, it seems that wasmOffsetConverter is not being initialized prior to the worker thread receiving it via. postMessage. In the code below the second promise gets called and sends over an undefined value in place of wasmOffsetConverter. I was able to workaround this by chaining the first promise to the second.
|
If ASan wants to show a stack trace on a pthread (like the trace to get to an allocation that was later used after free), then it needs access to the WasmOffsetConverter. We had a race there, where it could postMessage the WasmOffsetConverter before that object was actually filled with the data it needs (function offsets). See details in comments. Fixes #13205
If Asan failure happens on the background thread, "TypeError: Cannot read property 'length' of undefined" is generated instead of the actual ASan output.
Example program:
Build flags:
The full console output when running in the browser:
Emscripten version: ToT (since ASan+pthreads is broken in older releases - see #13183).
The text was updated successfully, but these errors were encountered: