-
-
Notifications
You must be signed in to change notification settings - Fork 35
More resizing for truncating return values from LAPACK #1190
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
Conversation
|
More to come. EDIT 2/12/25: Determined I wasn't using the right inputs to test the new path. Using a 100x110 array to test, which triggers the truncation path: (more to come) |
|
Test failures may be real? |
|
@BioTurboNick Looks like a nice PR but seems to break some tests. |
|
Thanks! I'm mystified why it would work on Linux segfaults and isn't helpful in figuring out the cause, but Windows provides a The proximate cause is in But still, that should only produce garbage values in the extra part, not a segfault? And why only on x86_64? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1190 +/- ##
==========================================
+ Coverage 91.89% 91.92% +0.02%
==========================================
Files 34 34
Lines 15360 15365 +5
==========================================
+ Hits 14115 14124 +9
+ Misses 1245 1241 -4 ☔ View full report in Codecov by Sentry. |
|
Oy. Either the debug code caused it to go away, or the change in nightly from DEV.33 to DEV.38 did it. EDIT: Nope, not fixed by the newer nightlies. It's a Heisenbug. |
|
Finally, a minimal reproducer: It seems that this is a bug in Julia (1.11 and nightly)? Seems to be producing undefined behavior. With various configurations of the end code I get a Julia crash with It seems some necessary ingredients are 1) initiating as a vector*; 2) passing the vector into the ccall; 3) reshaping the vector into a matrix (resize call not necessary, though can independently trigger a similar error). If the array is initiated as a matrix, and then later reshaped with And the issue goes away entirely if the offending line is wrapped in try/catch. *As far as C is concerned, an array is just a pointer to the start of a chunk of memory, so should make no difference on the C side of things? |
|
Well, that was dumb. Changed it to a vector, didn't change the line that relied on looking up its second dimension. |
|
IIUC, you solved the issue, right? So, there is no need to catch anything in the tests? I wasn't able to run tests locally, so I removed the try-catch-block and added a simple test to cover what was already missed before your PR. If tests pass, then I think this should be ready to go. |
|
Ah thanks, yeah good to go. |




Found additional locations that could benefit from the changes in #1176 , but I haven't tested these as yet.