Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Panic: recursion limit exceed #130

@savchenko

Description

@savchenko

Describe the bug

Trying to run pylyzer v0.0.82 on the application entry point results in 100% CPU usage and panic:

Start checking: __init__.py

thread 'sqlalchemy/sql' panicked at /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/erg_compiler-0.6.53-nightly.5/context/compare.rs:362:9:
recursion limit exceed: structural_supertype_of(Iterable(?T), List!(T, _: Nat))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Reproducible Code

Still tracking the problematic import, unfortunately the panic occurs in the proprietary repository.

Environment

OS: Debian Linux
Version: 13 / Trixie

Expected behavior

pylyzer doesn't panic.

Error log

Full backtrace
Start checking: __init__.py

thread 'sqlalchemy/sql' panicked at /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/erg_compiler-0.6.53-nightly.5/context/compare.rs:362:9:
recursion limit exceed: structural_supertype_of(Iterable(?T), List!(T, _: Nat))
stack backtrace:
   0:     0x5558f817ee59 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::he621b98f63f9d3d7
   1:     0x5558f8191133 - core::fmt::write::hde6dfded0b3527b3
   2:     0x5558f816ec7f - std::io::Write::write_fmt::h36296b2095d435c5
   3:     0x5558f817eca3 - std::sys::backtrace::BacktraceLock::print::h6afc11248184a26d
   4:     0x5558f814d0d5 - std::panicking::default_hook::{{closure}}::h10a0643748605a95
   5:     0x5558f814cec8 - std::panicking::default_hook::hd325ab9c425e39f5
   6:     0x5558f814d6af - std::panicking::rust_panic_with_hook::h971cc6030e2a4c0c
   7:     0x5558f817fa5a - std::panicking::begin_panic_handler::{{closure}}::h2e190a4e7de13958
   8:     0x5558f817f099 - std::sys::backtrace::__rust_end_short_backtrace::hcd8ac5f0f2c9f590
   9:     0x5558f814d21d - rust_begin_unwind
  10:     0x5558f600a6e0 - core::panicking::panic_fmt::h7d0ff9f662980bad
  11:     0x5558f744f8c1 - erg_compiler::context::compare::<impl erg_compiler::context::Context>::structural_supertype_of::hada11eb596e76192
  12:     0x5558f744dffa - erg_compiler::context::compare::<impl erg_compiler::context::Context>::structural_supertype_of::hada11eb596e76192
  13:     0x5558f744a789 - erg_compiler::context::compare::<impl erg_compiler::context::Context>::supertype_of::hb8b5de150f3890be
  14:     0x5558f7452d80 - erg_compiler::context::compare::<impl erg_compiler::context::Context>::poly_supertype_of::h2e56d6bd06581c19
  15:     0x5558f7451460 - erg_compiler::context::compare::<impl erg_compiler::context::Context>::structural_supertype_of::hada11eb596e76192
  16:     0x5558f744b8c5 - erg_compiler::context::compare::<impl erg_compiler::context::Context>::_nominal_supertype_of::h765a593218183be9
  17:     0x5558f744afdc - erg_compiler::context::compare::<impl erg_compiler::context::Context>::nominal_supertype_of::hd62e37d30e47f515
  18:     0x5558f744e013 - erg_compiler::context::compare::<impl erg_compiler::context::Context>::structural_supertype_of::hada11eb596e76192

 [---> Repetitive lines stripped here <---]

 764:     0x5558f7452d80 - erg_compiler::context::compare::<impl erg_compiler::context::Context>::poly_supertype_of::h2e56d6bd06581c19
 765:     0x5558f7451460 - erg_compiler::context::compare::<impl erg_compiler::context::Context>::structural_supertype_of::hada11eb596e76192
 766:     0x5558f744b8c5 - erg_compiler::context::compare::<impl erg_compiler::context::Context>::_nominal_supertype_of::h765a593218183be9
 767:     0x5558f744afdc - erg_compiler::context::compare::<impl erg_compiler::context::Context>::nominal_supertype_of::hd62e37d30e47f515
 768:     0x5558f744e013 - erg_compiler::context::compare::<impl erg_compiler::context::Context>::structural_supertype_of::hada11eb596e76192
 769:     0x5558f744dc24 - erg_compiler::context::compare::<impl erg_compiler::context::Context>::structural_supertype_of::hada11eb596e76192
 770:     0x5558f744a846 - erg_compiler::context::compare::<impl erg_compiler::context::Context>::subtype_of::hd1a30fcebcfab2a1
 771:     0x5558f737d838 - erg_compiler::context::unify::Unifier<L>::sub_unify::haa42dddf041282d7
 772:     0x5558f78e80fa - erg_compiler::context::unify::<impl erg_compiler::context::Context>::sub_unify::h01c2954483b7e894
 773:     0x5558f745091b - erg_compiler::context::compare::<impl erg_compiler::context::Context>::structural_supertype_of::hada11eb596e76192
 774:     0x5558f744a789 - erg_compiler::context::compare::<impl erg_compiler::context::Context>::supertype_of::hb8b5de150f3890be
 775:     0x5558f6459055 - erg_compiler::context::register::<impl erg_compiler::context::Context>::assign_subr::h8a33ffec4053158e
 776:     0x5558f64a16ea - erg_compiler::lower::GenericASTLowerer<A>::lower_subr_block::hfc774595aabea778
 777:     0x5558f64afecc - erg_compiler::lower::GenericASTLowerer<A>::lower_def::hc0cdd03e680654ee
 778:     0x5558f6489feb - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 779:     0x5558f64ab6d7 - erg_compiler::lower::GenericASTLowerer<A>::lower::h4a86ac0389cb7f3c
 780:     0x5558f63424a2 - erg_compiler::build_hir::GenericHIRBuilder<ASTBuilder>::check::h2548edb838c3f903
 781:     0x5558f64a76da - erg_compiler::lower::GenericASTLowerer<A>::lower_inline_module::hfa2c776982de0b0a
 782:     0x5558f6481470 - erg_compiler::lower::GenericASTLowerer<A>::lower_expr::h0b16d1bd0bc50171
 783:     0x5558f6488026 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 784:     0x5558f6487b9c - erg_compiler::lower::GenericASTLowerer<A>::lower_block::h4cde4793fbd942db
 785:     0x5558f64b0241 - erg_compiler::lower::GenericASTLowerer<A>::lower_def::hc0cdd03e680654ee
 786:     0x5558f64881f7 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 787:     0x5558f64ab6d7 - erg_compiler::lower::GenericASTLowerer<A>::lower::h4a86ac0389cb7f3c
 788:     0x5558f63424a2 - erg_compiler::build_hir::GenericHIRBuilder<ASTBuilder>::check::h2548edb838c3f903
 789:     0x5558f64a76da - erg_compiler::lower::GenericASTLowerer<A>::lower_inline_module::hfa2c776982de0b0a
 790:     0x5558f6481470 - erg_compiler::lower::GenericASTLowerer<A>::lower_expr::h0b16d1bd0bc50171
 791:     0x5558f6488026 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 792:     0x5558f6487b9c - erg_compiler::lower::GenericASTLowerer<A>::lower_block::h4cde4793fbd942db
 793:     0x5558f64b0241 - erg_compiler::lower::GenericASTLowerer<A>::lower_def::hc0cdd03e680654ee
 794:     0x5558f64881f7 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 795:     0x5558f64ab6d7 - erg_compiler::lower::GenericASTLowerer<A>::lower::h4a86ac0389cb7f3c
 796:     0x5558f63424a2 - erg_compiler::build_hir::GenericHIRBuilder<ASTBuilder>::check::h2548edb838c3f903
 797:     0x5558f64a76da - erg_compiler::lower::GenericASTLowerer<A>::lower_inline_module::hfa2c776982de0b0a
 798:     0x5558f6481470 - erg_compiler::lower::GenericASTLowerer<A>::lower_expr::h0b16d1bd0bc50171
 799:     0x5558f6488026 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 800:     0x5558f6487b9c - erg_compiler::lower::GenericASTLowerer<A>::lower_block::h4cde4793fbd942db
 801:     0x5558f64b0241 - erg_compiler::lower::GenericASTLowerer<A>::lower_def::hc0cdd03e680654ee
 802:     0x5558f64881f7 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 803:     0x5558f64ab6d7 - erg_compiler::lower::GenericASTLowerer<A>::lower::h4a86ac0389cb7f3c
 804:     0x5558f63424a2 - erg_compiler::build_hir::GenericHIRBuilder<ASTBuilder>::check::h2548edb838c3f903
 805:     0x5558f64a76da - erg_compiler::lower::GenericASTLowerer<A>::lower_inline_module::hfa2c776982de0b0a
 806:     0x5558f6481470 - erg_compiler::lower::GenericASTLowerer<A>::lower_expr::h0b16d1bd0bc50171
 807:     0x5558f6488026 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 808:     0x5558f6487b9c - erg_compiler::lower::GenericASTLowerer<A>::lower_block::h4cde4793fbd942db
 809:     0x5558f64b0241 - erg_compiler::lower::GenericASTLowerer<A>::lower_def::hc0cdd03e680654ee
 810:     0x5558f64881f7 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 811:     0x5558f64ab6d7 - erg_compiler::lower::GenericASTLowerer<A>::lower::h4a86ac0389cb7f3c
 812:     0x5558f63424a2 - erg_compiler::build_hir::GenericHIRBuilder<ASTBuilder>::check::h2548edb838c3f903
 813:     0x5558f64a76da - erg_compiler::lower::GenericASTLowerer<A>::lower_inline_module::hfa2c776982de0b0a
 814:     0x5558f6481470 - erg_compiler::lower::GenericASTLowerer<A>::lower_expr::h0b16d1bd0bc50171
 815:     0x5558f6488026 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 816:     0x5558f6487b9c - erg_compiler::lower::GenericASTLowerer<A>::lower_block::h4cde4793fbd942db
 817:     0x5558f64b0241 - erg_compiler::lower::GenericASTLowerer<A>::lower_def::hc0cdd03e680654ee
 818:     0x5558f64881f7 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 819:     0x5558f64ab6d7 - erg_compiler::lower::GenericASTLowerer<A>::lower::h4a86ac0389cb7f3c
 820:     0x5558f63424a2 - erg_compiler::build_hir::GenericHIRBuilder<ASTBuilder>::check::h2548edb838c3f903
 821:     0x5558f64a76da - erg_compiler::lower::GenericASTLowerer<A>::lower_inline_module::hfa2c776982de0b0a
 822:     0x5558f6481470 - erg_compiler::lower::GenericASTLowerer<A>::lower_expr::h0b16d1bd0bc50171
 823:     0x5558f6488026 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 824:     0x5558f6487b9c - erg_compiler::lower::GenericASTLowerer<A>::lower_block::h4cde4793fbd942db
 825:     0x5558f64b0241 - erg_compiler::lower::GenericASTLowerer<A>::lower_def::hc0cdd03e680654ee
 826:     0x5558f64881f7 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 827:     0x5558f64ab6d7 - erg_compiler::lower::GenericASTLowerer<A>::lower::h4a86ac0389cb7f3c
 828:     0x5558f63424a2 - erg_compiler::build_hir::GenericHIRBuilder<ASTBuilder>::check::h2548edb838c3f903
 829:     0x5558f64a76da - erg_compiler::lower::GenericASTLowerer<A>::lower_inline_module::hfa2c776982de0b0a
 830:     0x5558f6481470 - erg_compiler::lower::GenericASTLowerer<A>::lower_expr::h0b16d1bd0bc50171
 831:     0x5558f6488026 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 832:     0x5558f6487b9c - erg_compiler::lower::GenericASTLowerer<A>::lower_block::h4cde4793fbd942db
 833:     0x5558f64b0241 - erg_compiler::lower::GenericASTLowerer<A>::lower_def::hc0cdd03e680654ee
 834:     0x5558f64881f7 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 835:     0x5558f6487b9c - erg_compiler::lower::GenericASTLowerer<A>::lower_block::h4cde4793fbd942db
 836:     0x5558f649772d - erg_compiler::lower::GenericASTLowerer<A>::lower_lambda::h6b5a7f9dac6d91d2
 837:     0x5558f6480fdd - erg_compiler::lower::GenericASTLowerer<A>::lower_expr::h0b16d1bd0bc50171
 838:     0x5558f647d39f - erg_compiler::lower::GenericASTLowerer<A>::lower_call::h56d3b932da6bf7f2
 839:     0x5558f6481e1e - erg_compiler::lower::GenericASTLowerer<A>::lower_expr::h0b16d1bd0bc50171
 840:     0x5558f6488026 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 841:     0x5558f64ab6d7 - erg_compiler::lower::GenericASTLowerer<A>::lower::h4a86ac0389cb7f3c
 842:     0x5558f63424a2 - erg_compiler::build_hir::GenericHIRBuilder<ASTBuilder>::check::h2548edb838c3f903
 843:     0x5558f64a76da - erg_compiler::lower::GenericASTLowerer<A>::lower_inline_module::hfa2c776982de0b0a
 844:     0x5558f6481470 - erg_compiler::lower::GenericASTLowerer<A>::lower_expr::h0b16d1bd0bc50171
 845:     0x5558f6488026 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 846:     0x5558f6487b9c - erg_compiler::lower::GenericASTLowerer<A>::lower_block::h4cde4793fbd942db
 847:     0x5558f64b0241 - erg_compiler::lower::GenericASTLowerer<A>::lower_def::hc0cdd03e680654ee
 848:     0x5558f64881f7 - erg_compiler::lower::GenericASTLowerer<A>::lower_chunk::h6e07a9bad6f7ada1
 849:     0x5558f64ab6d7 - erg_compiler::lower::GenericASTLowerer<A>::lower::h4a86ac0389cb7f3c
 850:     0x5558f63424a2 - erg_compiler::build_hir::GenericHIRBuilder<ASTBuilder>::check::h2548edb838c3f903
 851:     0x5558f63436df - std::sys::backtrace::__rust_begin_short_backtrace::h4bbb3caa3021614f
 852:     0x5558f6323866 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h2bf73cd63b01766a
 853:     0x5558f814dbfb - std::sys::pal::unix::thread::Thread::new::thread_start::hdd15438550d3f0ad
 854:     0x7f9e6e8c2b7b - start_thread
                               at ./nptl/pthread_create.c:448:8
 855:     0x7f9e6e9407b8 - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
 856:                0x0 - <unknown>

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions