-
Notifications
You must be signed in to change notification settings - Fork 42
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
crucible-jvm: Investigate bugs when verifying JDK 9+ code that uses String #641
Comments
This adds basic functionality for `crucible-jvm` to deal with JDK 9 or later, which packages its standard library not in a JAR file, but in a JIMAGE file. Extracting `.class` files from JIMAGE files proves to be surprisingly tricky, and I've carefully documented the intricacies of doing so in `Note [Loading classes from JIMAGE files]` in `Lang.JVM.Codebase`. This is part of a fix for GaloisInc/saw-script#861. In general, support for JDK 9 or later is still experimental, as there are still unresolved bugs to diagnose. See #641.
This adds basic functionality for `crucible-jvm` to deal with JDK 9 or later, which packages its standard library not in a JAR file, but in a JIMAGE file. Extracting `.class` files from JIMAGE files proves to be surprisingly tricky, and I've carefully documented the intricacies of doing so in `Note [Loading classes from JIMAGE files]` in `Lang.JVM.Codebase`. This is part of a fix for GaloisInc/saw-script#861. In general, support for JDK 9 or later is still experimental, as there are still unresolved bugs to diagnose. See #641.
This bumps the `crucible` submodule to include GaloisInc/crucible#638, which adds basic support for handling JDK 9 or later. JDK 9+ packages its standard library not in a JAR file, but in a JIMAGE file. For more details on how `crucible-jvm` handles JIMAGE files, refer to `Note [Loading classes from JIMAGE files]` in `Lang.JVM.Codebase`. This fixes #861, although there are still unsolved issues that arise when using modern JDKs with certain classes, such as `String`. As a result, I have decided to label support for JDK 9+ as experimental: * I have updated the SAW documentation to mention these shortcomings. * I have opened GaloisInc/crucible#641 to track the remaining issues. Other things: * GaloisInc/crucible#636 and GaloisInc/crucible#638 upstreamed the code from `SAWScript.JavaTools` and `SAWScript.ProcessUtils` into `crucible-jvm`, so we can remove these modules in favor of importing `Lang.JVM.JavaTools` and `Lang.JVM.ProcessUtils` from `crucible-jvm`. * I removed the dependency on the `xdg-basedir`, as it was unused. This dependency was likely added quite some time ago, and it appears that `saw-script` switched over to using XDG-related functionality from the `directory` library since then. I opted to use `directory` to find the `.cache` directory as well, so I have made that clear in the `.cabal` file. * The `biJavaCodebase :: Codebase` field of `BuiltinContext` is completely unused, which I noticed when making changes to the `Codebase` type. Let's just remove it.
This bumps the `crucible` submodule to include GaloisInc/crucible#638, which adds basic support for handling JDK 9 or later. JDK 9+ packages its standard library not in a JAR file, but in a JIMAGE file. For more details on how `crucible-jvm` handles JIMAGE files, refer to `Note [Loading classes from JIMAGE files]` in `Lang.JVM.Codebase`. This fixes #861, although there are still unsolved issues that arise when using modern JDKs with certain classes, such as `String`. As a result, I have decided to label support for JDK 9+ as experimental: * I have updated the SAW documentation to mention these shortcomings. * I have opened GaloisInc/crucible#641 to track the remaining issues. Other things: * GaloisInc/crucible#636 and GaloisInc/crucible#638 upstreamed the code from `SAWScript.JavaTools` and `SAWScript.ProcessUtils` into `crucible-jvm`, so we can remove these modules in favor of importing `Lang.JVM.JavaTools` and `Lang.JVM.ProcessUtils` from `crucible-jvm`. * I removed the dependency on the `xdg-basedir`, as it was unused. This dependency was likely added quite some time ago, and it appears that `saw-script` switched over to using XDG-related functionality from the `directory` library since then. I opted to use `directory` to find the `.cache` directory as well, so I have made that clear in the `.cabal` file. * The `biJavaCodebase :: Codebase` field of `BuiltinContext` is completely unused, which I noticed when making changes to the `Codebase` type. Let's just remove it.
Just a note to say that we bumped up against this today. |
Indeed, this is a pretty notable limitation of |
Thanks! The same issue is encountered in (my installation of) OpenJDK 8 unless specifying |
Hm, I am surprised to hear that this happens even with OpenJDK 8. Just to be sure, are you putting OpenJDK 8 first on your |
Aha. I did not modify
|
Right, the |
There are still some yet-to-be-diagnosed issues with using
crucible-jvm
in tandem with JDK 9 or later. I'll copy-paste a relevant excerpt from GaloisInc/saw-script#861 (comment), which describes the challenge:The text was updated successfully, but these errors were encountered: