# Segmentation fault (core dumped)

**URL:** <https://forum.modular.com/t/segmentation-fault-core-dumped/1592>\
**Category:** Mojo\
**Tags:** debugging\
**Created:** [June 5, 2025, 5:15pm UTC](https://forum.modular.com/t/segmentation-fault-core-dumped/1592 "2025-06-05T17:15:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![notooth](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@notooth](https://forum.modular.com/u/notooth)\
**Post date:** [June 5, 2025, 5:15pm UTC](https://forum.modular.com/t/segmentation-fault-core-dumped/1592/1 "2025-06-05T17:15:07Z")

</div>

This code caused `Segmentation fault` error. Can anyone help me fix it?

```mojo
struct State:
    var number: UInt256 
    var map1: Dict[Int, UInt256] 
    var map2: Dict[Int, UInt256]           
    var map3: Dict[Int, UInt256]

    fn __init__ (out self, owned number: UInt256, map1: Dict[Int, UInt256], map2: Dict[Int, UInt256], map3: Dict[Int, UInt256]):
        self.number = number
        self.map1 = map1
        self.map2 = map2
        self.map3 = map3 
        
    fn __copyinit__ (out self, existing: Self):
        self.number = existing.number
        self.map1 = existing.map1
        self.map2 = existing.map2
        self.map3 = existing.map3        

    fn __moveinit__ (out self, owned existing: Self):
        self.number = existing.number
        self.map1 = existing.map1
        self.map2 = existing.map2
        self.map3 = existing.map3        
    
fn main() raises:
    var pool_states = Dict[String, State]()
    for i in range(100):
        print(i)
        pool_states[String(i)] = State(0, Dict[Int, UInt256](), Dict[Int, UInt256](), Dict[Int, UInt256]())

```

```plaintext
0
1
Please submit a bug report to https://github.com/modular/modular/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0.	Program arguments: mojo life.mojo
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 0x00005615af94c65b
1 mojo 0x00005615af94a3f9
2 mojo 0x00005615af94cd0a
3 libc.so.6 0x00007faaaee67070
4 libc.so.6 0x00007faaaeec0334
5 libc.so.6 0x00007faaaee66fbe gsignal + 30
6 libAsyncRTMojoBindings.so 0x00007faab0fb1542
7 libc.so.6 0x00007faaaee67070
8 (error) 0x00007fa9b8003c6d
mojo crashed!
Please file a bug report.
Segmentation fault (core dumped)

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex001/uploads/modular/original/1X/2751e0fbdc595a99718b216730957e9db4448cfd.jpeg) [@system](https://forum.modular.com/u/system)\
**Post date:** [December 2, 2025, 5:15pm UTC](https://forum.modular.com/t/segmentation-fault-core-dumped/1592/2 "2025-12-02T17:15:09Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
