Re: [PATCH-RT] Fix for sleeping function called from invalidcontext when running gdb

From: Steven Rostedt
Date: Fri Dec 02 2011 - 10:46:08 EST


On Fri, 2011-12-02 at 14:39 +0100, John Kacur wrote:
> While running gdb on cyclictest on v3.2-rc2-rt3 I got the following error
>
> [root@starship ~]# [11887.443716] BUG: sleeping function called from invalid con
> text at /home/jkacur/linux-rt/kernel/rtmutex.c:645
> [11887.443720] in_atomic(): 1, irqs_disabled(): 0, pid: 4859, name: cyclictest
> [11887.443723] no locks held by cyclictest/4859.
> [11887.443726] Pid: 4859, comm: cyclictest Not tainted 3.2.0-rc2-rt3-debug-expr+
> #1
> [11887.443728] Call Trace:
> [11887.443737] [<ffffffff81035543>] __might_sleep+0x185/0x18d
> [11887.443743] [<ffffffff8107c3ed>] rt_spin_lock_fastlock.clone.0+0x24/0x31
> [11887.443749] [<ffffffff813fba9b>] rt_spin_lock+0x16/0x40
> [11887.443754] [<ffffffff81053eee>] force_sig_info+0x3d/0xeb
> [11887.443758] [<ffffffff81053fb2>] force_sig+0x16/0x18
> [11887.443761] [<ffffffff813fd0a1>] do_trap+0xef/0x130
> [11887.443766] [<ffffffff81076525>] ? trace_hardirqs_on_caller+0x12a/0x161
> [11887.443771] [<ffffffff813fd16f>] do_int3+0x8d/0x9a
> [11887.443774] [<ffffffff813fc9e7>] int3+0x27/0x40
>
> I found that there is a patch for this in v2.6.33.9-rt31 that I forward-ported
> to v3.2-rc2-rt3
>
> I believe that Thomas Gleixner is the original author, but I'm not sure.
> Thomas - can you provide your signed-off-by if you are the author?

Actually, the author was Andi. It's in the 2.6.24-rt patch set too.
Here's the change log: