On Wed, Feb 23, 2005 at 02:43:35PM +0100, Alfred M. Szmidt wrote:
> > Could you remind me abit more about that thread?
>
> Shall I send you the messages or does that
> <URL:http://lists.gnu.org/archive/html/bug-hurd/2004-10/msg00365.html>
> suffice?
>
> Ah, CS thingy... Try the patch and see if it crashes the program or
> crashes the kernel.
After adding '#include "ldt.h" /* for USER_CS */' to i386/i386/trap.c
I got GNU Mach to compile having Roland's patch applied, but it didn't
help: at the time glibc's build system tries to load an executable using
the newly created loader (.../elf/ld.so.1) the kernel crashes:
#v+
Kernel General protection trap, eip 0x17649c
Kernel: General protection (13), code=14
Stopped at 0x17649c: mov %ax,%fs
db> trace
0x17649c(10617454)
>>>>> General protection (13) at 0x10bdb02 <<<<<
0x10bdb02(6ec6003)
>>>>> Divide error (0) at 0 <<<<<
#v-
#v+
$ addr2line -fe gnumach 0x17649c
inst_fetch
i386/i386/locore.S:1647
#v-
#v+
$ cat -n i386/i386/locore.S | grep -C 10 ^\ \ 1647
1637 ret /* exit */
1638
1639
1640 /*
1641 * int inst_fetch(int eip, int cs);
1642 *
1643 * Fetch instruction byte. Return -1 if invalid address.
1644 */
1645 ENTRY(inst_fetch)
1646 movl S_ARG1, %eax /* get segment */
1647 movw %ax,%fs /* into FS */
1648 movl S_ARG0, %eax /* get offset */
1649 RETRY(EXT(inst_fetch)) /* re-load FS on retry */
1650 RECOVER(_inst_fetch_fault)
1651 movzbl %fs:(%eax),%eax /* load instruction byte */
1652 ret
1653
1654 _inst_fetch_fault:
1655 movl $-1,%eax /* return -1 if error */
1656 ret
1657
#v-
> I don't recall if the patch in question was applied, if you can check
> that it does help, then we can apply it.
It doesn't seem to.
Regards,
Thomas
P.S. For posterity:
To get debugging symbols in the object files compiled from Assembler
source files, you have to add '-g' to '$ASFLAGS' before configuring
GNU Mach. I used
#v+
$ CFLAGS="$CFLAGS -O0 -g" ASFLAGS="${ASFLAGS-$CFLAGS} -O0 -g" ./configure [...]
#v-
_______________________________________________
Bug-hurd mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-hurd