Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 95299258dbdf9a86cefd89b97c0d81e5 > files > 99

systemtap-1.2-1.fc13.i686.rpm

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 5. Understanding SystemTap Errors</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css" /><meta name="generator" content="publican 1.6" /><meta name="package" content="Systemtap-SystemTap_Beginners_Guide-1.0-en-US-2.0-2" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="futexcontentionsect.html" title="4.4. Identifying Contended User-Space Locks" /><link rel="next" href="runtimeerror.html" title="5.2. Run Time Errors and Warnings" /></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site" /></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site" /></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="futexcontentionsect.html"><strong>Prev</strong></a></li><li class="next"><a accesskey="n" href="runtimeerror.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="chapter" title="Chapter 5. Understanding SystemTap Errors" lang="en-US"><div class="titlepage"><div><div><h2 class="title" id="errors">Chapter 5. Understanding SystemTap Errors</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="errors.html#parsetype">5.1. Parse and Semantic Errors</a></span></dt><dt><span class="section"><a href="runtimeerror.html">5.2. Run Time Errors and Warnings</a></span></dt></dl></div><div class="para">
		This chapter explains the most common errors you may encounter while using SystemTap.
	</div><div class="section" title="5.1. Parse and Semantic Errors"><div class="titlepage"><div><div><h2 class="title" id="parsetype">5.1. Parse and Semantic Errors</h2></div></div></div><a id="id2756737" class="indexterm"></a><a id="id3033154" class="indexterm"></a><a id="id2942586" class="indexterm"></a><div class="para">
			These types of errors occur while SystemTap attempts to parse and translate the script into C, prior to being converted into a kernel module. For example type errors result from operations that assign invalid values to variables or arrays.
		</div><div class="formalpara"><h5 class="formalpara" id="id2939242">parse error: expected <em class="replaceable"><code>foo</code></em>, saw <em class="replaceable"><code>bar</code></em></h5><a id="id2824839" class="indexterm"></a><a id="id2869823" class="indexterm"></a><a id="id4354313" class="indexterm"></a><a id="id3042555" class="indexterm"></a><a id="id2871774" class="indexterm"></a><a id="id2758956" class="indexterm"></a><a id="id3424392" class="indexterm"></a><a id="id3099156" class="indexterm"></a><a id="id2880351" class="indexterm"></a>
				The script contains a grammatical/typographical error. SystemTap detected type of construct that is incorrect, given the context of the probe.
			</div><div class="para">
			The following invalid SystemTap script is missing its probe handlers:
		</div><div class="para">
			
<pre class="programlisting">
probe vfs.read
probe vfs.write

</pre>
		</div><div class="para">
			It results in the following error message showing that the parser was expecting something other than the <code class="command">probe</code> keyword in column 1 of line 2:
		</div><div class="para">
			
<pre class="programlisting">
parse error: expected one of '. , ( ? ! { = +='
	saw: keyword at perror.stp:2:1
