-
Notifications
You must be signed in to change notification settings - Fork 230
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
bug in try, alarm, and ??= (augmented null coalescing assignment operator) #3524
Comments
I think I've zeroed in on the problem a bit more. Certain errors break i1 : alarm 1; try ZZ.foo else sleep 2
o2 = 0
i3 : alarm 1; ZZ.foo ?? sleep 2
o4 = 0 But other errors are fine: i5 : alarm 1; try 1/0 else sleep 2
stdio:3:9:(3): error: alarm occurred
i7 : alarm 1; 1/0 ?? sleep 2
stdio:4:13:(3): error: alarm occurred |
That's interesting! |
I should have some time this week -- I'd like to get this figured out! It looks like it's just "key not found" errors. Also, I checked the 1.24.05 package in Debian unstable and this bug wasn't present. So this might be related to the changes from #3409... |
I think I figured it out! When keys aren't found, we call i1 : debug Core
i2 : code Thing.RobustPrintMethod
o2 = /usr/share/Macaulay2/Core/robust.m2:62:26-63:76: --source code:
Thing.RobustPrintMethod = (msg, obj) -> try toString stack { msg | ":",
horizontalJoin("\t", silentRobustNetWithClass(60, 5, 3, obj)) } else msg So I think the |
Ah that makes sense! Should alarm break through all try's or just one? I think probably one. Can we remove the |
Oh actually a simpler fix is to just remove |
Wait no this doesn't fix it. I think the inner |
Figured it out! timelimit := (t,f) -> (alarm t; r := f(); alarm 0; r) Maybe we should have some kind of |
Ah I hate alarm ... yes, that's certainly one possibility However, maybe for now a simpler solution is to check in |
The robust error message involves calling "alarm", which will cancel any alarms we might be trying to catch using "try" or ??. Closes: Macaulay2#3524
The robust error message involves calling "alarm", which will cancel any alarms we might be trying to catch using "try" or ??. Closes: #3524
Try this, taken from
tests/normal/alarm.m2
:After the first run we get:
But the second run never finishes.
I believe this is what's failing in #3517 and #3522 (removed commits: c07017e and 9b29e3d).
@d-torrance could you take a look?
The text was updated successfully, but these errors were encountered: