Skip to content
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

[core] Error recovery mode #2885

Closed
oowekyala opened this issue Oct 29, 2020 · 2 comments
Closed

[core] Error recovery mode #2885

oowekyala opened this issue Oct 29, 2020 · 2 comments
Assignees
Labels
an:enhancement An improvement on existing features / rules
Milestone

Comments

@oowekyala
Copy link
Member

It's probably not a super good idea to recover from StackOverflowErrors in all cases (#2808). Possibly, we could be leaving some external library in an inconsistent state. However, for a developer of PMD, it may be useful to do so, so that the error ends up in a report, or so that more errors can be discovered by continuing the run.

So we could have a "debug" mode that tries to be more error tolerant, but which is not the default behavior. This could be used in tests, and in particular, for the regression tester. This could also be useful for bug reports ("run pmd with these options and paste the report").

As a first step we could enable such a "debug" mode with a system property (PMD_JAVA_OPTS=”-Derror_recovery -ea” run.sh ...).

If it's worth it we could also add a CLI switch for that, eg -Xerror_recovery. Other obscure system properties we use to enable advanced logging (like the Java type inference logger) could be added as switches too.

@oowekyala oowekyala added the an:enhancement An improvement on existing features / rules label Oct 29, 2020
@adangel adangel added this to the 7.0.0 milestone Oct 30, 2020
@adangel
Copy link
Member

adangel commented Oct 30, 2020

As background info: https://stackoverflow.com/questions/28551767/is-it-safe-to-catch-stackoverflowerror-in-java

It just depends, where exactly the SOE occurs: If it is inside a JDK API, then it depends on the concrete VM implementation, whether we can recover. So, we should not have this as the default mode.

@adangel adangel self-assigned this Nov 5, 2020
@adangel adangel changed the title Error recovery mode [core] Error recovery mode Nov 5, 2020
@adangel
Copy link
Member

adangel commented Nov 25, 2020

Ok, the PR is merged in pmd/7.0.x and the new pmd-regression-tester is activated on master + pmd/7.0.x.

@adangel adangel closed this as completed Nov 25, 2020
@adangel adangel mentioned this issue Jan 23, 2023
55 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
an:enhancement An improvement on existing features / rules
Projects
None yet
Development

No branches or pull requests

2 participants