% ./crash-c_translate_array.stp stap: loc2c.c:1584: c_translate_array: Assertion `dwarf_tag (typedie) == DW_TAG_array_type' failed. Aborted (core dumped) % cat ./crash-c_translate_array.stp #!/usr/bin/env stap probe syscall.execve { print($argv[0]) exit() } % stap -V SystemTap translator/driver (version 0.5.4 built 2006-02-02) Copyright (C) 2005-2006 Red Hat, Inc. and others This is free software; see the source for copying conditions. % cat /etc/redhat-release Red Hat Enterprise Linux ES release 4 (Nahant Update 3) % gcc -v Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.5/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=x86_64-redhat-linux Thread model: posix gcc version 3.4.5 20051201 (Red Hat 3.4.5-2) %
The translator is responsible for checking Dwarf types and calling c_translate_* with only the appropriate DIE flavor for each call. To support C-style use of pointers with array syntax, it needs to use c_translate_pointer+addressof, then do its own arithmetic. c_translate_array could be extended to do this for DW_TAG_pointer, but still it looks like the translator is not checking types before calling loc2c.
A patch has been committed to produce a cleaner exception for this case rather than an assertion failure. However, the code does not support pointer arithmetic yet, so I'll relabel this bug to track this enhancement.
Fixed in commit d52761f8. (In reply to comment #0) > probe syscall.execve > { > print($argv[0]) > exit() > } Note that this still probably doesn't work as the author intended, as it will print just the pointer to the argv[0]. To get the string value, one would need to call user_string($argv[0]).