What could lead to the fact that the text segment in the static binary file will not be available for sharing?

I am trying to find unwanted dirty pages in small binaries on Linux x86. The entire binary is smaller than the 4k page (it compiled without glibc). On my laptop running under 2.6.32, the .text appears in /proc/$pid/smaps as Private_Clean: 4 and Private_Dirty: 0 , as expected, but on my server with 2.6.36, .text has Private_Dirty: 4 . Any idea what might trigger this? As far as I know, randomization of the address layout or the like does not work (I disabled all the related settings that I know of). Any idea what could pollute the .text program?

Edit:

 $ strace ~/em2 execve("/home/R/em2", ["/home/R/em2"], [/* 28 vars */]) = 0 nanosleep({100000, 0}, ^C <unfinished ...> 

And ..... now smaps shows .text as Private_Clean: 4 . This is very strange, because I actually have two different binaries compiled on different machines, which were and , showing an inexplicable dirty page when launched on my server, and now they are both clean. Sorry to spend all the time. If the problem does not return, I will close / delete this question or something suitable, since I can no longer reproduce it.

+4
source share
1 answer

The problem has been resolved: it is obvious that Linux has a β€œfunction” (I would call it an error), where the page displays as Private_Dirty if the binary was not uploaded to disk after it was created. That's why the problem mysteriously went away after a while.

+2
source

Source: https://habr.com/ru/post/1334711/


All Articles