tvix: 'main' panicked at 'attempt to subtract with overflow' (in wu-manber)
#250
Opened by flokli at
Steps to reproduce:
git clone https://code.tvl.fyi/depot.git:workspace=views/tvix.git git clone -b rootfs --depth=1 https://spectrum-os.org/git/nixpkgs git clone --depth=1 https://spectrum-os.org/git/spectrum git clone --depth=1 https://github.com/NixOS/nix nix cd tvix # edit eval/src/compiler/mod.rs, L346, copy the code inside the `raw_path.starts_with('.')` branch to the else case nix-shell --run "cargo build" RUST_BACKTRACE=1 target/debug/tvix -E 'import ../spectrum/release.nix {}' -I nixpkgs=../nixpkgs:nix=../nix/src/libexpr
get greeted with this backtrace:
thread 'main' panicked at 'attempt to subtract with overflow', /home/flokli/.cargo/git/checkouts/wu-manber-12505bf69ecb128f/acff1ff/src/lib.rs:188:34 stack backtrace: 0: rust_begin_unwind 1: core::panicking::panic_fmt 2: core::panicking::panic 3: wu_manber::TwoByteWM::find_from at /home/flokli/.cargo/git/checkouts/wu-manber-12505bf69ecb128f/acff1ff/src/lib.rs:188:34 4: <wu_manber::Matches as core::iter::traits::iterator::Iterator>::next at /home/flokli/.cargo/git/checkouts/wu-manber-12505bf69ecb128f/acff1ff/src/lib.rs:99:9 5: tvix::refscan::ReferenceScanner<P>::scan_str at ./cli/src/refscan.rs:43:18 6: tvix::derivation::derivation_builtins::builtin_derivation_strict::{{closure}} at ./cli/src/derivation.rs:309:51 7: <core::slice::iter::Iter<T> as core::iter::traits::iterator::Iterator>::for_each at /build/rustc-1.66.1-src/library/core/src/slice/iter/macros.rs:211:21 8: tvix::derivation::derivation_builtins::builtin_derivation_strict at ./cli/src/derivation.rs:309:17 9: tvix::derivation::derivation_builtins::builtins::{{closure}} at ./cli/src/derivation.rs:226:5 10: tvix_eval::value::builtin::Builtin::apply at ./eval/src/value/builtin.rs:97:20 11: tvix_eval::vm::VM::call_builtin at ./eval/src/vm.rs:1182:38 12: tvix_eval::vm::VM::tail_call_value at ./eval/src/vm.rs:389:40 13: tvix_eval::vm::VM::run_op at ./eval/src/vm.rs:964:17 14: tvix_eval::vm::VM::enter_frame at ./eval/src/vm.rs:456:23 15: tvix_eval::value::thunk::Thunk::force at ./eval/src/value/thunk.rs:124:23 16: tvix_eval::value::Value::force at ./eval/src/value/mod.rs:418:17 17: tvix_eval::value::builtin::Builtin::apply at ./eval/src/value/builtin.rs:94:21 18: tvix_eval::vm::VM::call_builtin at ./eval/src/vm.rs:1182:38 19: tvix_eval::vm::VM::tail_call_value at ./eval/src/vm.rs:389:40 20: tvix_eval::vm::VM::run_op at ./eval/src/vm.rs:964:17 21: tvix_eval::vm::VM::enter_frame at ./eval/src/vm.rs:456:23 22: tvix_eval::value::thunk::Thunk::force at ./eval/src/value/thunk.rs:124:23 23: tvix_eval::value::Value::coerce_to_string at ./eval/src/value/mod.rs:201:13 24: tvix_eval::value::Value::coerce_to_string at ./eval/src/value/mod.rs:256:40 25: tvix_eval::value::Value::coerce_to_string at ./eval/src/value/mod.rs:206:37 26: tvix_eval::vm::VM::run_op at ./eval/src/vm.rs:842:21 27: tvix_eval::vm::VM::enter_frame at ./eval/src/vm.rs:456:23 28: tvix_eval::value::thunk::Thunk::force at ./eval/src/value/thunk.rs:124:23 29: tvix_eval::value::Value::force at ./eval/src/value/mod.rs:418:17 30: tvix::derivation::derivation_builtins::builtin_derivation_strict at ./cli/src/derivation.rs:278:42 31: tvix::derivation::derivation_builtins::builtins::{{closure}} at ./cli/src/derivation.rs:226:5 32: tvix_eval::value::builtin::Builtin::apply at ./eval/src/value/builtin.rs:97:20 33: tvix_eval::vm::VM::call_builtin at ./eval/src/vm.rs:1182:38 34: tvix_eval::vm::VM::tail_call_value at ./eval/src/vm.rs:389:40 35: tvix_eval::vm::VM::run_op at ./eval/src/vm.rs:964:17 36: tvix_eval::vm::VM::enter_frame at ./eval/src/vm.rs:456:23 37: tvix_eval::value::thunk::Thunk::force at ./eval/src/value/thunk.rs:124:23 38: tvix_eval::value::Value::force at ./eval/src/value/mod.rs:418:17 39: tvix_eval::value::builtin::Builtin::apply at ./eval/src/value/builtin.rs:94:21 40: tvix_eval::vm::VM::call_builtin at ./eval/src/vm.rs:1182:38 41: tvix_eval::vm::VM::tail_call_value at ./eval/src/vm.rs:389:40 42: tvix_eval::vm::VM::run_op at ./eval/src/vm.rs:964:17 43: tvix_eval::vm::VM::enter_frame at ./eval/src/vm.rs:456:23 44: tvix_eval::value::thunk::Thunk::force at ./eval/src/value/thunk.rs:124:23 45: tvix_eval::value::Value::coerce_to_string at ./eval/src/value/mod.rs:201:13 46: tvix_eval::vm::VM::nix_op_eq at ./eval/src/vm.rs:624:33 47: tvix_eval::vm::VM::run_op at ./eval/src/vm.rs:750:39 48: tvix_eval::vm::VM::enter_frame at ./eval/src/vm.rs:456:23 49: tvix_eval::value::thunk::Thunk::force at ./eval/src/value/thunk.rs:124:23 50: tvix_eval::value::Value::force at ./eval/src/value/mod.rs:418:17 51: tvix_eval::builtins::pure_builtins::builtin_is_attrs at ./eval/src/builtins/mod.rs:482:21 52: tvix_eval::builtins::pure_builtins::builtins::{{closure}} at ./eval/src/builtins/mod.rs:480:5 53: tvix_eval::value::builtin::Builtin::apply at ./eval/src/value/builtin.rs:97:20 54: tvix_eval::vm::VM::call_builtin at ./eval/src/vm.rs:1182:38 55: tvix_eval::vm::VM::tail_call_value at ./eval/src/vm.rs:389:40 56: tvix_eval::vm::VM::run_op at ./eval/src/vm.rs:964:17 57: tvix_eval::vm::VM::enter_frame at ./eval/src/vm.rs:456:23 58: tvix_eval::value::thunk::Thunk::force at ./eval/src/value/thunk.rs:124:23 59: tvix_eval::value::Value::force at ./eval/src/value/mod.rs:418:17 60: tvix_eval::builtins::pure_builtins::builtin_is_attrs at ./eval/src/builtins/mod.rs:482:21 61: tvix_eval::builtins::pure_builtins::builtins::{{closure}} at ./eval/src/builtins/mod.rs:480:5 62: tvix_eval::value::builtin::Builtin::apply at ./eval/src/value/builtin.rs:97:20 63: tvix_eval::vm::VM::call_builtin at ./eval/src/vm.rs:1182:38 64: tvix_eval::vm::VM::tail_call_value at ./eval/src/vm.rs:389:40 65: tvix_eval::vm::VM::run_op at ./eval/src/vm.rs:964:17 66: tvix_eval::vm::VM::enter_frame at ./eval/src/vm.rs:456:23 67: tvix_eval::value::thunk::Thunk::force at ./eval/src/value/thunk.rs:124:23 68: tvix_eval::value::Value::force at ./eval/src/value/mod.rs:418:17 69: tvix_eval::builtins::pure_builtins::builtin_is_attrs at ./eval/src/builtins/mod.rs:482:21 70: tvix_eval::builtins::pure_builtins::builtins::{{closure}} at ./eval/src/builtins/mod.rs:480:5 71: tvix_eval::value::builtin::Builtin::apply at ./eval/src/value/builtin.rs:97:20 72: tvix_eval::vm::VM::call_builtin at ./eval/src/vm.rs:1182:38 73: tvix_eval::vm::VM::tail_call_value at ./eval/src/vm.rs:389:40 74: tvix_eval::vm::VM::run_op at ./eval/src/vm.rs:964:17 75: tvix_eval::vm::VM::enter_frame at ./eval/src/vm.rs:456:23 76: tvix_eval::value::thunk::Thunk::force at ./eval/src/value/thunk.rs:124:23 77: tvix_eval::value::Value::force at ./eval/src/value/mod.rs:418:17 78: tvix_eval::builtins::pure_builtins::builtin_is_attrs at ./eval/src/builtins/mod.rs:482:21 79: tvix_eval::builtins::pure_builtins::builtins::{{closure}} at ./eval/src/builtins/mod.rs:480:5 80: tvix_eval::value::builtin::Builtin::apply at ./eval/src/value/builtin.rs:97:20 81: tvix_eval::vm::VM::call_builtin at ./eval/src/vm.rs:1182:38 82: tvix_eval::vm::VM::tail_call_value at ./eval/src/vm.rs:389:40 83: tvix_eval::vm::VM::run_op at ./eval/src/vm.rs:964:17 84: tvix_eval::vm::VM::enter_frame at ./eval/src/vm.rs:456:23 85: tvix_eval::value::thunk::Thunk::force at ./eval/src/value/thunk.rs:124:23 86: tvix_eval::value::Value::force at ./eval/src/value/mod.rs:418:17 87: tvix_eval::builtins::pure_builtins::builtin_is_attrs at ./eval/src/builtins/mod.rs:482:21 88: tvix_eval::builtins::pure_builtins::builtins::{{closure}} at ./eval/src/builtins/mod.rs:480:5 89: tvix_eval::value::builtin::Builtin::apply at ./eval/src/value/builtin.rs:97:20 90: tvix_eval::vm::VM::call_builtin at ./eval/src/vm.rs:1182:38 91: tvix_eval::vm::VM::tail_call_value at ./eval/src/vm.rs:389:40 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
This has been fixed in https://cl.tvl.fyi/c/depot/+/8031.
flokli at 2023-02-06T12·05+00
- flokli closed this issue at 2023-02-06T12·05+00