This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug runtime/13083] New: debug 3.1 kernel doesn't like mmput() in stap_utrace_attach


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]