On Wed, 17 Feb 2021 06:46:27 GMT, Yasumasa Suenaga <[email protected]> wrote:

> Linux kernel seems to separate final segment (0xbc78) into RO and RW segments 
> when it attempts to load shared library. (but I'm not sure)

I know I've seen this brought up before, if not with SA then with hotspot 
itself. Maybe it was CDS or NMT. Or maybe it has something to do with how 
hotspot generates core dumps (I seem to recall there are some bits you can set 
somewhere that determine what does or does not get dumped to the core).

In any case, I think the main issue it causes for you is that your rounding up 
the size of the last (4th) segment may not enough. I think in most cases you 
would need to round it up to a page boundary, and then add another page to it. 
Consider a page as 4k and let's say the segment size is 2k, but it is split 
into two 1k segments. Each of those segment would take one page, so a total of 
8k. But if you round 2k up to a page boundary you only get to 4k. You need to 
add another page to that. I think the only time you don't want to add an extra 
page to the size is if one of the segment's size was already page aligned. 
However, you have know way of knowing if that will be the case, unless you can 
determine the RO and RW sizes of the segment.

> But they makes big change to SA.
As an option, we can integrate this change at first, then we will refactor them.
What do you think?

Whatever works for you. I'm actually not too concerned about getting this 
right, because with my PointerFinder workaround I don't think this issue with 
the map sizes has much impact on SA. Probably the only place it will show up is 
with SA pmap output.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2563

Reply via email to