public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/13083] New: debug 3.1 kernel doesn't like mmput() in stap_utrace_attach
@ 2011-08-12 10:26 mjw at redhat dot com
  2011-10-13 17:38 ` [Bug runtime/13083] " dsmith at redhat dot com
  2011-10-27 16:04 ` dsmith at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: mjw at redhat dot com @ 2011-08-12 10:26 UTC (permalink / raw)
  To: systemtap

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.

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

* [Bug runtime/13083] debug 3.1 kernel doesn't like mmput() in stap_utrace_attach
  2011-08-12 10:26 [Bug runtime/13083] New: debug 3.1 kernel doesn't like mmput() in stap_utrace_attach mjw at redhat dot com
@ 2011-10-13 17:38 ` dsmith at redhat dot com
  2011-10-27 16:04 ` dsmith at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dsmith at redhat dot com @ 2011-10-13 17:38 UTC (permalink / raw)
  To: systemtap

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

David Smith <dsmith at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dsmith at redhat dot com
         Resolution|                            |FIXED

--- Comment #1 from David Smith <dsmith at redhat dot com> 2011-10-13 17:38:29 UTC ---
Fixed in commit 7fc97c1.  We no longer call get_task_mm()/mmput() when we're in
the context of that task.

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

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

* [Bug runtime/13083] debug 3.1 kernel doesn't like mmput() in stap_utrace_attach
  2011-08-12 10:26 [Bug runtime/13083] New: debug 3.1 kernel doesn't like mmput() in stap_utrace_attach mjw at redhat dot com
  2011-10-13 17:38 ` [Bug runtime/13083] " dsmith at redhat dot com
@ 2011-10-27 16:04 ` dsmith at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dsmith at redhat dot com @ 2011-10-27 16:04 UTC (permalink / raw)
  To: systemtap

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

--- Comment #2 from David Smith <dsmith at redhat dot com> 2011-10-27 16:03:18 UTC ---
Commit 93ee09d adds 2 more fixes here.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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:[~2011-10-27 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-12 10:26 [Bug runtime/13083] New: debug 3.1 kernel doesn't like mmput() in stap_utrace_attach mjw at redhat dot com
2011-10-13 17:38 ` [Bug runtime/13083] " dsmith at redhat dot com
2011-10-27 16:04 ` 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).