Subject: Re: non-exec stack problems with multithreaded programs
To: None <M.Drochner@fz-juelich.de>
From: Nathan J. Williams <nathanw@wasabisystems.com>
List: port-i386
Date: 12/08/2003 12:40:57
Matthias Drochner <M.Drochner@fz-juelich.de> writes:

> chuq@chuq.com said:
> > I'm a little fuzzy on the *DT stuff. all the other segment registers
> > are set up using the GDT, why would CS be different? 
> 
> Currently, on exec(), segments from the LDT are used to initialize
> the registers for the new process, see machdep.c:setregs().
> For signal delivery/upcalls, GDT registers are used (see machdep.c:
> buildcontext()/cpu_upcall()). That's the inconsistency I was
> referring to.

For what it's worth, the upcall code inherited this oddity from the
signal delivery code. My best guess was that the signal code was
written that way to make it possible for signals to still be delivered
even if the program was doing some USER_LDT hackery.

        - Nathan