[issue524] Making world with gcc41?

walt wa1ter at myrealbox.com
Mon Jan 22 09:35:28 PST 2007


On Sun, 21 Jan 2007, Simon 'corecode' Schubert wrote:

> Sascha Wildner wrote:
> > Here's the panic string Peter Avalos got when he tried to boot a kernel
> > compiled with 4.1:
> >
> > http://leaf.dragonflybsd.org/~pavalos/gcc41-kernel.crash
>
> Okay, I fixed it, lets go for some explanation first:
>
> The gpfault comes from vm86_bioscall(...) in init386().  The cause is that the
> assembler code passes the struct vm86frame by value, i.e. simply creating it
> on the stack.  This worked up to gcc34, but gcc41 now optimizes stores to
> unused memory locations away, whis is allowed per the standards.  This led to
> an uninitialized stack frame which in turn panicked the box.
>
> After some time of bug searching (qemu with gdbserver being *very* helpful) it
> turns out that freebsd did have the same problem one month ago.  So, the fix
> is the same:  pass structs by reference if you expect the callee to modify
> them.
>
> The attached patch does this...

I just now tried your patch.  Alas, I got a page fault during boot just
after "kern.seedenable 0 -> 1".  Here is the trace, minus the lengthy
hexadecimal arguments (I'll transcribe them if you need them):

strlen
iconv_sysctl_drvlist
sysctl_root
userland_sysctl
syscall12
Xint0x80_syscall

I typed 'panic' at the db prompt, but nothing happened.
Any ideas, suggestions?

Thanks!






More information about the Bugs mailing list