Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] thread main panicked at 'itertools' #2339

Closed
prajwolrg opened this issue Apr 5, 2023 · 1 comment · Fixed by #2340
Closed

[Bug] thread main panicked at 'itertools' #2339

prajwolrg opened this issue Apr 5, 2023 · 1 comment · Fixed by #2340
Assignees
Labels
bug Something isn't working

Comments

@prajwolrg
Copy link

🐛 Bug Report

While running on leo build, thread main panicked at 'itertools: .zip_eq() reached end of one iterator before the other'

Steps to Reproduce

Code snippet to reproduce

    record test_credits {
        owner: address,
        gates: u64,
        amount: u64
    }

    transition mint_credits(to: address, amount: u64) {
        return test_credits {
            owner: self.caller,
            gates: 0u64,
            amount
        };
    }

Stack trace & error message

thread `main` panicked at 'itertools: .zip_eq() reached end of one iterator before the other', /home/prajwolrg/.cargo/registry/src/github.com-1ecc6299db9ec823/itertools-0.10.5/src/zip_eq_impl.rs:48:13
stack backtrace: 
   0: leo::set_panic_hook::{{closure}}
   1: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/alloc/src/boxed.rs:2032:9
      std::panicking::rust_panic_with_hook
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:692:13
   2: std::panicking::begin_panic::{{closure}}
   3: std::sys_common::backtrace::__rust_end_short_backtrace
   4: std::panicking::begin_panic
   5: <itertools::zip_eq_impl::ZipEq<I,J> as core::iter::traits::iterator::Iterator>::next
   6: itertools::Itertools::join
   7: leo_passes::code_generation::visit_statements::<impl leo_passes::code_generation::generator::CodeGenerator>::visit_statement
   8: itertools::Itertools::join
   9: leo_passes::code_generation::visit_program::<impl leo_passes::code_generation::generator::CodeGenerator>::visit_function
  10: itertools::Itertools::join
  11: leo_passes::code_generation::visit_program::<impl leo_passes::code_generation::generator::CodeGenerator>::visit_program
  12: leo_passes::code_generation::<impl leo_passes::pass::Pass for leo_passes::code_generation::generator::CodeGenerator>::do_pass
  13: leo_compiler::compiler::Compiler::compile
  14: leo::commands::build::compile_leo_file
  15: <leo::commands::build::Build as leo::commands::Command>::apply
  16: leo::commands::Command::execute
  17: leo::commands::Command::try_execute
  18: leo::run_with_args
  19: scoped_tls::ScopedKey<T>::set
  20: leo::main
  21: std::sys_common::backtrace::__rust_begin_short_backtrace
  22: std::rt::lang_start::{{closure}}
  23: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/ops/function.rs:606:13
      std::panicking::try::do_call
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
      std::panicking::try
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
      std::panic::catch_unwind
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
      std::rt::lang_start_internal::{{closure}}
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/rt.rs:148:48
      std::panicking::try::do_call
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
      std::panicking::try
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
      std::panic::catch_unwind
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
      std::rt::lang_start_internal
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/rt.rs:148:20
  24: main
  25: __libc_start_call_main
             at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  26: __libc_start_main_impl
             at ./csu/../csu/libc-start.c:392:3
  27: _start

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/AleoHQ/leo/issues/new?labels=bug,panic&template=bug.md&title=[Bug]

note: leo-lang 1.6.3 running on Linux 5.15.90.1-microsoft-standard-WSL2

note: compiler args: leo build

note: compiler flags: CLI { debug: false, quiet: false, command: Build { command: Build { options: BuildOptions { offline: false, enable_spans: false, enable_dce: false, enable_all_ast_snapshots: false, enable_initial_input_ast_snapshot: false, enable_initial_ast_snapshot: false, enable_unrolled_ast_snapshot: false, enable_ssa_ast_snapshot: false, enable_flattened_ast_snapshot: false, enable_inlined_ast_snapshot: false, enable_dce_ast_snapshot: false } } }, api: None, path: None }

Expected Behavior

Throw some error saying that the transition should have some test_credits as output.

Your Environment

  • Leo Version: 1.6.3
@prajwolrg prajwolrg added the bug Something isn't working label Apr 5, 2023
@prajwolrg prajwolrg changed the title [Bug] [Bug] thread main panicked at 'itertools' Apr 6, 2023
@d0cd d0cd self-assigned this Apr 7, 2023
@d0cd
Copy link
Collaborator

d0cd commented Apr 7, 2023

Closed by #2340.

@d0cd d0cd closed this as completed Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants