Not logged in
Log in now
Create an account
Subscribe to LWN
Pencil, Pencil, and Pencil
Dividing the Linux desktop
LWN.net Weekly Edition for June 13, 2013
A report from pgCon 2013
Little things that matter in language design
What about the bug with the JVM default stack size and 64KB pages then?
Any hints, resolution, implications?
By the way, very nice article. Thank you very much!
JVM default stack size and 64KB base pages
Posted Jun 23, 2006 20:24 UTC (Fri) by vaurora (guest, #38407)
An unnamed large systems company decided to implement 64KB base pages in its OS. Everything looked dandy and great, except that for some reason nothing would work under Java. A closer look revealed that the default stack size of each thread in the JVM was set to 2*PAGESIZE... and the maximum stack size was 128KB. So threads would be created with 128KB stacks, immediately trigger a stack overflow, and die. This clearly is a bug and an abuse of PAGESIZE. However, given said company's fanatical devotion to strict binary compatibility above all else, it was decided that 64KB base page size could not be shipped because it would not work with that version of the JVM. This was an unpopular decision; it's possible it's been reversed since then.
The moral of the story is either "Strict binary compatibility is bad" or "Use transparent large pages and keep your base page size the same" or possibly "Computers are hard, let's go shopping!" (as Operating Systems Barbie is wont to say).
Other versions of this story probably exist for other OS's trying out larger base page sizes which undoubtably found the same bug; I don't know how they decided to handle the problem. But I'd love to hear the story!
Posted Jun 23, 2006 21:37 UTC (Fri) by opalmirror (subscriber, #23465)
Posted Jun 24, 2006 11:52 UTC (Sat) by nix (subscriber, #2304)
Or were they doing something like
if (PAGESIZE > 16384)
... size stack to 2*PAGESIZE ...
... size it to something sane ...
If so, well, *ick*.
Posted Aug 4, 2006 0:23 UTC (Fri) by tpepper (guest, #31353)
At any rate they figured out how to work around it with an LD_PRELOAD option for their existing code pending an update.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds