Infinite loop in task_dentry_path
David Smith
dsmith@redhat.com
Fri May 9 15:29:00 GMT 2014
On 05/08/2014 05:34 PM, Henrik /KaarPoSoft wrote:
> 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'm a bit confused by your script. Doesn't 'dirname "."' just return "."
(at least it did for me)?
> 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.
I was following you up until this point. By "pipe file system" do you
mean the RPC pipe file system or something else?
Can you give me more step by step instructions on how to duplicate this
problem? If detailed enough, we might be able to create a testcase out
of them. For instance, where were you when you run your shell script?
> This patch solves the problem for me:
> https://sourceforge.net/p/kaarpux/code/ci/master/tree/master/packages/s/systemtap.files/dentry.patch
I've looked at the patch, and I don't think it is quite correct. There
are 2 paths through that code, and you just modified one of them. In
addition, I'm still not sold on the need for the new code.
task_dentry_path() is based on the kernel's dentry_path(), and I don't
see a similar check of the one you'd like to add in it.
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
More information about the Systemtap
mailing list