Bug 300901

Summary: Systemtap translator's missing deref_fault labels
Product: [Fedora] Fedora Reporter: Jan Kratochvil <jan.kratochvil>
Component: systemtapAssignee: Frank Ch. Eigler <fche>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: wcohen
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-09-25 03:04:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Kratochvil 2007-09-21 17:58:07 UTC
Description of problem:
Just tried to trace wait4(2) but with no luck.

Version-Release number of selected component (if applicable):
systemtap-0.5.14-1.fc8.x86_64
kernel-2.6.23-0.189.rc6.git8.fc8.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. echo 'probe syscall.wait4 {}' >./wait4.stp;stap -u ./wait4.stp

Actual results:
Pass 4: compilation failed.  Try again with more '-v' (verbose) options.

Expected results:
Started tracing.

Additional info:
/tmp/stapq4rMQR/stap_....c: In function 'function__struct_timeval':
/tmp/stapq4rMQR/stap_....c:1382: error: label 'deref_fault' used but not defined 
/tmp/stapq4rMQR/stap_....c: In function 'function__struct_timespec':
/tmp/stapq4rMQR/stap_....c:1568: error: label 'deref_fault' used but not defined 
cc1: warnings being treated as errors
/tmp/stapq4rMQR/stap_....c: In function 'function__struct_itimerval':
/tmp/stapq4rMQR/stap_....c:1686: warning: initialization from incompatible
pointer type
/tmp/stapq4rMQR/stap_....c:1692: error: label 'deref_fault' used but not defined

Comment 1 William Cohen 2007-09-21 18:52:07 UTC
The actual problem is a orthogonal to the instrumentation of the syscall.wait4.
You should be able to run without the "-u" option:

echo 'probe syscall.wait4 {}' >./wait4.stp;stap ./wait4.stp


The "-u" option for systemtap avoids optimizing out code, so all generated code
is left in. The kread macro in systemtap_write/src/runtime/loc2c-runtime.h uses
the macro deref, which refers to macro DEREF_FAULT which has the offending
reference to the label deref_fault.  The translator is not including the needed
labels in the generated functions.





Comment 2 Frank Ch. Eigler 2007-09-24 13:34:15 UTC
The problem is that several embedded-C functions use kread() but
do not have the necessary CATCH_DEREF_FAULT at the bottom.  Real bug.

Comment 3 Frank Ch. Eigler 2007-09-25 03:04:33 UTC
fixed.