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

Chapter 55 Onwards WASM Crashes #93

Closed
thatzopoulos opened this issue Jan 30, 2020 · 6 comments
Closed

Chapter 55 Onwards WASM Crashes #93

thatzopoulos opened this issue Jan 30, 2020 · 6 comments
Assignees
Labels
awaiting confirmation Believed fix, waiting for testing bug Something isn't working

Comments

@thatzopoulos
Copy link

When playing the WASM version of chapter 55, trying to leave the town via the staircases crashes the game. I have been implementing the tutorial and my version was working fine until implementing backtracking as well so I think it has something to do with the refactor of that code. Tested on Chrome on a Mac and Chromium on Archlinux I have the same problems for all WASM examples from 55 to the most recent although the normal compiled versions of the roguelike run fine.

@thebracket thebracket self-assigned this Jan 31, 2020
@thebracket thebracket added the bug Something isn't working label Jan 31, 2020
@thebracket
Copy link
Collaborator

Thanks for letting me know! I'll see what I can do to fix the situation.

@thebracket
Copy link
Collaborator

Testing this: it's interesting. Running on native (Windows 10, 64-bit), the transitions happen just fine. On the WASM build, it locks up. It looks like there's a "print" leftover from some debugging that is causing the issue. The stack-trace:

Uncaught RuntimeError: unreachable
    at __rust_start_panic (wasm-function[3283]:0x1f6137)
    at rust_panic (wasm-function[2659]:0x1f353d)
    at std::panicking::rust_panic_with_hook::hdf14da40c6b51ea2 (wasm-function[1789]:0x1d4e97)
    at std::panicking::continue_panic_fmt::hf8630aaa243736ee (wasm-function[2294]:0x1ecbba)
    at rust_begin_unwind (wasm-function[3126]:0x1f5a7e)
    at core::panicking::panic_fmt::hdeb7979ab6591473 (wasm-function[2595]:0x1f2a0f)
    at core::option::expect_failed::h6c3ec3658ee2670d (wasm-function[2414]:0x1efbc2)
    at std::io::stdio::stdout::hcbcc6a8a2e793625 (wasm-function[1369]:0x1b1c5c)
    at std::io::stdio::_print::hefd4b7238a059d41 (wasm-function[747]:0x15d3d7)
    at chapter_60_caverns3::map::dungeon::level_transition::h6efe2f2377ab4936 (wasm-function[114]:0x350b9)

That makes me wonder if any print call is causing breakage (it used to work!). I'll see what I can find.

@thebracket
Copy link
Collaborator

I've confirmed that it's println! that breaks it in WASM. I then found out that my console::log function in RLTK had a similar problem, despite being designed to work around just that issue. So I just fixed it upstream, once the publish is finished I can push a fix for this issue.

@thatzopoulos
Copy link
Author

Fantastic! I'll test it out on my machines once its published

thebracket added a commit that referenced this issue Jan 31, 2020
…sed to take care of logging difficulties in WASM mode.
@thebracket
Copy link
Collaborator

Ok, it's live. I can transition between levels on my two test browsers here, and the console log is properly showing entries.

@thebracket thebracket added the awaiting confirmation Believed fix, waiting for testing label Jan 31, 2020
@thatzopoulos
Copy link
Author

Updated all my println! calls and upgraded rltk_rs to the newest version and can confirm it works now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting confirmation Believed fix, waiting for testing bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants