likebike / fasteval

Fast and safe evaluation of algebraic expressions
https://crates.io/crates/fasteval/
MIT License
267 stars 26 forks source link

test case fail on riscv64 #19

Open yuzibo opened 2 years ago

yuzibo commented 2 years ago

Hi, I am porting Debian package to riscv64 arch. Here is basic buildd info of rust-fastval in Debian: https://buildd.debian.org/status/package.php?p=rust-fasteval Now the buildd log on riscv64: https://buildd.debian.org/status/fetch.php?pkg=rust-fasteval&arch=riscv64&ver=0.2.4-1&stamp=1650289636&raw=0 And the log is same with my local build on riscv64 hardware:

c-unknown-linux-gnu/debug/deps/libfasteval-da6ed3a61e1082c9.rlib -C debuginfo=2 --cap-lints warn -C linker=riscv64-linux-gnu-gcc -C link-arg=-Wl,-z,relro --remap-path-prefix /<<PKGBUILDDIR>>=/usr/share/cargo/registry/fasteval-0.2.4`
    Finished test [unoptimized + debuginfo] target(s) in 1m 54s
     Running `/<<PKGBUILDDIR>>/target/riscv64gc-unknown-linux-gnu/debug/deps/fasteval-4b9cf3c38633e3ef`

running 3 tests
test parser::internal_tests::priv_tests ... ok
test parser::internal_tests::util ... ok
test parser::internal_tests::rem_no_panic ... ok

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running `/<<PKGBUILDDIR>>/target/riscv64gc-unknown-linux-gnu/debug/deps/compile-f8df2945b86f1b68`

running 6 tests
test basics ... ok
test eval_macro ... ok
test custom_func ... ok
test slab_overflow ... ok
test double_neg ... ok
test all_instrs ... FAILED

failures:

---- all_instrs stdout ----
thread 'all_instrs' panicked at 'assertion failed: `(left == right)`
  left: `"CompileSlab{ instrs:{ 0:IUnsafeVar { name: \"x\", ptr: 0x?????????? }, 1:IUnsafeVar { name: \"y\", ptr: 0x?????????? } } }"`,
 right: `"CompileSlab{ instrs:{ 0:IUnsafeVar { name: \"x\", ptr: 0x???????????? }, 1:IUnsafeVar { name: \"y\", ptr: 0x???????????? } } }"`', tests/compile.rs:131:5
stack backtrace:
   0: rust_begin_unwind
             at /usr/src/rustc-1.58.1/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /usr/src/rustc-1.58.1/library/core/src/panicking.rs:107:14
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
             at /usr/src/rustc-1.58.1/library/core/src/panicking.rs:145:5
   4: compile::unsafe_comp_chk
             at /usr/share/cargo/registry/fasteval-0.2.4/tests/compile.rs:131:5
   5: compile::all_instrs
             at /usr/share/cargo/registry/fasteval-0.2.4/tests/compile.rs:389:9
   6: compile::all_instrs::{{closure}}
             at /usr/share/cargo/registry/fasteval-0.2.4/tests/compile.rs:213:1
   7: core::ops::function::FnOnce::call_once
             at /usr/src/rustc-1.58.1/library/core/src/ops/function.rs:227:5
   8: core::ops::function::FnOnce::call_once
             at /usr/src/rustc-1.58.1/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

failures:
    all_instrs

test result: FAILED. 5 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.12s

error: test failed, to rerun pass '--test compile'
dh_auto_test: error: /usr/share/cargo/bin/cargo test --all --features unsafe-vars returned exit code 101
make[1]: *** [debian/rules:6: override_dh_auto_test] Error 25
make[1]: Leaving directory '/<<PKGBUILDDIR>>'

So, I think the the test case : assert_eq!(replace_addrs(format!("{:?}",slab.cs)), expect_fmt) is not support on riscv64 now. This is just I guess. Could you tell me how to debug this issue in order to support rust-fasteval run on riscv64. and if you need me to run more test case, please feel free let me kown, thanks.