Skip to content
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

Empty EmscriptenApplication Crashed #376

Closed
linuxaged opened this issue Oct 6, 2019 · 11 comments
Closed

Empty EmscriptenApplication Crashed #376

linuxaged opened this issue Oct 6, 2019 · 11 comments

Comments

@linuxaged
Copy link
Contributor

linuxaged commented Oct 6, 2019

follow the official emscripten example, app crashed:
微信截图_20191006183834

console log:

include.preload.js:335 [Deprecation] Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
createShadowTree @ include.preload.js:335
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
EmscriptenApplication.js:35 wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
printErr @ EmscriptenApplication.js:35
EmscriptenApplication.js:35 falling back to ArrayBuffer instantiation
printErr @ EmscriptenApplication.js:35
EmscriptenApplication.js:35 missing function: emscripten_get_sbrk_ptr
printErr @ EmscriptenApplication.js:35
EmscriptenApplication.js:39 -1
EmscriptenApplication.js:35 -1
printErr @ EmscriptenApplication.js:35
MyApplication.js:1 Uncaught abort(-1). Build with -s ASSERTIONS=1 for more info.

emsdk version:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.38.47
clang version 6.0.1 (Cswircachegitchromium.googlesource.com-external-github.com-emscripten--core-emscripten--fastcomp--clang 98df4be387dde3e3918fa5bbb5fc43e1a0e1daac) (Cswircachegitchromium.googlesource.com-external-github.com-emscripten--core-emscripten--fastcomp 6c7e775325067e33fa60611e619a8b987b6d0c35) (emscripten 1.38.31 : 1.38.31)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\workspace\emsdk\fastcomp\fastcomp\bin
shared:INFO: (Emscripten: Running sanity checks)

app build log:

C:\workspace\bonsmile\viewer\build-emscripten>cmake --build . --target install
[2/3] Linking CXX executable src\MyApplication.js
cache:INFO: generating system library: libc++-noexcept.a... (this will be cached in "C:\workspace\emsdk\.emscripten_cache\asmjs\libc++-noexcept.a" for subsequent builds)
cache:INFO:  - ok
cache:INFO: generating system library: libc++abi.bc... (this will be cached in "C:\workspace\emsdk\.emscripten_cache\asmjs\libc++abi.bc" for subsequent builds)
cache:INFO:  - ok
cache:INFO: generating system library: libc-extras.bc... (this will be cached in "C:\workspace\emsdk\.emscripten_cache\asmjs\libc-extras.bc" for subsequent builds)
cache:INFO:  - ok
cache:INFO: generating system library: libgl.bc... (this will be cached in "C:\workspace\emsdk\.emscripten_cache\asmjs\libgl.bc" for subsequent builds)
cache:INFO:  - ok
[2/3] Install the project...
-- Install configuration: "Release"
-- Installing: C:/http/magnum/MyApplication.js
-- Installing: C:/http/magnum/MyApplication.html
-- Installing: C:/http/magnum/EmscriptenApplication.js
-- Installing: C:/http/magnum/WebApplication.css
-- Installing: C:/http/magnum/MyApplication.wasm

http server log:

C:\http\magnum>python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
127.0.0.1 - - [06/Oct/2019 18:17:39] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:19:17] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:19:17] code 404, message File not found
127.0.0.1 - - [06/Oct/2019 18:19:17] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [06/Oct/2019 18:19:18] code 404, message File not found
127.0.0.1 - - [06/Oct/2019 18:19:18] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [06/Oct/2019 18:19:43] "GET /MyApplication.html HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:19:43] "GET /WebApplication.css HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:19:43] "GET /EmscriptenApplication.js HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:19:43] "GET /MyApplication.js HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:19:43] "GET /MyApplication.wasm HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:19:43] "GET /MyApplication.html HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:19:43] "GET /WebApplication.css HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:19:44] "GET /EmscriptenApplication.js HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:19:44] "GET /MyApplication.js HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:19:44] "GET /MyApplication.wasm HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:20:01] "GET /MyApplication.html HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:22:00] "GET /MyApplication.js HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:22:00] "GET /MyApplication.wasm HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:28:28] "GET /MyApplication.html HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:28:28] "GET /WebApplication.css HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:28:28] "GET /EmscriptenApplication.js HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:28:28] "GET /MyApplication.js HTTP/1.1" 200 -
127.0.0.1 - - [06/Oct/2019 18:28:28] "GET /MyApplication.wasm HTTP/1.1" 200 -
@Squareys
Copy link
Contributor

Squareys commented Oct 6, 2019

EmscriptenApplication.js:35 missing function: emscripten_get_sbrk_ptr

Hmm, this seems to be the culprit. Maybe caused by a newer emscripten version...

Try enabling assertions, maybe you'll get more info:

target_link_options(MyApplication PRIVATE
    # Set debugging flags (assertions and demangle)
     $<$<CONFIG:DEBUG>:-s ASSERTIONS=1 -s DEMANGLE_SUPPORT=1>)

@Squareys
Copy link
Contributor

Squareys commented Oct 6, 2019

Looking at Emscripten's issues, especially emscripten-core/emscripten#9397, it seems like this sbrk stuff is some pretty bleeding edge feature, you may want to go back to 1.38.46 or even earlier.

@mosra mosra added this to the 2019.0b milestone Oct 7, 2019
@mosra
Copy link
Owner

