public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "guillaume at morinfr dot org" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug tapsets/26184] fullpath_struct_file does not handle struct dentry on 5.6.19-300.fc32.x86_64
Date: Wed, 26 May 2021 22:06:21 +0000	[thread overview]
Message-ID: <bug-26184-6586-sfLrvlt9P6@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26184-6586@http.sourceware.org/bugzilla/>

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

--- Comment #5 from Guillaume Morin <guillaume at morinfr dot org> ---
This appears to be still present in systemtap 4.5.

This simple workaround seems to fix the problem:

--- a/tapset/linux/dentry.stp  2021-05-26 17:44:48.283925000 -0400
+++ b/tapset/linux/dentry.stp        2021-05-26 17:44:59.122807962 -0400
@@ -264,7 +264,7 @@
                        /* RHEL7+ kernels */
                        if (! @type_member_defined("vfsmount", mnt_parent)) {
                                /* Global root? */
-                               if (mnt != mnt->mnt_parent) {
+                               if (mnt && mnt != mnt->mnt_parent) {
                                        dentry = mnt->mnt_mountpoint
                                        vfsmnt = & mnt->mnt_parent->mnt
                                        mnt = mnt->mnt_parent

However, mnt should not be 0 at that point in the code. The mnt var should be
defined if @type_member_defined("mount", mnt_parent) is true and it should be
the case in any kernel released in the past 10 years.

_But_ I verified that it does not evaluate to true with the example given by
the original reporter (stap -v -c /bin/false -e 'probe process.begin {
printf("%s\n", fullpath_struct_file(task_current(), current_exe_file()));
exit(); }').

I also can reproduce with a completely different example (a longer one). I
could provide it if necessary but the original reproducer is simple enough.

It does look like a bug similar to
https://sourceware.org/bugzilla/show_bug.cgi?id=20672

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

  reply	other threads:[~2021-05-26 22:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 21:26 [Bug tapsets/26184] New: " guillaume at morinfr dot org
2021-05-26 22:06 ` guillaume at morinfr dot org [this message]
2022-03-22 18:15 ` [Bug tapsets/26184] " wcohen at redhat dot com
  -- strict thread matches above, loose matches on Subject: below --
2020-07-13  6:48 Craig Ringer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-26184-6586-sfLrvlt9P6@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).