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

[core] Running the web example throws an exception. #802

Closed
valtsu41 opened this issue Apr 13, 2019 · 9 comments
Closed

[core] Running the web example throws an exception. #802

valtsu41 opened this issue Apr 13, 2019 · 9 comments

Comments

@valtsu41
Copy link

valtsu41 commented Apr 13, 2019

printErr @ core_basic_window.html:1
core_basic_window.html:1 falling back to ArrayBuffer instantiation
printErr @ core_basic_window.html:1
core_basic_window.html:1 INFO: Initializing raylib 2.5-dev
core_basic_window.html:1 INFO: Display device initialized successfully
core_basic_window.html:1 INFO: Render size: 800 x 450
core_basic_window.html:1 INFO: Screen size: 800 x 450
core_basic_window.html:1 INFO: Viewport offsets: 0, 0
core_basic_window.html:1 INFO: GPU: Vendor:   WebKit
core_basic_window.html:1 INFO: GPU: Renderer: WebKit WebGL
core_basic_window.html:1 INFO: GPU: Version:  OpenGL ES 2.0 (WebGL 1.0 (OpenGL ES 2.0 Chromium))
core_basic_window.html:1 INFO: GPU: GLSL:     OpenGL ES GLSL ES 1.00 (WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium))
core_basic_window.html:1 INFO: Number of supported extensions: 47
core_basic_window.html:1 INFO: [EXTENSION] VAO extension detected, VAO functions initialized successfully
core_basic_window.html:1 WARNING: [EXTENSION] NPOT textures extension not found, limited NPOT support (no-mipmaps, no-repeat)
core_basic_window.html:1 INFO: [EXTENSION] DXT compressed textures supported
core_basic_window.html:1 INFO: [TEX ID 1] Texture created successfully (1x1 - 1 mipmaps)
core_basic_window.html:1 INFO: [TEX ID 1] Base white texture loaded successfully
core_basic_window.html:1 INFO: [SHDR ID 2] Shader compiled successfully
core_basic_window.html:1 INFO: [SHDR ID 3] Shader compiled successfully
core_basic_window.html:1 INFO: [SHDR ID 4] Shader program loaded successfully
core_basic_window.html:1 INFO: [SHDR ID 4] Default shader loaded successfully
core_basic_window.html:1 INFO: Internal buffers initialized successfully (CPU)
core_basic_window.html:1 Invalid function pointer called with signature 'vii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)
printErr @ core_basic_window.html:1
core_basic_window.html:1 Build with ASSERTIONS=2 for more info.
printErr @ core_basic_window.html:1
core_basic_window.html:1 19
core_basic_window.html:1 19
printErr @ core_basic_window.html:1
core_basic_window.html:1 exception thrown: abort(19) at Error
    at jsStackTrace (http://localhost:8080/core/core_basic_window.js:1:10810)
    at stackTrace (http://localhost:8080/core/core_basic_window.js:1:10981)
    at abort (http://localhost:8080/core/core_basic_window.js:1:648516)
    at nullFunc_vii (http://localhost:8080/core/core_basic_window.js:1:599392)
    at wasm-function[305]:27976
    at wasm-function[307]:42
    at wasm-function[305]:22392
    at wasm-function[305]:4741
    at wasm-function[305]:4741
    at wasm-function[305]:4741
printErr @ core_basic_window.html:1
core_basic_window.js:1 Uncaught abort(19) at Error
    at jsStackTrace (http://localhost:8080/core/core_basic_window.js:1:10810)
    at stackTrace (http://localhost:8080/core/core_basic_window.js:1:10981)
    at abort (http://localhost:8080/core/core_basic_window.js:1:648516)
    at nullFunc_vii (http://localhost:8080/core/core_basic_window.js:1:599392)
    at wasm-function[305]:27976
    at wasm-function[307]:42
    at wasm-function[305]:22392
    at wasm-function[305]:4741
    at wasm-function[305]:4741
    at wasm-function[305]:4741

Happens when trying to run the web example. My browser is Chromium, and I built the example by copying the command from make and changing the paths to work with Linux.

@raysan5
Copy link
Owner

raysan5 commented Apr 14, 2019

Please, could you post the code you are compiling?

Just remember that game loop must be adapted for web.

@valtsu41
Copy link
Author

As the title says, I'm compiling the web example (core_basic_window_web.c). (At least I think so.)

@valtsu41 valtsu41 changed the title Running the web example throws an exception. [core] Running the web example throws an exception. Apr 15, 2019
@valtsu41
Copy link
Author

Could this be related to that I am using Raspberry Pi?

@raysan5
Copy link
Owner

raysan5 commented Apr 23, 2019

This is a very weird error, I've been investigating it and seems related to latest emscripten... In the meantime I pushed a solution on commit 0c567cd.

Please, let me know if it works.

@valtsu41
Copy link
Author

valtsu41 commented Apr 24, 2019

It does not.

core_basic_window.html:1 Rules for selecting event targets in HTML5 API are changing: instead of using document.getElementById() that only can refer to elements by their DOM ID, new event target selection mechanism uses the more flexible function document.querySelector() that can look up element names, classes, and complex CSS selectors. Build with -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1 to change to the new lookup rules. See https://github.com/emscripten-core/emscripten/pull/7977 for more details.
printErr @ core_basic_window.html:1
core_basic_window.html:1 INFO: Target time per frame: 16.667 milliseconds
core_basic_window.html:1 exception thrown: Please compile your program with async support in order to use asynchronous operations like emscripten_sleep
printErr @ core_basic_window.html:1
core_basic_window.js:1 Uncaught Please compile your program with async support in order to use asynchronous operations like emscripten_sleep

@valtsu41
Copy link
Author

-s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1
Makes it work.

@raysan5
Copy link
Owner

raysan5 commented Apr 24, 2019

Per your output it seems you're compiling core_basic_window instead of core_basic_window_web or PLATFORM_WEB is not properly defined, it's the only possibility if asking for async support... and the reason it works with Emterpreter enabled...

In any case, nice to read it worked.

@raysan5 raysan5 closed this as completed Apr 24, 2019
@RandomErrorMessage
Copy link
Contributor

This is a very weird error, I've been investigating it and seems related to latest emscripten... In the meantime I pushed a solution on commit 0c567cd.

Please, let me know if it works.

Thanks, your commit fixed the exception issue for me. Though, I question your hardcoding of emsdk environment variables. It causes emcc to not be found when using the environmental script as provided by emscripten. By commenting out the hardcoded environment variables from the Makefile, I'm able to transpile properly.

@valtsu41
Copy link
Author

@RandomErrorMessage Should you make that a separate issue?

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

No branches or pull requests

3 participants