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]: Assertion failed: (argIdx != 0 && "TODO: unexpected self mismatch"), function describeArgumentNo #1562

Closed
danny-su opened this issue Dec 25, 2023 · 5 comments
Labels
bug Something isn't working crash mojo Issues that are related to mojo mojo-lang Tag for all issues related to language.

Comments

@danny-su
Copy link

danny-su commented Dec 25, 2023

Bug description

Assertion failed: (argIdx != 0 && "TODO: unexpected self mismatch"), function describeArgumentNo, file OverloadFitness.cpp, line 448.
Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0.      Program arguments: mojo build hello.mojo
1.      Crash resolving decl body at loc("/Users/danny/Downloads/demo/mojo/hello.mojo":19:1)
    >> fn main() raises:
       ^................
    >>     let buf = Buffer[10, DType.int32]
    >>     buf.zero()
       ..............<
2.      Crash parsing statement at loc("/Users/danny/Downloads/demo/mojo/hello.mojo":21:5)
    >>     buf.zero()
           ^.........<
 #0 0x0000000100b3f318 llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x1000c7318)
 #1 0x0000000100b3d478 llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x1000c5478)
 #2 0x0000000100b3f9b4 llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x1000c79b4)
 #3 0x000000018c9a9a24 (/usr/lib/system/libsystem_platform.dylib+0x18046da24)
 #4 0x000000018c979cc0 (/usr/lib/system/libsystem_pthread.dylib+0x18043dcc0)
 #5 0x000000018c885a40 (/usr/lib/system/libsystem_c.dylib+0x180349a40)
 #6 0x000000018c884d30 (/usr/lib/system/libsystem_c.dylib+0x180348d30)
 #7 0x0000000103197364 mbedtls_version_get_number (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x10271f364)
 #8 0x0000000100ea65f4 llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x10042e5f4)
 #9 0x0000000100ea5a34 llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x10042da34)
#10 0x0000000100ea6188 llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x10042e188)
#11 0x0000000100ea5408 llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x10042d408)
#12 0x0000000100e426bc llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x1003ca6bc)
#13 0x0000000100e45c5c llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x1003cdc5c)
#14 0x0000000100e8bc84 llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x100413c84)
#15 0x0000000100e80e08 llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x100408e08)
#16 0x0000000100eb1bec llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x100439bec)
#17 0x0000000100eb1128 llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x100439128)
#18 0x0000000100eb0fc0 llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x100438fc0)
#19 0x0000000100e581c8 llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x1003e01c8)
#20 0x0000000100e6b018 llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x1003f3018)
#21 0x0000000100e6b7dc llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x1003f37dc)
#22 0x0000000100e7340c llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x1003fb40c)
#23 0x0000000100e7372c llvm_strlcpy (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x1003fb72c)
#24 0x0000000100a85b00 _mh_execute_header (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x10000db00)
#25 0x0000000100a81414 _mh_execute_header (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x100009414)
#26 0x0000000100a8020c _mh_execute_header (/Users/danny/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x10000820c)
#27 0x000000018c5f90e0 
[40569:23241309:20231225,113746.481964:WARNING in_range_cast.h:38] value -634136515 out of range
[40569:23241309:20231225,113746.486982:WARNING crash_report_exception_handler.cc:257] UniversalExceptionRaise: (os/kern) failure (5)
[1]    40567 abort      mojo build hello.mojo

Steps to reproduce

# hello.mojo
fn main() raises:
    let buf = Buffer[10, DType.int32]
    buf.zero()

mojo build hello.mojo

System information

- What OS did you do install Mojo on ?
macOS 14.2.1 (23C71)

- Provide version information for Mojo by pasting the output of `mojo -v`
mojo 0.6.1 (876ded2e)

- Provide Modular CLI version by pasting the output of `modular -v`
modular 0.3.1 (589ce200)
@danny-su danny-su added bug Something isn't working mojo Issues that are related to mojo labels Dec 25, 2023
@ematejska ematejska added the mojo-lang Tag for all issues related to language. label Jan 3, 2024
@junweizeng
Copy link
Contributor

Here's a new code (i.e. test.mojo) that can also reproduce the issue.

struct a:

    var b: DTypePointer[]
    fn c(d):
        d.b.free()

Steps to reproduce

$ mojo build test.mojo
mojo: /__w/modular/modular/KGEN/lib/MojoParser/OverloadFitness.cpp:493: void (anonymous namespace)::DiagEmitter::describeArgumentNo(M::InflightDiag &, size_t) const: Assertion `argIdx != 0 && "TODO: unexpected self mismatch"' failed.
[18612:18612:20240128,020742.447703:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[18612:18612:20240128,020742.447841:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0.      Program arguments: mojo build test.mojo
1.      Crash resolving decl body at loc("/path/to/test.mojo":4:5)
    >>     fn c(d):
           ^.......
    >>         d.b.free()
       ..................<
2.      Crash parsing statement at loc("/path/to/test.mojo":5:9)
    >>         d.b.free()
               ^.........<
 #0 0x00005558960c6337 (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x621337)
 #1 0x00005558960c3f0e (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x61ef0e)
 #2 0x00005558960c6a0f (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x621a0f)
 #3 0x00007f64fb98b520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007f64fb9df9fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007f64fb98b476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007f64fb9717f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x00007f64fb97171b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x00007f64fb982e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x00005558965c57fa (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xb207fa)
#10 0x00005558965c4a48 (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xb1fa48)
#11 0x00005558965c5317 (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xb20317)
#12 0x00005558965c417a (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xb1f17a)
#13 0x00005558965b9105 (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xb14105)
#14 0x00005558965bca37 (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xb17a37)
#15 0x0000555896570eef (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xacbeef)
#16 0x00005558965636a9 (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xabe6a9)
#17 0x0000555896599bba (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xaf4bba)
#18 0x0000555896596fa8 (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xaf1fa8)
#19 0x0000555896596e46 (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xaf1e46)
#20 0x000055589653843c (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xa9343c)
#21 0x0000555896550c06 (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xaabc06)
#22 0x00005558965512c8 (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xaac2c8)
#23 0x00005558964f8614 (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xa53614)
#24 0x00005558964f8980 (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0xa53980)
#25 0x0000555896079a3f (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x5d4a3f)
#26 0x000055589607bf1b (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x5d6f1b)
#27 0x0000555896076bb3 (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x5d1bb3)
#28 0x0000555896075492 (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x5d0492)
#29 0x00007f64fb972d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#30 0x00007f64fb972e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#31 0x0000555896074c9e (/home/jwzeng/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x5cfc9e)
Aborted

System information

- Ubuntu 22.04.3 LTS (WSL 2)
- mojo 0.7.0 (af002202)
- modular 0.4.1 (2d8afe15)

@Mogball Mogball closed this as completed Feb 23, 2024
@danny-su
Copy link
Author

@Mogball Which version of Mojo fixed this issue? I still get the following error, and even more, The latest version of Mojo gives me an error in the VS Code editor, indicating that a crash happened.

$ mojo -v
mojo 0.7.1 (af002202)
25897

@Mogball
Copy link
Collaborator

Mogball commented Feb 28, 2024

next release

@danny-su
Copy link
Author

@Mogball Still not working, the line "buf.zero" leads to this error.
image

@modularml modularml locked as resolved and limited conversation to collaborators Feb 29, 2024
@Mogball
Copy link
Collaborator

Mogball commented Feb 29, 2024

This is fixed in the next release. Please be patient

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working crash mojo Issues that are related to mojo mojo-lang Tag for all issues related to language.
Projects
None yet
Development

No branches or pull requests

4 participants