eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.27k stars 721 forks source link

Runtime GC map checking? #8865

Open 0xdaryl opened 4 years ago

0xdaryl commented 4 years ago

While implementing another feature I stumbled upon a couple of features (presumably related to each other) implemented on x86 only: 1) RTGCMapCheck (enabled via the rtGCMapCheck option) and 2) dead slot poisoning (enabled via the deadSlotPoisoning option). The first presumably does a GC map verification at runtime. It looks to trigger a stack walk at async check points, inspects the I-slots on the stack, and then aborts if one of the slots looks like a heap reference. The second (I think) tries to improve the effectiveness of 1) by storing a poison value in reference slots as they go dead to avoid false positives (just a guess without exploring too deeply). Actually, this second feature seems to be implemented in common code.

Both sound vaguely familiar, and a bit of archaeology found they were introduced in 2010. Has anyone been using these since?

I'm proposing removing this code. If it has been in the codebase for 10 years and no one either knows of its existence nor ever felt the need to implement something with similar functionality in order to diagnose a problem in the time since then I feel this is technical debt we don't need. I'm not sure if this code even still works, nor convinced that this approach is likely to catch many bugs.

Any opinions? @andrewcraik @fjeremic @gita-omr @JamesKingdon @klangman @gacholio

JBKingdon commented 4 years ago

Hi Daryl,

These aren't features I've used although I remember Kevin talking about them. Problems with bad object references are a significant fraction of our workload, and are extremely difficult to solve. I think it would be really useful to identify what the limitations of these features were and find a way of providing more capable diagnosis tooling for this class of problems. Early detection is the key to being able to find the root cause.

fjeremic commented 4 years ago

@PushkarBettadpur could any of these be useful for your GC related work as well?

gacholio commented 4 years ago

GC map problems were the bane of the JIT in the early days, but the only way this feature is useful is if the maps are computed in two different (but equally correct) ways - verifying the output of an algorithm using the same algorithm can't really provide any new information.

PushkarBettadpur commented 4 years ago

@PushkarBettadpur could any of these be useful for your GC related work as well?

Given this specific use case, I wouldn't necessarily think so. At least at this point in time.