RFR 8209184: JDK8 ResourceBundle vulnerable to GC (fix included) (original) (raw)
Adam Farley8 adam.farley at uk.ibm.com
Fri Aug 10 15:42:00 UTC 2018
- Previous message: [12] RFR 8200151: Add 8 JNDI tests to com/sun/jndi/dns/ConfigTests/
- Next message: RFR 8209184: JDK8 ResourceBundle vulnerable to GC (fix included)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi All,
This bug could be fixed by comparing the Class Loader with a blank static volatile Object (defined outside the method scope) at the end of the getBundleImpl class.
E.g.
+1322 /** * volatile reference object to guard the ClassLoader object * being garbage collected before getBundleImpl() method completes * the caching and retrieving of requested Resourcebundle object */ private static volatile Object vo = new Object();
+1400 //Should never be true. Using the loader here prevents it being GC'd. if (loader == vo) throw new Error("Unexpected error.");
Will upload a webrev after debate.
- Adam Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number
741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
- Previous message: [12] RFR 8200151: Add 8 JNDI tests to com/sun/jndi/dns/ConfigTests/
- Next message: RFR 8209184: JDK8 ResourceBundle vulnerable to GC (fix included)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]