Bug 663860 - syscall.fork.return never sees $return == 0
Summary: syscall.fork.return never sees $return == 0
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: systemtap
Version: 13
Hardware: x86_64
OS: Linux
low
low
Target Milestone: ---
Assignee: Frank Ch. Eigler
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-12-17 04:27 UTC by Jan Kratochvil
Modified: 2010-12-23 21:28 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-12-23 21:28:16 UTC
Type: ---


Attachments (Terms of Use)
fork.stp (461 bytes, text/plain)
2010-12-17 04:27 UTC, Jan Kratochvil
no flags Details
fork.c (100 bytes, text/plain)
2010-12-17 04:28 UTC, Jan Kratochvil
no flags Details

Description Jan Kratochvil 2010-12-17 04:27:13 UTC
Created attachment 469284 [details]
fork.stp

Description of problem:
Tried to create an `strace -f' systemtap variant but I cannot.

Version-Release number of selected component (if applicable):
systemtap-1.3-3.fc13.x86_64
kernel-2.6.35.6-48.fc14.x86_64

How reproducible:
Always.

Steps to Reproduce:
gcc -o /tmp/fork /tmp/fork.c -Wall -g
stap /tmp/fork.stp -c /tmp/fork

Actual results:
<nothing>

Expected results:
NEVER HIT

Additional info:

Comment 1 Jan Kratochvil 2010-12-17 04:28:00 UTC
Component typo, sorry.

Comment 2 Jan Kratochvil 2010-12-17 04:28:37 UTC
Created attachment 469285 [details]
fork.c

Comment 3 Josh Stone 2010-12-17 22:09:28 UTC
Process forking at the kernel level doesn't have the same dual-return semantics that the userspace sees.  However, all newly-forked threads go through schedule_tail on their way back to userspace, so that may be a better probe for you.  There's even a "kprocess.start" probepoint already defined in the tapsets for this purpose.

Also be aware that our syscall.fork is on the kernel's do_fork function, which 
covers vfork and clone too.  So if you only want new processes, and not threads, you may need to do some filtering on the flags.

Comment 4 Jan Kratochvil 2010-12-23 21:28:16 UTC
Thanks, it really works.  Not sure if systemtap should not emulate the userland visible behavior but the functionality is there.


Note You need to log in before you can comment on or make changes to this bug.