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

Help with debugging wasm and page generated with Emscripten 3.1.68 #22733

Open
netolcc06 opened this issue Oct 14, 2024 · 2 comments
Open

Help with debugging wasm and page generated with Emscripten 3.1.68 #22733

netolcc06 opened this issue Oct 14, 2024 · 2 comments

Comments

@netolcc06
Copy link

Hi everyone,

I'd like to have some guidance on how to properly debug one issue I'm having.

A few months ago I worked on using Emscripten to generate a wasm version of cvc5. At that time I was using Emscripten v3.1.18 and managed to produce successful builds and pages by setting the HTML option. Flags such as -s EXPORTED_RUNTIME_METHODS='["ccall","cwrap"]' -s ENVIRONMENT=web -s EXPORTED_FUNCTIONS=_main -s INVOKE_RUN=1 -s EXIT_RUNTIME=0 -s INCOMING_MODULE_JS_API=argument also worked fine.

Recently I tried to use Emscripten 3.1.68 with the same flags, but the generated page just throws a generic message Uncaught (in promise) 868912 when it starts. I thought the issue could be related to changes in cvc5's build system, but nothing has changed there - and old versions of the program that used to produce valid wasm + html pages present the same behaviour if built with 3.1.68. From what I checked from Emscripten docs, compilation instructions seem to be the same as a few months back though.

With that said, what is the best way of moving forward here and debug what is happening with the page? I want to figure out what actually got broken with the most recent version and adjust my source code, if necessary, in order to produce valid wasm binaries.

Thanks in advance!

@kripken
Copy link
Member

kripken commented Oct 14, 2024

For a regression like this, bisection is often a fast way to find what caused the issue.

@sbc100
Copy link
Collaborator

sbc100 commented Oct 14, 2024

Also, building with without optimization (i.e. with -O0 which is the default) and/or with -sASSERTIONS can help a lot.

When you get the Uncaught (in promise) I would expect some kind of backtrace that might give you a clue as to what the issue is.

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