Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 408019 - [amd64-fbsd] can not boot a kernel panic always occurs.
Summary: [amd64-fbsd] can not boot a kernel panic always occurs.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: AMD64 FreeBSD
: Normal normal (vote)
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 363717
  Show dependency tree
 
Reported: 2012-03-13 11:44 UTC by Yuta SATOH
Modified: 2012-06-17 15:56 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for freebsd-sources-8.2.ebuild (freebsd-sources-8.2.ebuild.patch,490 bytes, patch)
2012-03-13 11:51 UTC, Yuta SATOH
Details | Diff
patch for freebsd-sources-9.0.ebuild (freebsd-sources-9.0.ebuild.patch,491 bytes, patch)
2012-03-13 11:55 UTC, Yuta SATOH
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuta SATOH 2012-03-13 11:44:41 UTC
kernel was compiled with gcc-4.4 or later can not be boot by a kernel panic.

Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer     = 0x20:0xffffffff80b71c86
stack pointer           = 0x28:0xffffffff81628800
frame pointer           = 0x28:0xffffffff81628820
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 0 (swapper)
trap number             = 9
panic: general protection fault
cpuid = 0
KDB: stack backtrace:
#0 0xffffffff808a0bce at kdb_backtrace+0x5e
#1 0xffffffff8086acd7 at panic+0x147
#2 0xffffffff80b61a0f at trap_fatal+0x29f
#3 0xffffffff80b61f5b at trap+0xcb
#4 0xffffffff80b4aa8f at calltrap+0x8
#5 0xffffffff80b71e3c at send_kbd_command_and_data+0x3c
#6 0xffffffff80b6f7ce at write_kbd+0x4e
#7 0xffffffff80b6fb87 at atkbd_ioctl+0x387
#8 0xffffffff80b6fae3 at atkbd_ioctl+0x2e3
#9 0xffffffff80574977 at kbdmux_ioctl+0x717
#10 0xffffffff806a6662 at sc_allocate_keyboard+0x102
#11 0xffffffff806a807b at scinit+0xcb
#12 0xffffffff806a9b7c at sc_attach_unit+0x4c
#13 0xffffffff8089b934 at device_attach+0xa4
#14 0xffffffff808163c9 at isa_probe_children+0x279
#15 0xffffffff8081f7e5 at mi_startup+0xa5
#16 0xffffffff802b8bac at btext+0x2c
Uptime: 1s
Automatic reboot in 15 seconds - press a key on the console to abort
--> Press a key on the console to reboot,
--> or switch off the system now.
Comment 1 Yuta SATOH 2012-03-13 11:51:50 UTC
Created attachment 305177 [details, diff]
patch for freebsd-sources-8.2.ebuild
Comment 2 Yuta SATOH 2012-03-13 11:55:13 UTC
Created attachment 305179 [details, diff]
patch for freebsd-sources-9.0.ebuild

When you apply this patch, the kernel was compiled with gcc 4.4 or later versions will be able to boot.

Another workaround is to use gcc 4.3 to compile the kernel.
Comment 3 Yuta SATOH 2012-05-03 16:05:52 UTC
at the moment, to work around this issue is it better to use gcc-4.3.x.
attached patch is a problem that may occur.

https://github.com/nigoro/amd64-fbsd/issues/2
Comment 4 Alexis Ballier gentoo-dev 2012-05-04 17:38:49 UTC
(In reply to comment #2)
> Created attachment 305179 [details, diff] [details, diff]
> patch for freebsd-sources-9.0.ebuild
> 
> When you apply this patch, the kernel was compiled with gcc 4.4 or later
> versions will be able to boot.
> 
> Another workaround is to use gcc 4.3 to compile the kernel.

applied something like that : debian builds their kfreebsd kernel with -O1, so i've changed the -O2 to -O1. thanks!
Comment 5 Richard Yao (RETIRED) gentoo-dev 2012-05-27 08:46:14 UTC
Clang compiles the kernel without any problems when -O2 is set. I have revised aballier's patch in sys-freebsd/freebsd-sources-r2 to narrow its scope to GCC.
Comment 6 Yuta SATOH 2012-05-27 15:15:15 UTC
(In reply to comment #5)
> Clang compiles the kernel without any problems when -O2 is set. I have
> revised aballier's patch in sys-freebsd/freebsd-sources-r2 to narrow its
> scope to GCC.

I think your patch have a problem.
cc instead of gcc is run by default when you compile the kernel.

I changed your patch as follows. And, -O1 have been added to the results.

-+.if ${CC:T:Mgcc} == "gcc" && !empty(COPTFLAGS:M-O[23s])
++.if ${CC} != "clang" && !empty(CFLAGS:M-O[23s])
Comment 7 Richard Yao (RETIRED) gentoo-dev 2012-05-27 15:23:58 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Clang compiles the kernel without any problems when -O2 is set. I have
> > revised aballier's patch in sys-freebsd/freebsd-sources-r2 to narrow its
> > scope to GCC.
> 
> I think your patch have a problem.
> cc instead of gcc is run by default when you compile the kernel.
> 
> I changed your patch as follows. And, -O1 have been added to the results.
> 
> -+.if ${CC:T:Mgcc} == "gcc" && !empty(COPTFLAGS:M-O[23s])
> ++.if ${CC} != "clang" && !empty(CFLAGS:M-O[23s])

You are right. sys-freebsd/freebsd-sources-r3 was committed to change that to `${CC:T:Mclang} != "clang"`.