- Notifications
You must be signed in to change notification settings - Fork61
Improve jextract error reporting#40
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
👋 Welcome back jvernee! A progress list of the required criteria for merging this PR into |
mlbridgebot commentedMar 5, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Webrevs
|
| .collect(toMap(SaveError::code,Function.identity())); | ||
| publicstaticSaveErrorvalueOf(intcode) { | ||
| returnlookup.computeIfAbsent(code,k -> {thrownewNoSuchElementException("No SaveError with code: " +k); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do we need this computeIfAbsent with lambda? All we do is to throw exception always if key is not found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Map doesn't have agetOrThrow, butcomputeIfAbsent effectively works the same way. The alternative would beget plus null check.
src/jdk.incubator.jextract/share/classes/jdk/internal/clang/TranslationUnit.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/jdk.incubator.jextract/share/classes/jdk/internal/clang/LibClang.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
openjdkbot commentedMar 5, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@JornVernee This change now passes all automated pre-integration checks. When the change also fulfills allproject specific requirements, type
Since the source branch of this PR was last updated there have been 91 commits pushed to the ➡️ To integrate this PR with the above commit message, type |
JornVernee commentedMar 5, 2020
Wrt the crash recovery; It seems to work reliably on Windows, so I think we should at least turn it on there, since the alternative is having a jextract that crashes quite frequently on Windows (maybe 1 in 5 runs, depending on the header contents). |
slowhog left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks good, my only concern is the disable clang crash recovery default was disabled but now default to enable.
The past experience is that crash recovery cause JVM crash from time to time, so unless we are certain that situation changes and should be default to enable, perhaps we should just default to disable as before.
sundararajana commentedMar 6, 2020
I agree with Henry. It's better to restore the default but make it configurable via system property. Having different defaults on different platforms would be confusing to the user. Because it is configurable, we can try the config for debugging on any platform. |
…de in TranslationUnitSaveException
JornVernee commentedMar 6, 2020
I've uploaded another revision where I've change the default of crash recovery back to disabled, but kept the property. |
src/jdk.incubator.jextract/share/classes/jdk/internal/clang/LibClang.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
sundararajana left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks good!
JornVernee commentedMar 6, 2020
/integrate |
@JornVernee The following commits have been pushed to foreign-jextract since your change was applied:
Your commit was automatically rebased without conflicts. Pushed as commita03a4c5. |
Mailing list message fromJorn Vernee onpanama-dev: Changeset:a03a4c5 Improve jextract error reporting Reviewed-by: sundar + src/jdk.incubator.jextract/share/classes/jdk/internal/clang/ErrorCode.java |
Uh oh!
There was an error while loading.Please reload this page.
Hi,
I spent the last couple of days tracking down a crash I was seeing sometimes when running jextract. In the process I ended up doing several improvements to jextract's error checking and reporting, that I think are useful to keep in the long run.
The changes include:
clang_parseTranslationUnit2to parse, since that returns an error code, instead of a null translation unit. This also means we can still process diagnostic for the returned translation unit (now returned in a buffer).clang_parseTranslationUnit2,clang_saveTranslationUnit, andclang_reparseTranslationUnit(using a proper enum) and throwing an exception in case they are erroneous.Thanks,
Jorn
Progress
Reviewers
Download
$ git fetch https://git.openjdk.java.net/panama-foreign pull/40/head:pull/40$ git checkout pull/40