Understanding SystemTap ErrorsBy type - http://sourceware.org/systemtap/tutorial/node23.htmlThis chapter explains the most common errors you may encounter while using SystemTap.Parse and Semantic Errorsunderstanding SystemTap errorsparse/semantics errorerrorsparse/semantics errorparse/semantics errorunderstanding SystemTap errorsParse and semantic errors occur while SystemTap attempts to parse and
translate the script into C, before converting it into a kernel
module. For example, type errors result from operations that assign invalid
values to variables or arrays.
parse error: expected foo, saw barunderstanding SystemTap errorsparse/semantics errorinvalid values to variables/arrayserrorsparse/semantics errorinvalid values to variables/arraysparse/semantics errorunderstanding SystemTap errorsinvalid values to variables/arraysinvalid values to variables/arraysparse/semantics errorunderstanding SystemTap errorsunderstanding SystemTap errorsparse/semantics errorgrammatical/typographical script errorerrorsparse/semantics errorgrammatical/typographical script errorparse/semantics errorunderstanding SystemTap errorsgrammatical/typographical script errorgrammatical/typographical script errorparse/semantics errorunderstanding SystemTap errorstypographical script errorparse/semantics errorunderstanding SystemTap errorsThe script contains a grammatical or typographical error. SystemTap detected the type of the construct that is incorrect, given the context of the probe.
need more clarification (example) on this; could not replicate. how to
replicate?
For example, the following invalid SystemTap script is missing its probe
handlers:
An attempt to run this SystemTap script fails with the following error
message showing that the parser expects
something other than the probe keyword in
column 1 of line 2:
parse error: expected one of '. , ( ? ! { = +='
saw: keyword at perror.stp:2:1
1 parse error(s).parse error: embedded code in unprivileged scriptunderstanding SystemTap errorsparse/semantics errorembedded code in unprivileged scripterrorsparse/semantics errorembedded code in unprivileged scriptparse/semantics errorunderstanding SystemTap errorsembedded code in unprivileged scriptembedded code in unprivileged scriptparse/semantics errorunderstanding SystemTap errorsunprivileged script, embedded code inparse/semantics errorunderstanding SystemTap errorsunsafe embedded code in unprivileged scriptparse/semantics errorunderstanding SystemTap errors
The script contains unsafe embedded C code, that is, blocks of code
surrounded by %{ and %}. 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
safe and SystemTap reports this error to warn you if such constructs
appear in the script.
understanding SystemTap errorsparse/semantics errorguru modeerrorsparse/semantics errorguru modeparse/semantics errorunderstanding SystemTap errorsguru modeguru modeparse/semantics errorunderstanding SystemTap errors
If you are sure that any similar constructs in the script are safe
and you
are a member of the stapdev
group (or have root privileges),
run the script in "guru" mode by using the option:
stap -g scriptsemantic error: type mismatch for identifier 'foo' ... string vs. longunderstanding SystemTap errorsparse/semantics errortype mismatch for identifiererrorsparse/semantics errortype mismatch for identifierparse/semantics errorunderstanding SystemTap errorstype mismatch for identifiertype mismatch for identifierparse/semantics errorunderstanding SystemTap errorsidentifier type mismatchparse/semantics errorunderstanding SystemTap errors
The function foo in the
script used the wrong type
(such as %s or %d).
In the following example, the format specifier should be
%s and not %d, because the
execname() function returns a string:
probe syscall.open
{
printf ("%d(%d) open\n", execname(), pid())
}semantic error: unresolved type for identifier 'foo'understanding SystemTap errorsparse/semantics errorunresolved type for identifiererrorsparse/semantics errorunresolved type for identifierparse/semantics errorunderstanding SystemTap errorsunresolved type for identifierunresolved type for identifierparse/semantics errorunderstanding SystemTap errorsThe identifier (variable) was used, but no type (integer or
string) could be determined. This occurs, for instance, if you use a
variable in a printf statement while
the script never assigns a value to the variable.semantic error: Expecting symbol or array index expressionunderstanding SystemTap errorsparse/semantics errorexpected symbol/array index expressionerrorsparse/semantics errorexpected symbol/array index expressionparse/semantics errorunderstanding SystemTap errorsexpected symbol/array index expressionexpected symbol/array index expressionparse/semantics errorunderstanding SystemTap errors
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:
while searching for arity N function, semantic error: unresolved function callunderstanding SystemTap errorsparse/semantics errorunresolved function callerrorsparse/semantics errorunresolved function callparse/semantics errorunderstanding SystemTap errorsunresolved function callunresolved function callparse/semantics errorunderstanding SystemTap errorsfunction call (unresolved)parse/semantics errorunderstanding SystemTap errorsA function call or array index expression in the script used an invalid
number of arguments or parameters. In SystemTap,
arity can either refer to the number of indices
for an array, or the number of parameters to a function.semantic error: array locals not supported, missing global declaration?array locals not supportedparse/semantics errorunderstanding SystemTap errorsunderstanding SystemTap errorsparse/semantics errornon-global arrayserrorsparse/semantics errornon-global arraysparse/semantics errorunderstanding SystemTap errorsnon-global arraysnon-global arraysparse/semantics errorunderstanding SystemTap errorsThe 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.semantic error: variable 'foo' modified during 'foreach' iterationunderstanding SystemTap errorsparse/semantics errorvariable modified during 'foreach'errorsparse/semantics errorvariable modified during 'foreach'parse/semantics errorunderstanding SystemTap errorsvariable modified during 'foreach'variable modified during 'foreach'parse/semantics errorunderstanding SystemTap errorsThe array foo is being modified (being assigned to or deleted from) within an active foreach loop. This error also displays if an operation within the script performs a function call within the foreach loop.semantic error: probe point mismatch at position N, while resolving probe point foounderstanding SystemTap errorsparse/semantics errorprobe mismatcherrorsparse/semantics errorprobe mismatchparse/semantics errorunderstanding SystemTap errorsprobe mismatchprobe mismatchparse/semantics errorunderstanding SystemTap errorsSystemTap did not understand what the event or SystemTap function
foo refers
to. This usually means that SystemTap could not find a match for
foo in the
tapset library. N refers to the
line and column of
the error.how to explain N in previous? "The divergence from the “tree” of probe point namespace is at position N (starting with zero at left)." (from tutorial) semantic error: no match for probe point, while resolving probe point foounderstanding SystemTap errorsparse/semantics errorno match for probe pointerrorsparse/semantics errorno match for probe pointparse/semantics errorunderstanding SystemTap errorsno match for probe pointno match for probe pointparse/semantics errorunderstanding SystemTap errorsprobe point (no match for)parse/semantics errorunderstanding SystemTap errorsSystemTap could not resolve the events or handler function foo for a variety of reasons. This error occurs when the script contains the event kernel.function("something"), and something does not exist. In some cases, the error could also mean the script contains an invalid kernel file name or source line number.semantic error: unresolved target-symbol expressionunderstanding SystemTap errorsparse/semantics errorunresolved target-symbol expressionerrorsparse/semantics errorunresolved target-symbol expressionparse/semantics errorunderstanding SystemTap errorsunresolved target-symbol expressionunresolved target-symbol expressionparse/semantics errorunderstanding SystemTap errorstarget-symbol expression, unresolvedparse/semantics errorunderstanding SystemTap errorsA 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.semantic error: libdwfl failure understanding SystemTap errorsparse/semantics errorlibdwfl failureerrorsparse/semantics errorlibdwfl failureparse/semantics errorunderstanding SystemTap errorslibdwfl failurelibdwfl failureparse/semantics errorunderstanding SystemTap errorsThere was a problem processing the debugging information. In most
cases, this error results from the installation of a
kernel-debuginfo package whose version does not match
the probed kernel exactly. The installed kernel-debuginfo package itself may have some consistency or correctness problems.semantic error: cannot find foo debuginfoSystemTap could not find a suitable kernel-debuginfo package.Runtime Errors and Warningsunderstainding SystemTap errorsruntime errors/warningserrorsruntime errors/warningsruntime errors/warningsunderstainding SystemTap errors
Runtime errors and warnings occur when the SystemTap
instrumentation has been installed and is collecting data on
the system.
WARNING: Number of errors: N, skipped probes: Munderstainding SystemTap errorsruntime errors/warningsnumber of errors: N, skipped probes: Merrorsruntime errors/warningsnumber of errors: N, skipped probes: Mruntime errors/warningsunderstainding SystemTap errorsnumber of errors: N, skipped probes: Mnumber of errors: N, skipped probes: Mruntime errors/warningsunderstainding SystemTap errors
Errors and/or skipped probes occurred during this run. Both
N and M are
the counts of the number of probes that were not executed due to
conditions such as too much time required to execute event handlers over
an interval of time.
division by 0understainding SystemTap errorsruntime errors/warningsdivision by 0errorsruntime errors/warningsdivision by 0runtime errors/warningsunderstainding SystemTap errorsdivision by 0division by 0runtime errors/warningsunderstainding SystemTap errorsinvalid divisionruntime errors/warningsunderstainding SystemTap errors
The script code performed an invalid division.
aggregate element not foundunderstainding SystemTap errorsruntime errors/warningsaggregate element not founderrorsruntime errors/warningsaggregate element not foundruntime errors/warningsunderstainding SystemTap errorsaggregate element not foundaggregate element not foundruntime errors/warningsunderstainding SystemTap errors
A statistics extractor function other than @count
was invoked on an aggregate that has not had any values accumulated yet.
This is similar to a division by zero.
aggregation overflowunderstainding SystemTap errorsruntime errors/warningsaggregation overflowerrorsruntime errors/warningsaggregation overflowruntime errors/warningsunderstainding SystemTap errorsaggregation overflowaggregation overflowruntime errors/warningsunderstainding SystemTap errorsoverflow of aggregationruntime errors/warningsunderstainding SystemTap errors
An array containing aggregate values contains too many distinct key pairs at this time.
MAXNESTING exceededunderstainding SystemTap errorsruntime errors/warningsMAXNESTING exceedederrorsruntime errors/warningsMAXNESTING exceededruntime errors/warningsunderstainding SystemTap errorsMAXNESTING exceededMAXNESTING exceededruntime errors/warningsunderstainding SystemTap errorsexceeded MAXNESTINGruntime errors/warningsunderstainding SystemTap errors
Too many levels of function call nesting were attempted.
The default nesting of function calls allowed is 10.
MAXACTION exceededunderstainding SystemTap errorsruntime errors/warningsMAXACTION exceedederrorsruntime errors/warningsMAXACTION exceededruntime errors/warningsunderstainding SystemTap errorsMAXACTION exceededMAXACTION exceededruntime errors/warningsunderstainding SystemTap errorsexceeded MAXACTIONruntime errors/warningsunderstainding SystemTap errors
The probe handler attempted to execute too many statements in the
probe handler. The default number of actions allowed in a probe handler
is 1000.
kernel/user string copy fault at ADDRunderstainding SystemTap errorsruntime errors/warningscopy faulterrorsruntime errors/warningscopy faultruntime errors/warningsunderstainding SystemTap errorscopy faultcopy faultruntime errors/warningsunderstainding SystemTap errors
The probe handler attempted to copy a string from kernel or
user space at an invalid address (ADDR).
pointer dereference faultunderstainding SystemTap errorsruntime errors/warningspointer dereference faulterrorsruntime errors/warningspointer dereference faultruntime errors/warningsunderstainding SystemTap errorspointer dereference faultpointer dereference faultruntime errors/warningsunderstainding SystemTap errors
There was a fault encountered during a pointer
dereference operation such as a target variable evaluation.