modularml / mojo

The Mojo Programming Language
https://docs.modular.com/mojo/manual/
Other
23.27k stars 2.59k forks source link

[BUG] Parser crash when initializing list #2328

Open dreycenfoiles opened 6 months ago

dreycenfoiles commented 6 months ago

Bug description

I wrote some incorrect code for initializing a List and that caused the parser to crash. If I attempted to compile, I got a segmentation fault with the following stack trace:

Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mojo      0x000060bacb503f57
1  mojo      0x000060bacb501b2e
2  mojo      0x000060bacb5045ef
3  libc.so.6 0x000071d849645320
4  mojo      0x000060bacb92ed44
5  mojo      0x000060bacb905877
6  mojo      0x000060bacb97cb4c
7  mojo      0x000060bacb97abb0
8  mojo      0x000060bacb97da39
9  mojo      0x000060bacb980bdb
10 mojo      0x000060bacb8be172
11 mojo      0x000060bacb8bf60b
12 mojo      0x000060bacb916a8d
13 mojo      0x000060bacb909a9e
14 mojo      0x000060bacb950cc6
15 mojo      0x000060bacb946e38
16 mojo      0x000060bacb946ce6
17 mojo      0x000060bacb8dca25
18 mojo      0x000060bacb8eef94
19 mojo      0x000060bacb8ef6a8
20 mojo      0x000060bacb8fa2a2
21 mojo      0x000060bacb8fa62d
22 mojo      0x000060bacb43a23c
23 mojo      0x000060bacb41e111
24 mojo      0x000060bacb439246
25 mojo      0x000060bacb417cf4
26 libc.so.6 0x000071d84962a1ca
27 libc.so.6 0x000071d84962a28b __libc_start_main + 139
28 mojo      0x000060bacb41742e
0x60bace300238 crashed!
Please file a bug report.
Segmentation fault (core dumped)

Steps to reproduce

from collections.list import List

fn main():
    var v = List(Scalar[DType.float64])

System information

- OS: Ubuntu 24.04
- Mojo: 24.2.1
- Modular: 0.7.1
ematejska commented 6 months ago

Reproduces.