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

Segmentation fault although no optimization is done #6585

Closed
wackazong opened this issue May 13, 2024 · 3 comments
Closed

Segmentation fault although no optimization is done #6585

wackazong opened this issue May 13, 2024 · 3 comments

Comments

@wackazong
Copy link

I have a wasm file which causes a segementation fault in wasm-opt, even if not using any optimization. What can I do to resolve this?

writeInt8: 0 (at 9855286)
writeInt8: 3 (at 9855287)
writeInt8: 0 (at 9855288)
writeInt8: 0 (at 9855289)
writeInt8: 0 (at 9855290)
writeInt8: 0 (at 9855291)
writeInt8: 0 (at 9855292)
writeInt8: 0 (at 9855293)
writeInt8: 0 (at 9855294)
writeInt8: 0 (at 9855295)
writeInt8: 0 (at 9855296)
writeInt8: 0 (at 9855297)
writeInt8: 0 (at 9855298)
writeInt8: 0 (at 9855299)
writeInt8: 0 (at 9855300)
writeInt8: 0 (at 9855301)
writeInt8: 0 (at 9855302)
writeInt8: 0 (at 9855303)
writeInt8: 0 (at 9855304)
writeInt8: 0 (at 9855305)
writeInt8: 0 (at 9855306)
writeInt8: 0 (at 9855307)
writeInt8: 0 (at 9855308)
writeInt8: 0 (at 9855309)
writeInt8: 0 (at 9855310)
writeInt8: 2 (at 9855311)
writeInt8: 0 (at 9855312)
writeInt8: 0 (at 9855313)
writeInt8: 0 (at 9855314)
writeAtU32LEB: 8373064 (at 1482246)
[1]    48856 segmentation fault  wasm-opt App_bg.wasm -o test.wasm --debug
@tlively
Copy link
Member

tlively commented May 13, 2024

Are you able to share the wasm file so we can investigate and fix the bug?

@wackazong
Copy link
Author

Also, wasm-gc gives me this error:

thread 'main' panicked at /.../wasm-gc-0.1.6/src/main.rs:45:36:
failed to parse wasm module: Error(UnknownOpcode(195))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[1]    49797 abort      wasm-gc app.wasm

@kripken
Copy link
Member

kripken commented May 13, 2024

Stack trace shows it crashes in DWARF support code. Our DWARF support is not very robust, and not the focus of current work. To work around this issue, pass --strip-dwarf (which will remove it before writing).

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