Some non-crash oddities with a Wasm Threads example. |
|||
Issue descriptionFollow-up of 857049 I installed emscripten and did: 1.) Example code from http://timmurphy.org/2010/05/04/pthreads-in-c-a-minimal-working-example/ 2.) Compiled it via emscripten by 'emcc -s USE_PTHREADS=1 -s WASM=1 -o threads.html threads.c' 3.) Enabled chrome://flags/#enable-webassembly-threads 4.) Hosted threads.html via 'python -m SimpleHTTPServer" 5.) Opened file on Mac Canary 69.0.3486.0 (Official Build) canary (64-bit) 6.) Page opens and spinner starts with "Downloading" 7.) Page unresponsive popup appears 8.) Click Wait 9.) Open DevTools to analyze the problem 10.) Spinner freezes, no output on the console, nothing in sources 11.) Chrome Task Manager shows the tab at 100 % CPU usage 12.) Killing the process via the Chrome task manager crashes the tab 13.) Hit Reload on the sad tab page (DevTools still open) 14.) Spinner still stuck at "Downloading" but the DevTools console now shows something meaningful: "wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssebmly': Incorrect response MIME type. Expected 'application/wasm'.". Maybe Python's SimpleHTTPServer simply do not support serving Wasm correctly? Emscripten version is 'emcc (Emscripten gcc/clang-like replacement) 1.38.6 (commit 8512c60588d566bb325b57ef55443ce87492e2b4)' It is very likely that my compiled example is broken, but I would assume that shouldn't produce mentioned result. Instead there should be some feedback to the developer that something and what is broken. If I compile with 'emcc -s USE_PTHREADS=1 -s PHTREAD_POOL_SIZE=2 -s WASM=1 -o threads.html threads.c' the program seems to work correctly btw. The output is correctly plotted to the simulated printf console, which was not the case with the other configuration. The CPU usage goes back to 0 %. The streaming compile error is still plotted to the DevTools console though.
,
Jul 10
Hi Michael, Could you add the compiled code here so that it's easier to reproduce? Thanks!
,
Jul 10
Sure thing.
,
Aug 17
I think I don't understand this issue. What behavior would you expect, and what behavior do you get? For me the page does not get unresponsive. However, the page does not show much, only "Preallocating 2 workers for a pthread spawn pool." in the console, and the spinner at the top saying "All downloads complete". I think there is nothing to do here. please reopen the bug if I am wrong.
,
Aug 20
Sorry for not being clear. The issue was 10.): DevTools didn't seem to be working. This is working now though. It seems we use a PTHREAD_POOL_SIZE is ignored and we spawn threads a appropriate? On Canary I always get "Preallocating 2 workers for a pthread spawn pool." even when setting PTHREAD_POOL_SIZE to something else.
,
Aug 20
As far as I understand the code in threads.tar of #3, in threads.js in line 1423 exactly 2 workers get created. This looks like generated code to me. So I think what you see is working as intended. |
|||
►
Sign in to add a comment |
|||
Comment 1 by hablich@chromium.org
, Jul 9