Open hylkedonker opened 5 months ago
I think the following simpler problem maybe related:
from python import Python, PythonObject
fn h() raises -> Tuple[PythonObject, PythonObject]:
var np = Python.import_module("numpy")
return np.array([]), np.array([])
def main():
w, h = h()
which crashes with the error:
Reference count error detected: an attempt was made to deallocate the dtype 12 (d)
I am using the nightly build:
mojo 2024.8.2805 (fd3bceba)
Bug description
I've come across another small code snippet that causes mojo to seg fault. It is a strange combination of several necessary conditions:
fn
function returning a tuple.Steps to reproduce
Here is the corresponding code snippet:
And hereby the segmentation fault error message:
Interestingly, when some of the conditions listed above is not met, the problem disappears.
Or, when a complete reduction is performed, also no segmentation fault occurs:
So a bit of a mystery, it seems. :-)
System information