From daniel.smith at oracle.com Fri Nov 8 21:04:51 2019 From: daniel.smith at oracle.com (Dan Smith) Date: Fri, 8 Nov 2019 14:04:51 -0700 Subject: Class validation cleanups Message-ID: <5AB35A30-E754-4C90-AB56-3AAF206CC23B@oracle.com> I've put together some JVMS change proposals to improve its specification of the class validation process, including class loading, format checking, and verification. These are independent of Valhalla, but lay the groundwork for additional changes to the spec. They address things like: - How are and methods constrained? - Can array types be field/method receiver types? (Yes, it turns out.) - When do we enforce the 'final' modifier on classes/methods? - Which attributes are validated, and when? - How does class loading handle anomalous situations? For format checking refinements: https://bugs.openjdk.java.net/browse/JDK-8233854 http://cr.openjdk.java.net/~dlsmith/class-validation/class-validation-20191107/specs/format-checking-jvms.html For class loading cleanup: https://bugs.openjdk.java.net/browse/JDK-8233861 http://cr.openjdk.java.net/~dlsmith/class-validation/class-validation-20191107/specs/class-loading-jvms.html For attribute validation: https://bugs.openjdk.java.net/browse/JDK-8233863 http://cr.openjdk.java.net/~dlsmith/class-validation/class-validation-20191107/specs/attribute-validation-jvms.html The last is the most disruptive, since we're proposing simply ignoring some attribute contents that has traditionally been parsed and validated. I think it may be reasonable to create a JEP for that piece. From harold.seigel at oracle.com Wed Nov 13 19:36:05 2019 From: harold.seigel at oracle.com (Harold Seigel) Date: Wed, 13 Nov 2019 14:36:05 -0500 Subject: Class validation cleanups In-Reply-To: <5AB35A30-E754-4C90-AB56-3AAF206CC23B@oracle.com> References: <5AB35A30-E754-4C90-AB56-3AAF206CC23B@oracle.com> Message-ID: <75ec6e33-0c97-4f56-f7e8-97ea583b6493@oracle.com> Hi Dan, Do you expect these spec modifications to require changes in both the old and new verifiers? Thanks, Harold On 11/8/2019 4:04 PM, Dan Smith wrote: > I've put together some JVMS change proposals to improve its specification of the class validation process, including class loading, format checking, and verification. > > These are independent of Valhalla, but lay the groundwork for additional changes to the spec. They address things like: > > - How are and methods constrained? > - Can array types be field/method receiver types? (Yes, it turns out.) > - When do we enforce the 'final' modifier on classes/methods? > - Which attributes are validated, and when? > - How does class loading handle anomalous situations? > > For format checking refinements: > https://bugs.openjdk.java.net/browse/JDK-8233854 > http://cr.openjdk.java.net/~dlsmith/class-validation/class-validation-20191107/specs/format-checking-jvms.html > > For class loading cleanup: > https://bugs.openjdk.java.net/browse/JDK-8233861 > http://cr.openjdk.java.net/~dlsmith/class-validation/class-validation-20191107/specs/class-loading-jvms.html > > For attribute validation: > https://bugs.openjdk.java.net/browse/JDK-8233863 > http://cr.openjdk.java.net/~dlsmith/class-validation/class-validation-20191107/specs/attribute-validation-jvms.html > > The last is the most disruptive, since we're proposing simply ignoring some attribute contents that has traditionally been parsed and validated. I think it may be reasonable to create a JEP for that piece. From harold.seigel at oracle.com Wed Nov 13 21:22:21 2019 From: harold.seigel at oracle.com (Harold Seigel) Date: Wed, 13 Nov 2019 16:22:21 -0500 Subject: Class validation cleanups In-Reply-To: <75ec6e33-0c97-4f56-f7e8-97ea583b6493@oracle.com> References: <5AB35A30-E754-4C90-AB56-3AAF206CC23B@oracle.com> <75ec6e33-0c97-4f56-f7e8-97ea583b6493@oracle.com> Message-ID: <8d278949-7021-f6ec-2b55-e01198f2ebe4@oracle.com> It looks like both verifiers will be affected.? For example, both verifiers parse method exception_tables and currently throw ClassFormatError. On 11/13/2019 2:36 PM, Harold Seigel wrote: > Hi Dan, > > Do you expect these spec modifications to require changes in both the > old and new verifiers? > > Thanks, Harold > > On 11/8/2019 4:04 PM, Dan Smith wrote: >> I've put together some JVMS change proposals to improve its >> specification of the class validation process, including class >> loading, format checking, and verification. >> >> These are independent of Valhalla, but lay the groundwork for >> additional changes to the spec. They address things like: >> >> - How are and methods constrained? >> - Can array types be field/method receiver types? (Yes, it turns out.) >> - When do we enforce the 'final' modifier on classes/methods? >> - Which attributes are validated, and when? >> - How does class loading handle anomalous situations? >> >> For format checking refinements: >> https://bugs.openjdk.java.net/browse/JDK-8233854 >> http://cr.openjdk.java.net/~dlsmith/class-validation/class-validation-20191107/specs/format-checking-jvms.html >> >> >> For class loading cleanup: >> https://bugs.openjdk.java.net/browse/JDK-8233861 >> http://cr.openjdk.java.net/~dlsmith/class-validation/class-validation-20191107/specs/class-loading-jvms.html >> >> >> For attribute validation: >> https://bugs.openjdk.java.net/browse/JDK-8233863 >> http://cr.openjdk.java.net/~dlsmith/class-validation/class-validation-20191107/specs/attribute-validation-jvms.html >> >> >> The last is the most disruptive, since we're proposing simply >> ignoring some attribute contents that has traditionally been parsed >> and validated. I think it may be reasonable to create a JEP for that >> piece.