public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug tapsets/16991] New: infinite loop in task_dentry_path
@ 2014-05-27 13:46 dsmith at redhat dot com
  2014-05-28 14:35 ` [Bug tapsets/16991] " dsmith at redhat dot com
  2014-05-28 15:58 ` dsmith at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: dsmith at redhat dot com @ 2014-05-27 13:46 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=16991

            Bug ID: 16991
           Summary: infinite loop in task_dentry_path
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: dsmith at redhat dot com
                CC: henrik at kaarposoft dot dk

As noted in the following email thread,

<https://sourceware.org/ml/systemtap/2014-q2/msg00136.html>

there is a infinite loop in task_dentry_path when it hits virtual file systems
(like the pipe file system). Here's a reproducer:

===================
cd /tmp
mkdir T
cd T
cat > t.sh <<"EOF1"
KX_BASE="$(cd $(dirname ".")/../..; pwd -P)"
echo $KX_BASE
EOF1
cat > t.stp <<"EOF2"
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);
}    }
EOF2
stap -v -c "sh t.sh" t.stp
===================

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tapsets/16991] infinite loop in task_dentry_path
  2014-05-27 13:46 [Bug tapsets/16991] New: infinite loop in task_dentry_path dsmith at redhat dot com
@ 2014-05-28 14:35 ` dsmith at redhat dot com
  2014-05-28 15:58 ` dsmith at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dsmith at redhat dot com @ 2014-05-28 14:35 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=16991

--- Comment #1 from David Smith <dsmith at redhat dot com> ---
Created attachment 7619
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7619&action=edit
potential patch

Here's a potential patch, which includes a test case. The good news about this
patch is that it seems to fix the problem. When task_dentry_path() now hits a
dentry from a pipe filesystem, it returns something like:

pipe:[105988]

The only problem that I know of with this patch is the requirement of the
'buffer' argument to the new __dentry_generate_dname() function. It is a bit
ugly, but the only other potential solution I can think of (embedding that
temporary buffer in the context structure) is even uglier.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tapsets/16991] infinite loop in task_dentry_path
  2014-05-27 13:46 [Bug tapsets/16991] New: infinite loop in task_dentry_path dsmith at redhat dot com
  2014-05-28 14:35 ` [Bug tapsets/16991] " dsmith at redhat dot com
@ 2014-05-28 15:58 ` dsmith at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dsmith at redhat dot com @ 2014-05-28 15:58 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=16991

David Smith <dsmith at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from David Smith <dsmith at redhat dot com> ---
Commit 979929e fixes this issue by returning "UNKNOWN" for unmounted synthetic
filesystem items. The potential patch was a bit too dangerous in calling into
the kernel, without somehow doing more validation.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-28 15:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-27 13:46 [Bug tapsets/16991] New: infinite loop in task_dentry_path dsmith at redhat dot com
2014-05-28 14:35 ` [Bug tapsets/16991] " dsmith at redhat dot com
2014-05-28 15:58 ` dsmith at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).