-
Notifications
You must be signed in to change notification settings - Fork 7
Segfault when assigning to a complex Scalar #40
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
Comments
Here's some spooky action: the following doesn't crash! import suitesparse_graphblas as ssgb
ssgb.initialize()
for attr in dir(ssgb.lib):
getattr(ssgb.lib, attr)
s = ssgb.ffi.new("GrB_Scalar*")
assert ssgb.lib.GrB_Scalar_new(s, ssgb.lib.GxB_FC64) == 0
assert ssgb.lib.GxB_Scalar_setElement_FC64(s[0], 1j) == 0 |
I just tried a simple stand-alone C test and it worked fine. Give this a try: |
What is the type of 1j? Is it complex, or a pure imaginary value (with no real part)? Does Python have such scalar types? |
Here is the output I get from "make" and everything is fine:
|
Thanks for giving this a try @DrTimothyAldenDavis! Yeah, Python has builtin complex numbers, and Upon further stress testing, adding for attr in dir(ssgb.lib):
getattr(ssgb.lib, attr) reliably fixes the segfault for me. How does the joke go?
I have no idea why the above trick works (is |
I get a segfault when I run this code:
Any thoughts? I guess we should try running this in C.
The text was updated successfully, but these errors were encountered: