RFR: 8129446: crash when reporting corrupted classfile

Ioi Lam ioi.lam at oracle.com
Mon Jun 22 21:26:52 UTC 2015


Since a file name may be passed, how about changing the array size to

  346 void HashtableTextDump::corrupted(const char *p, const char* msg) {
  347   char info[JVM_MAXPATHLEN + 100];
  348   jio_snprintf(info, sizeof(info),
  349                "%s. Corrupted at line %d (file pos %d)",
  350                msg, _line_no, (int)(p - _base));
  351   quit(info, _filename);
  352 }

The function is called soon before the VM exits, and it's call with a 
fairly low number of C call frames when dumping the CDS archive, so 
having a relatively large stack variable shouldn't really hurt .....

- Ioi


On 6/22/15 1:25 PM, Kim Barrett wrote:
> Please review this fix to a recent change in the construction of an
> error message.  We enlarge the buffer for message construction to fit
> known messages, and also now use jio_snprintf to ensure we don't
> overrun the enlarged buffer.
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8129446
>
> Webrev:
> http://cr.openjdk.java.net/~kbarrett/8129446/webrev.01/
>
> Testing:
> jprt, local jtreg
>



More information about the hotspot-runtime-dev mailing list