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

Cannot convert 1698917542 to a BigInt #21689

Closed
Alexufo opened this issue Apr 3, 2024 · 2 comments
Closed

Cannot convert 1698917542 to a BigInt #21689

Alexufo opened this issue Apr 3, 2024 · 2 comments

Comments

@Alexufo
Copy link

Alexufo commented Apr 3, 2024

Version of emscripten/emsdk:.
3.1.43 to the latest

My application can be successfully run on 3.1.42
But on 3.1.43 ( 3.1.44. 3.1.45) and the latest version I get:

wasm.js:3010 Uncaught (in promise) TypeError: Cannot convert "TypeError: Cannot convert 1698917542 to a BigInt" to int
    at checkAssertions (wasm.js:3010:17)
    at Object.toWireType (wasm.js:3024:11)
    at Object.printExceptionMessage (eval at newFunc (wasm.js:2513:27), <anonymous>:7:35)
    at worker.js:320:106

I can add sWASM_BIGINT and I can run my app on any version, but I need support for older iPhones.

my config

add_link_options(--bind -sWASM -sNO_EXIT_RUNTIME)
add_link_options(--no-entry)
add_link_options(-sMODULARIZE)
add_link_options(-sENVIRONMENT=web,worker)
add_link_options(-sNO_FILESYSTEM)
add_link_options(-sNO_USE_SDL -sNO_USE_SDL_MIXER)
add_link_options(-sALLOW_MEMORY_GROWTH=1)

add_link_options(-sMINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION=1)
add_link_options(-sDYNAMIC_EXECUTION=1)

add_link_options(-sNO_HTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS)
add_link_options(-sNO_ABORT_ON_WASM_EXCEPTIONS)
add_link_options(-sEXPORTED_FUNCTIONS=_malloc,_free)

add_link_options(-sINCOMING_MODULE_JS_API=['locateFile','mainScriptUrlOrBlob'])

add_link_options(-sNO_ERROR_ON_UNDEFINED_SYMBOLS)

add_compile_options(-sSHARED_MEMORY=0)
add_link_options(-sSHARED_MEMORY=0)
add_link_options(-flto)
add_link_options(-sNO_LEGALIZE_JS_FFI)
add_compile_options(-sNO_LEGALIZE_JS_FFI)
@sbc100
Copy link
Collaborator

sbc100 commented Apr 4, 2024

Can you share your printExceptionMessage function? What is it trying to do? It looks like you are trying to call a function that takes an i64. Do you know which function that is?

Actaully the i64 looks like the issue. Do you know why you are passing -sNO_LEGALIZE_JS_FFI? That looks pretty suspicious. The JS type legalization removes all the i64 from the Wasm/JS boundary. Can you try removing this flag?

@Alexufo
Copy link
Author

Alexufo commented Apr 4, 2024

Yes! Removing NO_LEGALIZE_JS_FFI helped 😁.


PS. printExceptionMessage is our custom method for exceptions

@Alexufo Alexufo closed this as completed Apr 4, 2024
sbc100 added a commit to sbc100/emscripten that referenced this issue Apr 4, 2024
This setting can cause issues if used on its own without
`-sWASM_BIGINT`.  See emscripten-core#21689.
sbc100 added a commit to sbc100/emscripten that referenced this issue Apr 4, 2024
This setting can cause issues if used on its own without
`-sWASM_BIGINT`.  See emscripten-core#21689.
sbc100 added a commit that referenced this issue Apr 4, 2024
This setting can cause issues if used on its own without
`-sWASM_BIGINT`.  See #21689.
impact-maker pushed a commit to impact-maker/emscripten that referenced this issue Apr 11, 2024
This setting can cause issues if used on its own without
`-sWASM_BIGINT`.  See emscripten-core#21689.
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

2 participants