# Recent mojo crashes in python interop, possibly due to recursive types

**URL:** <https://forum.modular.com/t/recent-mojo-crashes-in-python-interop-possibly-due-to-recursive-types/2823>\
**Category:** Mojo\
**Created:** [March 8, 2026, 10:33am UTC](https://forum.modular.com/t/recent-mojo-crashes-in-python-interop-possibly-due-to-recursive-types/2823 "2026-03-08T10:33:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mseritan](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/mseritan/32/130_2.png) [@mseritan](https://forum.modular.com/u/mseritan)\
**Post date:** [March 8, 2026, 10:33am UTC](https://forum.modular.com/t/recent-mojo-crashes-in-python-interop-possibly-due-to-recursive-types/2823/1 "2026-03-08T10:33:20Z")

</div>

> <https://github.com/modular/modular/issues/6123>
>
> \### Bug description
> 
> \### Actual behavior
> 
> Please see the minimal code in the fol…lowing repo: https://github.com/winding-lines/recursive-types
> 
> Mojo hangs when running \`pixi run build\_python\` on Mac OS Tahoe.
> 
> \### Expected behavior
> 
> This code works fine with a december version of mojo in this branch https://github.com/winding-lines/recursive-types/tree/mojo-dec
> 
> 
> \### Steps to reproduce
> 
> \- Please paste or attach the .mojo files that are needed to reproduce the issue.
> \- If you are able to reduce the reproduction steps to a small example, this would be much appreciated!
> \- Please quote the command line you used to compile and/or run the example.
> \- If you see a crash or an error message, please paste it in the "actual behavior" above.
> \- If using the Godbolt / Compiler Explorer, share the example link.
> \- Include anything else that might help us debug the issue. Your insights and observations are welcome!
> 
> Mojo hangs when running \`pixi run build\_python\` on Mac OS Tahoe.
> 
> Please see https://github.com/winding-lines/recursive-types, the code is also reproduced below.
> 
> \`\`\`
> 
> from std.python import PythonObject, Python
> from std.python.bindings import PythonModuleBuilder
> from std.os import abort
> 
> struct Field1(Copyable, Writable):
> var dtype: DataType1
> var nullable: Bool
> 
> fn \_\_copyinit\_\_(out self, copy: Field1):
> self.dtype = copy.dtype.copy()
> self.nullable = copy.nullable
> 
> 
> struct DataType1(Copyable, Writable):
> var code: UInt8
> var fields: List\[Field1\]
> var size: Int
> 
> fn \_\_copyinit\_\_(out self, copy: Self):
> self.code = copy.code
> self.fields = copy.fields.copy()
> self.size = copy.size
> 
> @export
> fn PyInit\_recursive\_types() -\> PythonObject:
> try:
> var m = PythonModuleBuilder("recursive\_types")
> 
> \_ = m.add\_type\[DataType1\]("DataType")
> return m.finalize()
> except e:
> abort(String("error creating Python Mojo module:", e))
> \`\`\`
> 
> 
> \### System information
> 
> \- Provide the system information by running \`pixi info\`.
> \`\`\`
> ❯ pixi info
> System
> \------------
> Pixi version: 0.59.0
> Platform: osx-arm64
> Virtual packages: \_\_unix=0=0
> : \_\_osx=26.3.1=0
> : \_\_archspec=1=m2
> Cache dir: /Users/mseritan/Library/Caches/rattler/cache
> Auth storage: /Users/mseritan/.rattler/credentials.json
> Config locations: No config files found
> 
> Global
> \------------
> Bin dir: /Users/mseritan/.pixi/bin
> Environment dir: /Users/mseritan/.pixi/envs
> Manifest dir: /Users/mseritan/.pixi/manifests/pixi-global.toml
> 
> Workspace
> \------------
> Name: recursive-types
> Version: 0.1.0
> Manifest file: /Users/mseritan/dev/recursive-types/pixi.toml
> Last updated: 08-03-2026 12:28:03
> 
> Environments
> \------------
> Environment: default
> Features: default
> Channels: https://conda.modular.com/max-nightly, conda-forge
> Dependency count: 3
> Dependencies: python, pytest, mojo
> Target platforms: osx-arm64, linux-64
> Prefix location: /Users/mseritan/dev/recursive-types/.pixi/envs/default
> Tasks: build\_python
> 
> \`\`\`
> 
> \- Provide version information for MAX (includes Mojo) by pasting the output of \`pixi list max\`.
> 
> \`\`\`
> ❯ pixi list mojo
> Package Version Build Size Kind Source
> mojo 0.26.2.0.dev2026030805 release 77.5 MiB conda https://conda.modular.com/max-nightly/
> mojo-compiler 0.26.2.0.dev2026030805 release 64 MiB conda https://conda.modular.com/max-nightly/
> mojo-python 0.26.2.0.dev2026030805 release 23.6 KiB conda https://conda.modular.com/max-nightly/
> \`\`\`

---

<div class="post-metadata">

**Author:** ![DarinSimmons](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/darinsimmons/32/12_2.png) [@DarinSimmons](https://forum.modular.com/u/DarinSimmons)\
**Post date:** [March 9, 2026, 4:30pm UTC](https://forum.modular.com/t/recent-mojo-crashes-in-python-interop-possibly-due-to-recursive-types/2823/2 "2026-03-09T16:30:16Z")

</div>

Nice regression tracing and bug write-up. 👍

---

<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:** [September 5, 2026, 4:30pm UTC](https://forum.modular.com/t/recent-mojo-crashes-in-python-interop-possibly-due-to-recursive-types/2823/3 "2026-09-05T16:30:43Z")

</div>

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