RFR: 8129446: crash when reporting corrupted classfile

Kim Barrett kim.barrett at oracle.com
Mon Jun 22 21:42:46 UTC 2015


On Jun 22, 2015, at 5:26 PM, Ioi Lam <ioi.lam at oracle.com> wrote:
> 
> 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 …..

The file name is not added to the info buffer.

info (sans filename) and the filename are passed as separate arguments to quit,
which calls vm_exit_during_initialization with those same two arguments, which
passes them along to vm_notify_during_shutdown, which prints them using
distinct calls to tty->print.  So making info large enough to hold a path doesn’t
have any benefit right now.




More information about the hotspot-runtime-dev mailing list