ekiwi / wellen

wellen: waveform datastructures in Rust. Fast VCD, FST and GHW parsing for waveform viewers.
BSD 3-Clause "New" or "Revised" License
40 stars 8 forks source link

Small FST crash in WASM with "no filesystem on this platform" #25

Open TheZoq2 opened 12 hours ago

TheZoq2 commented 12 hours ago

dump.zip

This file works in the desktop version but fails to load in the WASM version of surfer with

panicked at library/std/src/sys/pal/wasm/../unsupported/os.rs:108:5:
no filesystem on this platform

I'm not sure why the fst loader would need file system, and I will try to look into how to actually debug wasm files so we can find the root cause of this

TheZoq2 commented 12 hours ago

image

Oh, there is a not totally useless backtrace here when running in debug mode. The lack of source locations is a bit annoying but it seems like it is trying to create a temporary file while loading fst

TheZoq2 commented 11 hours ago

https://github.com/ekiwi/fst-native/blob/main/src/reader.rs#L254

Ah, there it is...

I guess on the web version we need a non-file based solution, could we just create a Vec instead if we're on wasm?

ekiwi commented 11 hours ago

Awesome job debugging this! Thanks