emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.62k stars 3.28k forks source link

Test browser.test_wasm_polyfill_prototype fails on OS X. #3855

Closed juj closed 5 years ago

juj commented 8 years ago

Running the test fails on OS X with the following:

Jukkas-MacBook-Pro:incoming jjylanki$ python tests/runner.py browser.test_wasm_polyfill_prototype
WARNING:root:use EM_ALL_ENGINES=1 in the env to run against all JS engines, which is slower but provides more coverage
[Browser harness server on process 36518]

Running the browser tests. Make sure the browser allows popups from localhost.

test_wasm_polyfill_prototype (test_browser.browser) ... *** verify that running the wasmator after emcc works
build executables
save the before js
process input
run polyfill packer on test.o.js.temp2.js

/Users/jjylanki/.emscripten_cache/pack-asmjs.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filename);if(!ret&&fil
Assertion failed: u.u32_ > INT32_MAX, at: /Users/jjylanki/emsdk_git/emscripten/incoming/third_party/wasm-polyfill/src/pack-asmjs.cpp,1268,NumLit at Error
    at jsStackTrace (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:1:20862)
    at stackTrace (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:1:21045)
    at ___assert_fail (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:1:103591)
    at Rb (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:12:1981)
    at ac (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:12:38093)
    at jc (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:12:53238)
    at mc (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:12:57536)
    at ac (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:12:40156)
    at lc (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:12:54597)
    at mc (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:12:55910)
Traceback (most recent call last):
  File "/Users/jjylanki/emsdk_git/emscripten/incoming/third_party/wasm-polyfill/wasmator.py", line 94, in <module>
    out = emscripten.run_js(pack_asmjs, args=[os.path.basename(tempfile2), 'output.binary'], stdout=PIPE)
  File "/Users/jjylanki/emsdk_git/emscripten/incoming/tools/shared.py", line 868, in run_js
    return jsrun.run_js(filename, engine, *args, **kw)
  File "/Users/jjylanki/emsdk_git/emscripten/incoming/tools/jsrun.py", line 75, in run_js
    raise Exception('Expected the command ' + str(command) + ' to finish with return code ' + str(assert_returncode) + ', but it returned with code ' + str(proc.returncode) + ' instead! Output: ' + str(ret)[:error_limit])
Exception: Expected the command ['/Users/jjylanki/emsdk_git/node/4.1.1_64bit/bin/node', '/Users/jjylanki/.emscripten_cache/pack-asmjs.js', 'test.o.js.temp2.js', 'output.binary'] to finish with return code 0, but it returned with code 7 instead! Output: 
ERROR
[Browser harness server terminated]

======================================================================
ERROR: test_wasm_polyfill_prototype (test_browser.browser)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jjylanki/emsdk_git/emscripten/incoming/tests/test_browser.py", line 2809, in test_wasm_polyfill_prototype
    build()
  File "/Users/jjylanki/emsdk_git/emscripten/incoming/tests/test_browser.py", line 2797, in separate
    subprocess.check_call([PYTHON, path_from_root('third_party', 'wasm-polyfill', 'wasmator.py'), 'test.o.js', 'test.o.wasm', 'Module'])
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '['/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python', '/Users/jjylanki/emsdk_git/emscripten/incoming/third_party/wasm-polyfill/wasmator.py', 'test.o.js', 'test.o.wasm', 'Module']' returned non-zero exit status 1

----------------------------------------------------------------------
Ran 1 test in 3.445s

FAILED (errors=1)

I tried to fix it with https://github.com/juj/emscripten/commit/3fa8bee101bbec61ca9594bbb5c54be6b7b12f2b , but it looks a bit more complicated than that, because afterwards it is giving me

Jukkas-MacBook-Pro:incoming jjylanki$ python tests/runner.py browser.test_wasm_polyfill_prototype
WARNING:root:use EM_ALL_ENGINES=1 in the env to run against all JS engines, which is slower but provides more coverage
[Browser harness server on process 30065]

Running the browser tests. Make sure the browser allows popups from localhost.

test_wasm_polyfill_prototype (test_browser.browser) ... *** verify that running the wasmator after emcc works
build executables
save the before js
process input
run polyfill packer on test.o.js.temp2.js

/Users/jjylanki/.emscripten_cache/pack-asmjs.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filename);if(!ret&&fil
Assertion failed: lhs.type() == rhs.type(), at: /Users/jjylanki/emsdk_git/emscripten/incoming/third_party/wasm-polyfill/src/pack-asmjs.cpp,2011,analyze_eq at Error
    at jsStackTrace (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:1:20862)
    at stackTrace (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:1:21045)
    at ___assert_fail (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:1:103591)
    at jc (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:11:53562)
    at mc (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:11:57613)
    at ac (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:11:40233)
    at lc (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:11:54674)
    at mc (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:11:55987)
    at ac (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:11:40233)
    at nc (/Users/jjylanki/.emscripten_cache/pack-asmjs.js:11:58493)
Traceback (most recent call last):
  File "/Users/jjylanki/emsdk_git/emscripten/incoming/third_party/wasm-polyfill/wasmator.py", line 94, in <module>
    out = emscripten.run_js(pack_asmjs, args=[os.path.basename(tempfile2), 'output.binary'], stdout=PIPE)
  File "/Users/jjylanki/emsdk_git/emscripten/incoming/tools/shared.py", line 868, in run_js
    return jsrun.run_js(filename, engine, *args, **kw)
  File "/Users/jjylanki/emsdk_git/emscripten/incoming/tools/jsrun.py", line 75, in run_js
    raise Exception('Expected the command ' + str(command) + ' to finish with return code ' + str(assert_returncode) + ', but it returned with code ' + str(proc.returncode) + ' instead! Output: ' + str(ret)[:error_limit])
Exception: Expected the command ['/Users/jjylanki/emsdk_git/node/4.1.1_64bit/bin/node', '/Users/jjylanki/.emscripten_cache/pack-asmjs.js', 'test.o.js.temp2.js', 'output.binary'] to finish with return code 0, but it returned with code 7 instead! Output: 
ERROR
[Browser harness server terminated]

======================================================================
ERROR: test_wasm_polyfill_prototype (test_browser.browser)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jjylanki/emsdk_git/emscripten/incoming/tests/test_browser.py", line 2809, in test_wasm_polyfill_prototype
    build()
  File "/Users/jjylanki/emsdk_git/emscripten/incoming/tests/test_browser.py", line 2797, in separate
    subprocess.check_call([PYTHON, path_from_root('third_party', 'wasm-polyfill', 'wasmator.py'), 'test.o.js', 'test.o.wasm', 'Module'])
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '['/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python', '/Users/jjylanki/emsdk_git/emscripten/incoming/third_party/wasm-polyfill/wasmator.py', 'test.o.js', 'test.o.wasm', 'Module']' returned non-zero exit status 1

----------------------------------------------------------------------
Ran 1 test in 3.533s

FAILED (errors=1)

I'm not sure why the issue only manifests on OS X, since this looks like a platform independent problem. Perhaps asserts are off somehow on Linux and Windows builds?

juj commented 8 years ago

Oh actually, I see the issue does occur on linux as well: http://clb.demon.fi:8112/builders/ubuntu-incoming/builds/1135/steps/browser%20suite%20-%20firefox%20stable/logs/stdio

kripken commented 8 years ago

It does, but it seems to not occur consistently. It shows up just in some bot runs, which is very strange.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.