c - fgets gets stuck into an infinite loop while reading /proc/PID/maps -


I / proc / from the file. Before reading i ptrace (PTRACE_ATTACH, & lt; PID & gt;) (hence, the process should be suspended).

Looks like this:

  while (fgets (line_buf, bufsiz, maps_fd)! = Null) {...}   

But this (endless loop) is not ending, I have done a printf line_buf and reading it reading lines already read it already.

Question: Can my map change the file? (If anything is changing it)

If the file does not change from anything else, then why is it fgets to read the previously read lines?

I do not find the reference yet, but it was a known bug / regression in some kernel versions. The problem is almost certain that you are running a small carriage kernel and need to replace it with less buggy if I find a link to the problem report, then I will add it.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -