Re: i386 Go programs crash on amd64
On Mon, May 26, 2014 at 09:36:22PM +1000, Peter Jeremy wrote: > On 2014-May-24 10:41:01 +0300, Konstantin Belousov > wrote: > >> >Provide the minimal test case. > >> > >> The following go program, compiled on i386 and run on amd64 will die > >> with a segmentation violation or bus error: > >> --- > >> package main > >> > >> import "fmt" > >> > >> func main() { > >> fmt.Println("Hello World") > >> } > >> --- > >No, this is not consumable. > > > >I need a self-contained minimal example written in C/asm. > > Actually, I've found that > > package main > import "syscall" > func main() { syscall.Write(1, []byte("Hello World\n")) } > > also crashes ~66 syscalls after the first sysarch(2) call. That > reduces the binary to 520K (go reports this is 50K lines of assembler). > > >If this is too hard to produce, give the the self-contained > >binary, again as small as possible (small by comparing the > >number of syscalls before the issue manifests itself). > > I've uploaded the source, binary and disassembly to > freefall:~peterj/write{.go,,.S} (and verified it crashes). > > If I get time, I'll see if I can strip some of the support code out of > Go to shrink it further. What exactly do you mean by 'crashing' ? I see some spills from (probably) Go runtime. I am not sure that this is something which should be looked at from the kernel side, at least initially. E.g., the 32bit binaries on amd64 have stack starting near the top of the address space, i.e. 4G - some amount. Could this be a problem for the Go ? What I see is: pooma% ./write-go ~/build/bsd/DEV/stuff/tests runtime: newstack called from g=0x382d5500 m=0x382e5800 m->curg=0x0 m->g0=0x382d55a0 m->gsignal=0x382d5500 fatal error: runtime: wrong goroutine in newstack runtime stack: runtime.throw(0x8096910) /usr/local/go/src/pkg/runtime/panic.c:464 +0x5f runtime.newstack() /usr/local/go/src/pkg/runtime/stack.c:212 +0x90 runtime.morestack() /usr/local/go/src/pkg/runtime/asm_386.s:246 +0x5e Hello World goroutine 1 [panicwait]: runtime.park(0x0, 0x0, 0x8097b74) /usr/local/go/src/pkg/runtime/proc.c:1342 +0x59 runtime.main() /usr/local/go/src/pkg/runtime/proc.c:229 +0x125 runtime.goexit() /usr/local/go/src/pkg/runtime/proc.c:1394 [1]1537 segmentation fault (core dumped) ./write-go pgpqgcSgetWJG.pgp Description: PGP signature
Re: i386 Go programs crash on amd64
On 2014-May-24 10:41:01 +0300, Konstantin Belousov wrote: >> >Provide the minimal test case. >> >> The following go program, compiled on i386 and run on amd64 will die >> with a segmentation violation or bus error: >> --- >> package main >> >> import "fmt" >> >> func main() { >> fmt.Println("Hello World") >> } >> --- >No, this is not consumable. > >I need a self-contained minimal example written in C/asm. Actually, I've found that package main import "syscall" func main() { syscall.Write(1, []byte("Hello World\n")) } also crashes ~66 syscalls after the first sysarch(2) call. That reduces the binary to 520K (go reports this is 50K lines of assembler). >If this is too hard to produce, give the the self-contained >binary, again as small as possible (small by comparing the >number of syscalls before the issue manifests itself). I've uploaded the source, binary and disassembly to freefall:~peterj/write{.go,,.S} (and verified it crashes). If I get time, I'll see if I can strip some of the support code out of Go to shrink it further. -- Peter Jeremy pgp4BZhTk0VMY.pgp Description: PGP signature
Current problem reports assigned to freebsd-amd64@FreeBSD.org
Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description o amd64/190061 amd64 Losing ability to click in X11 o amd64/190050 amd64 [ahci] AHCI does not detect Plextor M6e PCI-Express SS o amd64/189747 amd64 HP G71 Notebook amd64 bootonly loader panics immedatel o amd64/189726 amd64 microphone not working on 9.2 and 10.0 o amd64/189404 amd64 msk0:watch dog time out o amd64/189267 amd64 [cpufreq] AMD Kabini (AM1/FM1Sb) Frequency Switching C o amd64/189264 amd64 [boot] FreeBSD 9.2 and 10.0 does not boot on Tyan Thun o amd64/188877 amd64 [amdpm] powernow doesn't attach on AMD G-T40E o amd64/188699 amd64 Dev tree o amd64/188504 amd64 system is overheating o amd64/187488 amd64 Freebsd 10 install kernel rebooting the machine. o amd64/186694 amd64 samba not work in domain o amd64/186291 amd64 [build] Compilation fail when "device pst" in kernel c o amd64/186114 amd64 MPD5.7 umtxn o amd64/186038 amd64 [panic] FreeBSD 10/AMD64 panics on HP Proliant Microse o amd64/185930 amd64 system freeze after kldload vmm.ko o amd64/185823 amd64 Checksum Error of base.txz during install o amd64/185623 amd64 [install] freebsd 10.0-RC5 fresh install does not boot o amd64/185003 amd64 [panic] Random kernel panics o amd64/184718 amd64 HP MicroServer N40L, WOL packet doesn't wake up the co o amd64/183823 amd64 error when system start o amd64/183789 amd64 Upgrading to FreeBSD-10.0-BETA3 Breaks Portmaster DB o amd64/183242 amd64 don't install pcBSD on GA-MA78GM-S2H (rev. 1.0) 2gb o amd64/182686 amd64 bios lost HDD after installing freebsd-9.x o amd64/181358 amd64 [suspend/resume] Suspend to RAM not working correctly o amd64/181357 amd64 LCD Brightness Control not working on Lenovo X121e (AC o amd64/181282 amd64 3h of work on battery on FreeBSD while 10h on Windows o amd64/180862 amd64 [install] Installing FreeBSD 9.1 (AMD64 DVD) and then o amd64/180562 amd64 [amdtemp] amdtemp and ACPI not working with motherboar o amd64/180018 amd64 [panic] System panics when bsnmpd is started o amd64/179556 amd64 FreeBSD 9-1 amd64 - Install freeze on HP Proliant DL58 o amd64/179376 amd64 xhci ehci irq storm o amd64/179288 amd64 unable to install on HP ProLiant DL380p Gen8 with 128G o amd64/179282 amd64 [amd64] [patch] add Intel SMAP for FreeBSD-CURRENT o amd64/179038 amd64 instant reboot doesnt even try too install o amd64/178792 amd64 -march=native fails with clang on certain CPU's o amd64/178357 amd64 [amd64] [patch] export CPU physical and virtual addres o amd64/176835 amd64 Fatal trap 12: page fault while in kernel mode o amd64/176474 amd64 kernel panic o amd64/175725 amd64 Audio through USB has not as good hi quality as it has o amd64/175655 amd64 When enabled tty console OS hang during boot o amd64/175370 amd64 kernel panic the rebuild kernel with vimage options in o amd64/175282 amd64 Freebsd 9.1 release amd64, mb Intel D525MW, not worked o amd64/175129 amd64 [suspend/resume] laptop won't suspend on lid close o amd64/174679 amd64 Intel i5 laptop overheats and shuts down [regression] o amd64/173680 amd64 9.1rc3 installer hangs at "rootpass" o amd64/173502 amd64 Patch inhibition of warnings that appear in the combin o amd64/173465 amd64 FreeBSD 9.1 restarts in random fashion after upgrade t o amd64/173311 amd64 FreeBSD 9.1 RC2 , 12 servers restart in random fashion o amd64/172926 amd64 [boot] booting hangs after 9.1-RC2 install in 2nd (MBR o amd64/171835 amd64 bsdinstall abort on Dell PowerEdge R420 with PERC H310 o amd64/171814 amd64 [panic] bioq_init or bioq_remove (unsure which) o amd64/171250 amd64 ldd32 cannot find some i386 libraries o amd64/170487 amd64 [boot] Thinkpad X61s cannot boot 9.1-BETA1 o amd64/170351 amd64 [kernel] [patch] amd64: 64-bit process can't always ge o amd64/170115 amd64 Serial boot broken in 9.0 o amd64/168659 amd64 [boot] FreeBSD 9 - Crash upon booting off install CD ( o amd64/167582 amd64 Compile of MySQL NDB Cluster Fails 8.2 AMD64 o amd64/167543 amd64 [kernel] Install FreeBSD can show error message with c o amd64/167393 amd64 [boot] MacBook4,1 hangs on SMP boot o amd64/166639 amd64 [boot] Syscons issue Intel D2700 o amd64/166229 amd64 [boot] Unable to install FreeBSD 9 on Acer Extensa 522 o amd64/165850 amd64 [build] 8.3-RC1 (amd64): world doesn't build with CPUT o amd64/165845 amd64 [build] Unable to build kernel on 8.2-STABLE o amd64/165351 amd64 [boo