-
Notifications
You must be signed in to change notification settings - Fork 54
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
Log all errors caught in the frontend at debug level #1618
base: main
Are you sure you want to change the base?
Conversation
b8913b1
to
8298654
Compare
8298654
to
4f2e240
Compare
All the exceptions are caught in the exception handler added before the thread is started:
These are then handled in a helper method
If there is an exception other than |
Regarding stainless/frontends/dotty/src/main/scala/stainless/frontends/dotc/DottyCompiler.scala Lines 142 to 143 in 4f2e240
stainless/frontends/dotty/src/main/scala/stainless/frontends/dotc/DottyCompiler.scala Line 175 in 4f2e240
|
@mbovel can you rebase? |
While trying to debug my modifications to the frontend, I found that some exceptions are swallowed. This makes it very hard to debug the frontend.
I found that this is due to the way errors are handled in
ThreadedFrontend
.cc @mario-bucev and @samuelchassot: this is the problem I had this afternoon.
Background
Callback.failed
.onRun
method.Callback.failed
is now a no-op.Current semantic and questions
Frontend.onEnd
runs even if exceptions are thrown duringFrontend.onRun
. Is that excepted? I guess this might be to allowFrontend.onEnd
to recover from some errors?If an exception is thrown in
Frontend.onEnd
, it swallows any exception thrown inFrontend.onRun
. Here is a minimal reproduction:Is this expected? I think the first exception should at least be logged in debug mode. Should it also be rethrown?
The first exception which is not
UnsupportedCodeException
thrown duringFrontend.onEnd
, or duringFrontend.onRun
is rethrown without being reported as an error, it is only logged at the debug level. Why areUnsupportedCodeException
s handled differently?UnsupportedCodeException
which are thrown before the first non-UnsupportedCodeException
exception are reported as errors. The others are ignored. This seems weird. Seedef rethrow
.Proposed changes
This PR enables logging all exceptions thrown in the frontend, at debug level.
It doesn't make any other changes. In particular, the semantic described above is preserved.
Depending on the answers to my questions above, further changes might be needed.