build crash after extending oopDesc
John Rose
john.r.rose at oracle.com
Sat Jun 9 00:37:08 PDT 2012
On Jun 8, 2012, at 11:51 AM, Krystal Mok wrote:
> David,
>
> If this patch [1] resembles your change, then what I saw was that the VM would build all right, but would fail running test_gamma right at the end of the build process.
>
> The problem was caused by arrayOopDesc::length_offset_in_bytes(), as noted [2]. test_gamma runs fine if I drop a .hotspotrc file specifying -UseCompressedOops in it, which confirms the problem.
Good analysis, Kris.
What happens if you add the extraneous field after the _mark field? I think that would be more robust, although there is still likely to be a bug tail.
Here's an old war-story: When the original Hotspot team brought their prototype to Sun long ago, I was on the technical evaluation team. One of my tests was to inject an extra field into class oopDesc. (Specifically, the field held a string representation of the thread backtrace at the point of the object's allocation. A crude allocation profiler!) The system worked with a few edits and no further adjustment. This demonstrated to me that the software architecture was robust and ready to evolve.
(Things are different now. The system is more than 10x larger. It contains multiple platform ports, two good JITs, instrumentation, several GCs, and compressed pointers, none of which the prototype had. I wish our system were still as malleable as it was when it was young, but it's a different engineering problem today.)
— John
diff --git a/src/share/vm/oops/oop.hpp b/src/share/vm/oops/oop.hpp
--- a/src/share/vm/oops/oop.hpp
+++ b/src/share/vm/oops/oop.hpp
@@ -62,6 +62,7 @@
friend class VMStructs;
private:
volatile markOop _mark;
+ intptr_t _extraneous;
union _metadata {
wideKlassOop _klass;
narrowOop _compressed_klass;
More information about the hotspot-dev
mailing list