RFR: 8364360: Defining hidden class with no room in constant pool crashes the VM [v2]
Coleen Phillimore
coleenp at openjdk.org
Tue Oct 28 11:51:03 UTC 2025
On Mon, 27 Oct 2025 23:28:00 GMT, Chen Liang <liach at openjdk.org> wrote:
>> This is a magic number. 65536-5 gets CFE: class too large, 65536-7 doesn't get an CFE. Only 65536-6 caused the overflow. This is asm so asm may only be adding 6 entries. I kept the test as ASM rather than using ClassFile API because it might be good to backport this.
>
> If we have such a sensitive dependency on the CP size, we might consider opening up the `symbolTable.getConstantPoolCount()` on the `ClassWriter` for better testing, or use the ClassFile API that has a similar fine-grained control over constant pool sizes.
>
> I can help you update ASM or rewrite in ClassFile API if the Java code is too complex for you.
Let me try that ClassWriter method and see if that takes out the magic number.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27964#discussion_r2469239074
More information about the hotspot-runtime-dev
mailing list