kamiyaowl / rust-nes-emulator

NES Emulator written in Rust
MIT License
206 stars 12 forks source link

[wasm] Rumtime Error: unreachableを解決する #67

Closed kamiyaowl closed 4 years ago

kamiyaowl commented 4 years ago

なんとなくfbへの書き込みで死んでいる感じがする?

Vue warn]: Error in v-on handler: "RuntimeError: unreachable"

(found in <Root>)
warn @ vue.js:634
logError @ vue.js:1893
globalHandleError @ vue.js:1888
handleError @ vue.js:1848
invokeWithErrorHandling @ vue.js:1871
invoker @ vue.js:2188
original._wrapper @ vue.js:7541
vue.js:1897 RuntimeError: unreachable
    at rust_panic (wasm-function[86]:0xe704)
    at std::panicking::rust_panic_with_hook::h6fe9d3817474ba5a (wasm-function[41]:0xe1ed)
    at std::panicking::begin_panic::h52d12a2c3cb0d670 (wasm-function[75]:0xe6ac)
    at rust_nes_emulator::video_system::VideoSystem::read_u8::h48f85cf2421ee046 (wasm-function[22]:0xd2d7)
    at wasmemulator_step_line (wasm-function[1]:0x344e)
    at WasmEmulator.step_line (webpack:///./pkg/rust_nes_emulator_wasm.js?:117:95)
    at Vue.romSelect (webpack:///./index.js?:86:13)
    at invokeWithErrorHandling (https://cdn.jsdelivr.net/npm/vue/dist/vue.js:1863:28)
    at HTMLInputElement.invoker (https://cdn.jsdelivr.net/npm/vue/dist/vue.js:2188:16)
    at HTMLInputElement.original._wrapper (https://cdn.jsdelivr.net/npm/vue/dist/vue.js:7541:27)
logError @ vue.js:1897
globalHandleError @ vue.js:1888
handleError @ vue.js:1848
invokeWithErrorHandling @ vue.js:1871
invoker @ vue.js:2188
original._wrapper @ vue.js:7541
rust_nes_emulator_wasm.js:122 Uncaught Error: recursive use of an object detected which would lead to unsafe aliasing in rust
    at Module.__wbindgen_throw (rust_nes_emulator_wasm.js:122)
    at __wbindgen_throw (index.js:59)
    at wasm_bindgen::throw_str::h3d7a757f72b89862 (:4444/wasm-function[72]:0xe68f)
    at wasm_bindgen::__rt::borrow_fail::h97c7f463bc5ab01e (:4444/wasm-function[71]:0xe685)
    at wasmemulator_load (:4444/wasm-function[17]:0xc618)
    at WasmEmulator.load (rust_nes_emulator_wasm.js:110)
    at FileReader.reader.onload (index.js:66)
__wbindgen_throw @ rust_nes_emulator_wasm.js:122
__wbindgen_throw @ index.js:59
wasm_bindgen::throw_str::h3d7a757f72b89862 @ wasm-000466fa-72:1
wasm_bindgen::__rt::borrow_fail::h97c7f463bc5ab01e @ wasm-000466fa-71:1
wasmemulator_load @ wasm-000466fa-17:1
load @ rust_nes_emulator_wasm.js:110
reader.onload @ index.js:66
load (async)
romSelect @ index.js:60
invokeWithErrorHandling @ vue.js:1863
invoker @ vue.js:2188
original._wrapper @ vue.js:7541
kamiyaowl commented 4 years ago

キャプチャ

見た感じ初回のfb描画で死んでいる。ログを見てもvideo_sys::read_u8がおかしいっぽいし

kamiyaowl commented 4 years ago