-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Revert 4.0.11 threads normal-mutex debug implementation #26635
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
6f7004e
a3c997b
0c28704
a77220e
40e8bfa
47fa005
01b389c
dd8d0da
4dda4be
48cff0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5243,6 +5243,11 @@ def test_wasm_worker_proxied_function(self): | |
| # Test that code does not crash in ASSERTIONS-disabled builds | ||
| self.btest('wasm_worker/proxied_function.c', expected='0', cflags=['--js-library', test_file('wasm_worker/proxied_function.js'), '-sWASM_WORKERS', '-sASSERTIONS=0']) | ||
|
|
||
| def test_wasm_worker_pthread_mutex_debug_allocator_regression(self): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a link to (And also in the test source code).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in latest (in case this branch is still potentially useful) |
||
| self.set_setting('ASSERTIONS') | ||
|
slowriot marked this conversation as resolved.
Outdated
|
||
| self.btest('wasm_worker/pthread_mutex_debug_allocator_regression.cpp', | ||
| expected='0', cflags=['-pthread', '-sWASM_WORKERS']) | ||
|
slowriot marked this conversation as resolved.
Outdated
|
||
|
|
||
| @no_firefox('no 4GB support yet') | ||
| @no_2gb('uses MAXIMUM_MEMORY') | ||
| @no_4gb('uses MAXIMUM_MEMORY') | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #include <cstdint> | ||
| #include <emscripten.h> | ||
| #include <emscripten/wasm_worker.h> | ||
|
|
||
| static void worker_loop() { | ||
| for (;;) { | ||
| delete new std::uint8_t{0}; | ||
|
slowriot marked this conversation as resolved.
Outdated
|
||
| } | ||
| } | ||
|
|
||
| static void main_loop() { | ||
| static unsigned ticks; | ||
| static bool reported; | ||
| new std::uint8_t{0}; | ||
|
slowriot marked this conversation as resolved.
Outdated
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The the bug still reproduce if you convert this from (You might need to add
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this test is basically equivalent to the CPP and C repros I provided in the issue description at #26619. Only the C++ path is tested here because I understand them to be identical.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would rather have just the C version of the test. We tend to prefer C tests for various reasons.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sbc100 C++ test replaced with the C equivalent in the latest version. Please let me know if you'd like any other changes.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you able to reproduce the issue using that C version on the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sbc100 just catching up on those now, will confirm fully shortly, but it seems that my original repros detailed in #26619 (comment) no longer crash on
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can can still repro the crash with the C++ version on main:
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #include <cstdint>
#include <cstdio>
#include <emscripten.h>
#include <emscripten/wasm_worker.h>
auto main() -> int {
emscripten_wasm_worker_post_function_v(emscripten_malloc_wasm_worker(1024 * 1024), []{
printf("start\n");
for (int i = 0; i < 70'000'000; ++i) {
if ((i % 1000000) == 0) {
printf("i=%d\n", i);
}
delete new uint8_t{0};
}
printf("done\n");
});
emscripten_set_main_loop([]{new uint8_t{0};}, 0, false);
return EXIT_SUCCESS;
} |
||
| if (!reported && ++ticks == 120) { | ||
| reported = true; | ||
| REPORT_RESULT(0); | ||
| } | ||
| } | ||
|
|
||
| int main() { | ||
| emscripten_wasm_worker_post_function_v(emscripten_malloc_wasm_worker(1024 * 1024), worker_loop); | ||
| emscripten_set_main_loop(main_loop, 0, false); | ||
| return 0; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.