Re: 2.4.19-pre4-ac4 kills my gdm

Corey Minyard (minyard@acm.org)
Thu, 04 Apr 2002 13:17:57 -0600


This is a multi-part message in MIME format.
--------------040400050600030902020804
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Patrick R. McManus wrote:

>Alan,
>
>mea culpa on this one - my problem appears to be with the only other
>patch I was running - I believed I was also running it on ac3, but it
>now appears that I was thinking of another box.
>
>The other patch was corey minyard's "allow signal handler to not call
>handler" patch that I was interested in seeing its impact on a
>userspace project of mine. It kills gdm (at least with ac4.. maybe
>others?)
>
>thanks,
>-Pat
>
Yet, it does seem to kill gdm. xdm and kdm seem to work fine.

Ok, I see the problem. I've fixed it, booted and tried gdm, and it works
fine. The SA_ONESHOT was checked in the wrong place, the handler is set
in the frame_setup routines, so I have to check and set the handler due
to the SA_ONESHOT flag after this. The patch is attached.

-Corey

--------------040400050600030902020804
Content-Type: text/plain;
name="linux-nocallhndlr.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="linux-nocallhndlr.patch"

--- ./arch/i386/kernel/signal.c.nocallhndlr Wed Mar 27 10:56:29 2002
+++ ./arch/i386/kernel/signal.c Thu Apr 4 13:10:30 2002
@@ -558,22 +558,25 @@
}
}

- /* Set up the stack frame */
- if (ka->sa.sa_flags & SA_SIGINFO)
- setup_rt_frame(sig, ka, info, oldset, regs);
- else
- setup_frame(sig, ka, oldset, regs);
+ /* Set up the stack frame if we are calling the handler. */
+ if (! (ka->sa.sa_flags & SA_NOCALLHNDLR)) {
+ if (ka->sa.sa_flags & SA_SIGINFO)
+ setup_rt_frame(sig, ka, info, oldset, regs);
+ else
+ setup_frame(sig, ka, oldset, regs);
+
+ if (!(ka->sa.sa_flags & SA_NODEFER)) {
+ spin_lock_irq(&current->sigmask_lock);
+ sigorsets(&current->blocked,&current->blocked,
+ &ka->sa.sa_mask);
+ sigaddset(&current->blocked,sig);
+ recalc_sigpending(current);
+ spin_unlock_irq(&current->sigmask_lock);
+ }
+ }

if (ka->sa.sa_flags & SA_ONESHOT)
ka->sa.sa_handler = SIG_DFL;
-
- if (!(ka->sa.sa_flags & SA_NODEFER)) {
- spin_lock_irq(&current->sigmask_lock);
- sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
- sigaddset(&current->blocked,sig);
- recalc_sigpending(current);
- spin_unlock_irq(&current->sigmask_lock);
- }
}

/*
--- ./include/asm-i386/signal.h.nocallhndlr Wed Mar 27 10:56:12 2002
+++ ./include/asm-i386/signal.h Thu Apr 4 13:02:07 2002
@@ -91,6 +91,7 @@
#define SA_RESTART 0x10000000
#define SA_NODEFER 0x40000000
#define SA_RESETHAND 0x80000000
+#define SA_NOCALLHNDLR 0x00800000 /* Don't really call the handler. */

#define SA_NOMASK SA_NODEFER
#define SA_ONESHOT SA_RESETHAND

--------------040400050600030902020804--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/