Chen Jingpiao's GSoC status report - #1 of #13

Masatake YAMATO yamato at redhat.com
Mon May 21 18:56:10 UTC 2018


Hi,

I tried on my Fedora 28 system but it was not reproduced here.

    [yamato at master]/tmp/x/strace% ./strace -eclone ./a.out 
    ./strace -eclone ./a.out 
    clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f598063d790) = 23793
    23793
    +++ exited with 0 +++
    
I wonder what happens if you don't use strace like?

    $ gcc fork.c
    $ ./a.out
    ???
    
I also wonder what happens if you remove the 'fprintf' statement from fork.c.


Masatake YAMATO

> Reproduce the fault:
> $ git remote add ppiao https://github.com/ppiao/strace.git
> $ git fetch ppiao ppiao/next:ppiao/next
> $ git checkout ppiao/next
> $ ./bootstrap && ./configure && make
> $ ./strace -eopen ls >/dev/null # work properly
> 
> /* fork.c */
> #include <stdio.h>
> #include <unistd.h>
> 
> int main(void)
> {
> int pid = fork();
> 
> fprintf(stderr, "%d\n", pid);
> 
> return 0;
> }
> 
> $ gcc fork.c
> $ ./strace -eclone ./a.out # the child process does not return
> $ dmesg
> [ 4648.471410] traps: a.out[31678] general protection
> ip:7fed4d16e100 sp:7fff286159e8 error:0 in libc-2.19.so[7fed4d0a9000+1be000]
> 
> Thank you!


More information about the Strace-devel mailing list