mosra commented Oct 7, 2019

I have to admit the new Emscripten versions don't work for me very well (complaining about Clang version mismatch and whatnot), so I'm personally at 1.38.38 (and binaryen 87 to go with that).

I'll look at this before release, but so far it seems it's one of those "emscripten is broken" days ... let's wait until things settle down there :D

@linuxaged
Copy link
Contributor Author

Have tested with emsdk 1.38.30 and 1.38.46, both with error:

include.preload.js:335 [Deprecation] Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
createShadowTree @ include.preload.js:335
ElemHide @ include.preload.js:294
(anonymous) @ include.preload.js:460
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
EmscriptenApplication.js:35 wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
printErr @ EmscriptenApplication.js:35
(anonymous) @ MyApplication.js:1
Promise.then (async)
createWasm @ MyApplication.js:1
Module.asm @ MyApplication.js:1
(anonymous) @ MyApplication.js:1
EmscriptenApplication.js:35 falling back to ArrayBuffer instantiation
printErr @ EmscriptenApplication.js:35
(anonymous) @ MyApplication.js:1
Promise.then (async)
createWasm @ MyApplication.js:1
Module.asm @ MyApplication.js:1
(anonymous) @ MyApplication.js:1
EmscriptenApplication.js:39 Renderer: WebKit WebGL by WebKit
EmscriptenApplication.js:39 OpenGL version: OpenGL ES 3.0 (WebGL 2.0 (OpenGL ES 3.0 Chromium))
EmscriptenApplication.js:39 Using optional features:
EmscriptenApplication.js:39     GL_EXT_texture_filter_anisotropic
wasm-0040f726-1142:1 Uncaught RuntimeError: float unrepresentable in integer range
    at wasm-function[1142]:0xd81fe
    at wasm-function[1037]:0x93456
    at wasm-function[1143]:0xdb915
    at wasm-function[1253]:0xe1b44
    at Module.dynCall_ii (http://localhost:8000/MyApplication.js:1:157063)
    at dynCall (http://localhost:8000/MyApplication.js:1:4535)
    at drawEvent (http://localhost:8000/MyApplication.js:1:15574)
(anonymous) @ wasm-0040f726-1142:1
(anonymous) @ wasm-0040f726-1037:1
(anonymous) @ wasm-0040f726-1143:1
(anonymous) @ wasm-0040f726-1253:1
Module.dynCall_ii @ MyApplication.js:1
dynCall @ MyApplication.js:1
drawEvent @ MyApplication.js:1
requestAnimationFrame (async)
ASM_CONSTS @ MyApplication.js:1
_emscripten_asm_const_iii @ MyApplication.js:1
(anonymous) @ wasm-0040f726-1184:1
Module._main @ MyApplication.js:1
callMain @ MyApplication.js:1
doRun @ MyApplication.js:1
(anonymous) @ MyApplication.js:1
setTimeout (async)
run @ MyApplication.js:1
runCaller @ MyApplication.js:1
removeRunDependency @ MyApplication.js:1
receiveInstance @ MyApplication.js:1
receiveInstantiatedSource @ MyApplication.js:1
Promise.then (async)
instantiateArrayBuffer @ MyApplication.js:1
(anonymous) @ MyApplication.js:1
Promise.then (async)
createWasm @ MyApplication.js:1
Module.asm @ MyApplication.js:1
(anonymous) @ MyApplication.js:1

@mosra mosra mentioned this issue Oct 15, 2019
60 tasks
@mosra
Copy link
Owner

mosra commented Oct 23, 2019

@linuxaged did you get any further with this? I wasn't able to reproduce on my side.

Keeping this open until we figure it out, but since it seems to be that Emscripten is to blame I don't think it's blocking the 2019.10 release.

@mosra mosra modified the milestones: 2019.10, 2019.1c Oct 23, 2019
@linuxaged
Copy link
Contributor Author

update corrade, magnum, magnum-integration to latest master, built with emsdk-1.38.38.
not crash now but still have some errors:

Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
MyApplication.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
EmscriptenApplication.js:35 wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
printErr @ EmscriptenApplication.js:35
EmscriptenApplication.js:35 falling back to ArrayBuffer instantiation
printErr @ EmscriptenApplication.js:35
EmscriptenApplication.js:39 Renderer: WebKit WebGL by WebKit
EmscriptenApplication.js:39 OpenGL version: OpenGL ES 3.0 (WebGL 2.0 (OpenGL ES 3.0 Chromium))
EmscriptenApplication.js:39 Using optional features:
EmscriptenApplication.js:39     GL_EXT_texture_filter_anisotropic

@mosra
Copy link
Owner

mosra commented Oct 24, 2019

Nice.

The wasm streaming compile failed is due to the server not knowing about WebAssembly MIME types. It's harmless, AFAIK it only slows down the startup slightly since the browser can't do wasm compilation in parallel to download.

@linuxaged
Copy link
Contributor Author

by the way, cmake toochain files not included in the bootstrap Emscripten project archive, complete project maybe more friendly to newcomers : >

@mosra
Copy link
Owner

mosra commented Oct 24, 2019

It's a Git submodule and the ZIPs created automagically by github don't include these :/ Not sure how to fix that (besides manually putting all files there..).

@mosra
Copy link
Owner

mosra commented Nov 5, 2019

Anything left to be done here? :)

@linuxaged
Copy link
Contributor Author

fine to close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants