Re: gpf in do_exit

Richard B. Johnson (root@chaos.analogic.com)
Mon, 14 Sep 1998 17:57:20 -0400 (EDT)


On Mon, 14 Sep 1998, Gabriel Paubert wrote:

>
>
> On Mon, 14 Sep 1998, Ragnar Hojland Espinosa wrote:
>
> > 2.1.121-UP, egcs 1.1 this time
> >
> > general protection fault: 0000
> > CPU: 0
> > EIP: 0010:[<c0114a11>]
> > EFLAGS: 00010286
> > eax: 00000000 ebx: 80000000 ecx: c4c5e000 edx: 0000bfff
> > esi: 00000000 edi: 00008000 ebp: bfff8000 esp: c4c5ffd4
> > ds: 0000 es: 0000 ss: 0018
>
> >From the contents of ds and es and the stack displayed below, it seems
> that a signal handler thrashed the context before returning. There is
> indeed an oversight in the handling of exceptions on the iret instruction.
> The code which looks like (in the RESTORE_ALL macro in
> arch/i386/kernel/entry.S):
>
> pushl $11; \
> call do_exit
>
> should first set up %ds and %es and could for example look like:
>
> pushl %ss;\
> popl %ds;\
> pushl %ss;\
> popl %es;\
> pushl $11;\
> call do_exit
>
[SNIPPED]

The segment registers are 16-bit registers!

Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.1.118 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

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