Stream: git-wasmtime

Topic: wasmtime / issue #9149 cranelift-reader: ParseError { loc...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 20 2024 at 01:16):

abc767234318 opened issue #9149:

When I used cranelift-reader to read the functions of Cranelift IR, the following error occurred:

parsing error: ParseError { location: Location { line_number: 9 }, message: "expected block header", is_warning: false }
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:652
   1: core::panicking::panic_fmt
             at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\panicking.rs:72
   2: core::result::unwrap_failed
             at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\result.rs:1679
   3: enum2$<core::result::Result<alloc::vec::Vec<cranelift_codegen::ir::function::Function,alloc::alloc::Global>,cranelift_reader::error::ParseError> >::expect<alloc::vec::Vec<cranelift_codegen::ir::function::Fun
ction,alloc::alloc::Global>,cranelift_reader::err
             at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\core\src\result.rs:1059
4: ir_serde::main
             at .\src\bin\ir_serde.rs:27
   5: core::ops::function::FnOnce::call_once<enum2$<core::result::Result<tuple$<>,anyhow::Error> > (*)(),tuple$<> >
             at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

And the error is caused by this line of code:

let ir_funcs = parse_functions(&ir_str).expect("parsing error");

wasm_func_27.zip

view this post on Zulip Wasmtime GitHub notifications bot (Aug 20 2024 at 15:12):

alexcrichton commented on issue #9149:

This is failing to parse the line table0 = dynamic gv5, min 0, bound gv6, element_size 8, index_type i32 and it appears that cranelift-reader does not have support for this.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 21 2024 at 08:36):

abc767234318 commented on issue #9149:

This is failing to parse the line table0 = dynamic gv5, min 0, bound gv6, element_size 8, index_type i32 and it appears that cranelift-reader does not have support for this.

Thank you for your response. Is there any plan to add support for this format in the future?

view this post on Zulip Wasmtime GitHub notifications bot (Aug 21 2024 at 19:31):

alexcrichton commented on issue #9149:

I don't think anyone's actively planning to work on this. In fact the rough goal is to remove table support from Cranelift and require frontends to handle the lowering instead. That being said if you'd like a PR to implement support for this also seems reasonable.


Last updated: Oct 23 2024 at 20:03 UTC