More JVM Signal tricks - Thread control via mprotect · Jackson Davis: "In my last post, I mentioned the JVM uses intentionally uses SIGSEGVS in other interesting ways. In this post I’ll give an overview of one of those other ways, synchronization for GC pauses.
If you ever look at generated assembly from Hotspot, you will find methods ending with very odd-looking tests like this:
test %eax,0x16e71fa4(%rip) # 0x00007fce84071000
At first glance, this doesn’t seem to serve any real purpose right before the return. Rather than doing any useful work, its just a way of trying to read from 0x7fce84071000, the designated polling page. Modifying access to this page lets the JVM stop threads cleanly - in places where the state of the world is well-known."
'via Blog this'
No comments:
Post a Comment