1 parse error(s).
</pre>
		</div><div class="formalpara"><h5 class="formalpara" id="id2753059">parse error: embedded code in unprivileged script</h5><a id="id2753069" class="indexterm"></a><a id="id2753084" class="indexterm"></a><a id="id3422912" class="indexterm"></a><a id="id3422928" class="indexterm"></a><a id="id2904373" class="indexterm"></a><a id="id2904389" class="indexterm"></a>
				The script contains unsafe embedded C code (blocks of code surrounded by <code class="command">%{</code> <code class="command">%}</code>. SystemTap allows you to embed C code in a script, which is useful if there are no tapsets to suit your purposes. However, embedded C constructs are not be safe; as such, SystemTap warns you with this error if such constructs appear in the script.
			</div><a id="id2887099" class="indexterm"></a><a id="id2985791" class="indexterm"></a><a id="id2985807" class="indexterm"></a><a id="id2985822" class="indexterm"></a><div class="para">
			If you are sure of the safety of any similar constructs in the script <span class="emphasis"><em>and</em></span> are member of <code class="command">stapdev</code> group (or have root privileges), run the script in "guru" mode by using the option <code class="command">-g</code> (i.e. <code class="command">stap -g <em class="replaceable"><code>script</code></em></code>).
		</div><div class="formalpara"><h5 class="formalpara" id="id3082491">semantic error: type mismatch for identifier '<em class="replaceable"><code>foo</code></em>' ... string vs. long</h5><a id="id3082505" class="indexterm"></a><a id="id3082521" class="indexterm"></a><a id="id2804180" class="indexterm"></a><a id="id2804197" class="indexterm"></a><a id="id3036370" class="indexterm"></a>
				The function <code class="command"><em class="replaceable"><code>foo</code></em></code> in the script used the wrong type (i.e. <code class="command">%s</code> or <code class="command">%d</code>). This error will present itself in <a class="xref" href="errors.html#errorvariable" title="Example 5.1. error-variable.stp">Example 5.1, “error-variable.stp”</a>, because the function <code class="command">execname()</code> returns a string the format specifier should be a <code class="command">%s</code>, not <code class="command">%d</code>.
			</div><div class="example" id="errorvariable"><div class="example-contents"><pre class="programlisting">
probe syscall.open
{
  printf ("%d(%d) open\n", execname(), pid())
}
</pre></div><h6>Example 5.1. error-variable.stp</h6></div><br class="example-break" /><div class="formalpara"><h5 class="formalpara" id="id2907845">semantic error: unresolved type for identifier '<em class="replaceable"><code>foo</code></em>'</h5><a id="id2907859" class="indexterm"></a><a id="id2907875" class="indexterm"></a><a id="id3016723" class="indexterm"></a><a id="id3016739" class="indexterm"></a>
				The identifier (e.g. a variable) was used, but no type (integer or string) could be determined. This occurs, for instance, if you use a variable in a <code class="command">printf</code> statement while the script never assigns a value to the variable.
			</div><div class="formalpara"><h5 class="formalpara" id="id3057448">semantic error: Expecting symbol or array index expression</h5><a id="id3057459" class="indexterm"></a><a id="id3043422" class="indexterm"></a><a id="id3043438" class="indexterm"></a><a id="id2897894" class="indexterm"></a>
				SystemTap could not assign a value to a variable or to a location in an array. The destination for the assignment is not a valid destination. The following example code would generate this error:
			</div><div class="para">
			
<pre class="programlisting">
probe begin { printf("x") = 1 }

</pre>
		</div><div class="formalpara"><h5 class="formalpara" id="id3071182">while searching for arity <em class="replaceable"><code>N</code></em> function, semantic error: unresolved function call</h5><a id="id3071195" class="indexterm"></a><a id="id4379952" class="indexterm"></a><a id="id4379967" class="indexterm"></a><a id="id2844851" class="indexterm"></a><a id="id2844866" class="indexterm"></a>
				A function call or array index expression in the script used an invalid number of arguments/parameters. In SystemTap <em class="firstterm">arity</em> can either refer to the number of indices for an array, or the number of parameters to a function.
			</div><div class="formalpara"><h5 class="formalpara" id="id2714217">semantic error: array locals not supported, missing global declaration?</h5><a id="id2714227" class="indexterm"></a><a id="id2899639" class="indexterm"></a><a id="id2899655" class="indexterm"></a><a id="id2899671" class="indexterm"></a><a id="id2746076" class="indexterm"></a>
				The script used an array operation without declaring the array as a global variable (global variables can be declared after their use in Systemtap scripts). Similar messages appear if an array is used, but with inconsistent arities.
			</div><div class="formalpara"><h5 class="formalpara" id="id2731577">semantic error: variable ’<em class="replaceable"><code>foo</code></em>’ modified during ’foreach’ iteration</h5><a id="id2731591" class="indexterm"></a><a id="id2731607" class="indexterm"></a><a id="id2898002" class="indexterm"></a><a id="id2898018" class="indexterm"></a>
				The array <code class="literal">foo</code> is being modifed (being assigned to or deleted from) within an active <code class="command">foreach</code> loop. This error also displays if an operation within the script performs a function call within the <code class="command">foreach</code> loop.
			</div><div class="formalpara"><h5 class="formalpara" id="id2723211">semantic error: probe point mismatch at position <em class="replaceable"><code>N</code></em>, while resolving probe point <em class="replaceable"><code>foo</code></em></h5><a id="id2953520" class="indexterm"></a><a id="id2953536" class="indexterm"></a><a id="id4361942" class="indexterm"></a><a id="id4361958" class="indexterm"></a>
				SystemTap did not understand what the event or SystemTap function <code class="computeroutput"><em class="replaceable"><code>foo</code></em></code> refers to. This usually means that SystemTap could not find a match for <code class="computeroutput"><em class="replaceable"><code>foo</code></em></code> in the tapset library. The <em class="replaceable"><code>N</code></em> refers to the line and column of the error.
			</div><div class="formalpara"><h5 class="formalpara" id="id3105833">semantic error: no match for probe point, while resolving probe point <em class="replaceable"><code>foo</code></em></h5><a id="id3095886" class="indexterm"></a><a id="id3095902" class="indexterm"></a><a id="id3015923" class="indexterm"></a><a id="id3015939" class="indexterm"></a><a id="id3015955" class="indexterm"></a>
				The events / handler function <code class="computeroutput"><em class="replaceable"><code>foo</code></em></code> could not be resolved altogether, for a variety of reasons. This error occurs when the script contains the event <code class="command">kernel.function("<em class="replaceable"><code>blah</code></em>")</code>, and <code class="command"><em class="replaceable"><code>blah</code></em></code> does not exist. In some cases, the error could also mean the script contains an invalid kernel file name or source line number.
			</div><div class="formalpara"><h5 class="formalpara" id="id3106345">semantic error: unresolved target-symbol expression</h5><a id="id3106355" class="indexterm"></a><a id="id3106372" class="indexterm"></a><a id="id2740092" class="indexterm"></a><a id="id2740109" class="indexterm"></a><a id="id2917523" class="indexterm"></a>
				A handler in the script references a target variable, but the value of the variable could not be resolved. This error could also mean that a handler is referencing a target variable that is not valid in the context when it was referenced. This may be a result of compiler optimization of the generated code.
			</div><div class="formalpara"><h5 class="formalpara" id="id2917550">semantic error: libdwfl failure </h5><a id="id2841245" class="indexterm"></a><a id="id2841261" class="indexterm"></a><a id="id2804656" class="indexterm"></a><a id="id2804672" class="indexterm"></a>
				There was a problem processing the debugging information. In most cases, this error results from the installation of a <code class="filename">kernel-debuginfo</code> RPM whose version does not match the probed kernel exactly. The installed <code class="filename">kernel-debuginfo</code> RPM itself may have some consistency / correctness problems.
			</div><div class="formalpara"><h5 class="formalpara" id="id2960676">semantic error: cannot find <em class="replaceable"><code>foo</code></em> debuginfo</h5>
				SystemTap could not find a suitable <code class="filename">kernel-debuginfo</code> at all.
			</div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="futexcontentionsect.html"><strong>Prev</strong>4.4. Identifying Contended User-Space Locks</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="runtimeerror.html"><strong>Next</strong>5.2. Run Time Errors and Warnings</a></li></ul></body></html>