public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "mjw at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug runtime/13083] New: debug 3.1 kernel doesn't like mmput() in stap_utrace_attach
Date: Fri, 12 Aug 2011 10:26:00 -0000	[thread overview]
Message-ID: <bug-13083-6586@http.sourceware.org/bugzilla/> (raw)

http://sourceware.org/bugzilla/show_bug.cgi?id=13083

             Bug #: 13083
           Summary: debug 3.1 kernel doesn't like mmput() in
                    stap_utrace_attach
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
        AssignedTo: systemtap@sourceware.org
        ReportedBy: mjw@redhat.com
    Classification: Unclassified


This happens with rawhide 3.1.0-0.rc1.git2.2.fc17.x86_64.

$ /usr/local/install/systemtap/bin/stap -DDEBUG_TRANS=99 -e 'probe
process("/bin/ls").function("main") { log(pp()); exit(); }'

[ 2109.794569] _stp_ctl_write_cmd:47 Got STP_START. len=8
[ 2109.795282] _stp_handle_start:85 stp_handle_start
[ 2109.795917] stap_66a46d9248eb4d3a551fff3e7045365_28442: systemtap:
1.7/0.152, base: ffffffffa022f000, memory: 55data/28text/10ctx/10net/34alloc
kb, probes: 1
[ 2109.797618] BUG: sleeping function called from invalid context at
kernel/fork.c:558
[ 2109.798581] in_atomic(): 1, irqs_disabled(): 0, pid: 28442, name: stapio
[ 2109.799456] INFO: lockdep is turned off.
[ 2109.799967] Pid: 28442, comm: stapio Not tainted
3.1.0-0.rc1.git2.2.fc17.x86_64 #1
[ 2109.801311] Call Trace:
[ 2109.801614]  [<ffffffff8104f78b>] __might_sleep+0x103/0x108
[ 2109.802334]  [<ffffffff81059d93>] mmput+0x22/0xee
[ 2109.802939]  [<ffffffffa0231a22>] __stp_utrace_attach+0x62/0x1bc
[stap_66a46d9248eb4d3a551fff3e7045365_28442]
[ 2109.804186]  [<ffffffffa0233ee0>] _stp_ctl_write_cmd+0x5f6/0xc86
[stap_66a46d9248eb4d3a551fff3e7045365_28442]
[ 2109.805418]  [<ffffffff812014d1>] ? security_file_permission+0x2e/0x33
[ 2109.806246]  [<ffffffff811425c6>] vfs_write+0xaf/0xf6
[ 2109.806884]  [<ffffffff81143b9e>] ? fget_light+0x97/0xa2
[ 2109.807568]  [<ffffffff811427c1>] sys_write+0x4d/0x74
[ 2109.808246]  [<ffffffff814ffb42>] system_call_fastpath+0x16/0x1b

So this seems like when the module receives a STP_START message, call
init_module(), which will initialize the utrace engine. This then hits the
following sanity check code:

        // Ignore threads with no mm (which are either kernel threads
        // or "mortally wounded" threads).
        mm = get_task_mm(tsk);
        if (! mm)
                return EPERM;
        mmput(mm);

And it seems that because we hold the _stp_transport_mutex (see
_stp_handle_start in transport.c) the kernel feels we are in_atomic because
that is holding a spinlock. Se we may not call mmput().

I am not completely sure this is really fatal or just the kernel being a little
paranoid.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

             reply	other threads:[~2011-08-12 10:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-12 10:26 mjw at redhat dot com [this message]
2011-10-13 17:38 ` [Bug runtime/13083] " dsmith at redhat dot com
2011-10-27 16:04 ` dsmith at redhat dot com

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-13083-6586@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).