이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 5. Understanding SystemTap Errors


This chapter explains errors that are commonly encountered while using SystemTap.
Many diagnostic errors include strings that suggest reading a man page, such as:
[man warning::example1]
[man error::example2]
In such instances, see the respective man pages for warning::example1 and error::example2 which provides explanatory information specific to that diagnostic.

5.1. Parse and Semantic Errors

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.
parse error: expected abc, saw xyz

The script contains a grammatical/typographical error. SystemTap detected type of construct that is incorrect, given the context of the probe.

The following invalid SystemTap script is missing its probe handlers:
probe vfs.read
probe vfs.write
It results in the following error message showing that the parser was expecting 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 script

The script contains unsafe embedded C code (blocks of code surrounded by %{ %}. 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; as such, SystemTap warns you with this error if such constructs appear in the script.

If you are sure of the safety of any similar constructs in the script and are member of stapdev group (or have root privileges), run the script in guru mode by using the -g option:
stap -g script
semantic error: type mismatch for identifier 'ident' ... string vs. long

The ident function in the script used the wrong type (%s or %d). This error presents itself in Example 5.1, “error-variable.stp”. Because the execname() function returns a string, the format specifier should be %s, not %d.

Example 5.1. error-variable.stp

probe syscall.open
{
  printf ("%d(%d) open\n", execname(), pid())
}
semantic error: unresolved type for identifier 'ident'

The identifier (a variable, for example) 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 expression

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:

probe begin { printf("x") = 1 }
while searching for arity N function, semantic error: unresolved function call

A function call or array index expression in the script used an invalid number of arguments/parameters. In SystemTap arity can either see the number of indices for an array, or the number of parameters to a function.

semantic error: array locals not supported, missing global declaration?

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.

semantic error: variable ’vaar’ modified during ’foreach’ iteration

The var array is being modifed (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 pnt

SystemTap did not understand what the event or SystemTap function pnt refers to. This usually means that SystemTap could not find a match for pnt in the tapset library. The N refers to the line and column of the error.

semantic error: no match for probe point, while resolving probe point pnt

The pnt events and handler function could not be resolved for a variety of reasons. This error occurs when the script contains the kernel.function("name") event, and name 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 expression

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.

semantic error: libdwfl failure

There was a problem processing the debugging information. In most cases, this error results from the installation of a kernel-debuginfo package. The installed kernel-debuginfo package itself may have some consistency or correctness problems.

semantic error: cannot find package debuginfo

SystemTap could not find a suitable kernel-debuginfo at all.

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.