Infinite loop in task_dentry_path

Henrik /KaarPoSoft henrik@kaarposoft.dk
Thu May 8 22:34:00 GMT 2014


Dear systemtap developers,

I am using systemtap in a linux distro called KaarPux:
http://kaarpux.kaarposoft.dk/

Systemtap version 2.5
Linux kernel version 3.14.2
Linux kernel config:
https://sourceforge.net/p/kaarpux/code/ci/31d3302a970318382f64c1e97b9c9df863040e43/tree/master/packages/l/linux.files/config.x86_64


I have a simple stp script:
========================================
global FSNOTIFY_EVENT_PATH    = 1;
probe kernel.function("fsnotify") {
     if (!target_set_pid(pid())) { next; }
     if ($data_is==FSNOTIFY_EVENT_PATH) {
         path = task_dentry_path(task_current(),
             @cast($data, "path")->dentry,
             @cast($data, "path")->mnt);
         println(path);
}    }
========================================


If I am running this script on a simple shell script like
========================================
KX_BASE="$(cd $(dirname ".")/../..; pwd -P)"
echo $KX_BASE
========================================


I get:
========================================
ERROR: MAXACTION exceeded near keyword at 
//share/systemtap/tapset/linux/dentry.stp:211:25
ERROR: MAXACTION exceeded near keyword at 
//share/systemtap/tapset/linux/dentry.stp:211:25
========================================

The problem seems to be in task_dentry_path:
task_dentry_path goes into an infinite loop on
"special" file systems such as the pipe file system.


This patch solves the problem for me:
https://sourceforge.net/p/kaarpux/code/ci/master/tree/master/packages/s/systemtap.files/dentry.patch

/Henrik



More information about the Systemtap mailing list