Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There's one silly mistake in this code:</p> <pre><code>const char * path = "/proc/self/mem"; ... snprintf(child_path, 0x20, "/proc/%d/mem", child_pid); printf("PARENT: child_path: %s\n", child_path); child_mem_fd = open(path, O_RDONLY); </code></pre> <p>So you always end up reading parent's memory here. However after changing this, I get:</p> <pre><code>CHILD: child_mem_fd: 4 CHILD: new value 53 read (parent): No such process </code></pre> <p>And I don't know why it could happen - maybe <code>/proc</code> is too slow in refreshing the entries? (it's from <code>perror("read")</code> in the parent - had to add a comment to see which one fails) But that seems weird, since the <code>seek</code> worked - as well as <code>open</code> itself.</p> <p>That question doesn't seem to be new either: <a href="http://lkml.indiana.edu/hypermail/linux/kernel/0007.1/0939.html" rel="nofollow">http://lkml.indiana.edu/hypermail/linux/kernel/0007.1/0939.html</a> (ESRCH is "no such process")</p> <p>Actually a better link is: <a href="http://www.webservertalk.com/archive242-2004-7-295131.html" rel="nofollow">http://www.webservertalk.com/archive242-2004-7-295131.html</a> - there was an issue with marking processes pthread-attach-safe. You can find there Alan Cox sending someone to Solar Designer... for me that spells "here be dragons" and that it's not solvable if you don't hack kernels in your sleep :(</p> <p>Maybe it's enough for you to check what is gdb doing in that case and replicating it? (Probably it just goes via <code>ptrace(PTRACE_PEEKDATA,...)</code>)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload