goblint / analyzer

Static analysis framework for C
https://goblint.in.tum.de
MIT License
160 stars 72 forks source link

Fix catch-all exception handlers #1435

Closed sim642 closed 1 month ago

sim642 commented 2 months ago

This is an attempt to fix https://github.com/goblint/analyzer/issues/1420#issuecomment-2076884301.

@michael-schwarz You may want to try out of this helps with #1420.

michael-schwarz commented 2 months ago

Thanks, I'll give it a try today. I just wasted 19h of CPU time on our server because of this issue again.

michael-schwarz commented 2 months ago

It worked at least on my machine, I'll give it another try on the server once it's done running benchmarks.

sim642 commented 2 months ago

I made my best to avoid catching Timeout.Timeout (for #1420) and Sys.Break (for #1221) anywhere, among some other exceptions that really shouldn't be swallowed like that. Whether it remedies both issues is yet to be seen, but this is an improvement either way.

I also made the timeout timer more robust: it will keep resending the signal every second. So even if execution happens to be inside a catch-all exception handler at any point (in the future), then there will be more opportunities for the special exception. Currently, if it's swallowed once, it will never come again.

michael-schwarz commented 2 months ago

The state as of a35dc82 does not fix the issue on our server. I'll try again with the new commits added.