Trying to understand why strace failed to attach to child

Florian Kelbert florian_kelbert at gmx.de
Tue May 20 16:52:33 UTC 2014



On 20.05.2014 16:36, Fiedler Roman wrote:
> Hello List,
>
> I'm using strace for quite a while, but today I got a quite unexpected
> result. Since this was so confusing, I would be glad about feedback, if the
> cause for that could be a) human error in operation of strace, b)
> misconception of the principles of syscall tracing, c) some strange
> interaction between 32bit kernel/binary on single-core CPU:
>
> The output:
>
> # strace -s256 -f /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
> ....
> setgroups32(1, [112])                   = 0
> setuid32(109)                           = 0
> setresgid32(-1, 112, -1)                = 0
> setresuid32(-1, 109, -1)                = 0
> clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
> child_tidptr=0xb6340768) = 30111
> exit_group(0)                           = ?
> +++ exited with 0 +++
>
>
> What was unexpected: strace failed to attach to the child. What is special
> about the traced process: due to an error, the child process performs just
> one open-syscall and exit after clone, the parent process performs an exit
> immediately after clone. Due to single-core CPU, it seems more likely, that
> the parent continues running after the fork before the child process gets
> any chance to do so.
>
> Question: Is my strace invocation syntax correct and should it capture the
> child system calls also? To my understanding, a tracee should be stopped as
> soon as strace is attached, also all children are stopped after clone. So
> there should be no way to miss any child?
>
> Kind regards,
> Roman
>
>
> PS: I'm using strace version:
> ii  strace                              4.8-1ubuntu5                  i386
> A system call tracer
>

It seems that the problem you describe has already been filed, discussed 
and fixed:
https://www.mail-archive.com/strace-devel@lists.sourceforge.net/msg03273.html

>
>
>
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
>
>
>
> _______________________________________________
> Strace-devel mailing list
> Strace-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel
>




More information about the Strace-devel mailing list