Thanks,
Varialus
--
---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
All I want for Christmas is to be able to program in Go (with gc and cgo) on DragonFly BSD. I've started porting Go and I can both fix easy errors and clean up my code once I'm done making a mess of it, but when it comes to tough C and assembly errors, although I'm probably technically capable of eventually figuring them out, from a practical perspective my aversion to those languages prevents it from actually happening. So could somebody help me resolve my current error? DragonFly BSD installs very quickly in VirtualBox and I've posted information about the error at the following address. https://github.com/varialus/godfly/
does it have strace? it would probably help debugging this.
Same error. :-( I pulled a lot more code directly from dfly this time and I was really hoping it would fly past without triggering the error. I did notice that sys/kern/syscalls.master has a set_tls_area() function. I tried to comment the places where I copied code from the FreeBSD port of Go. I ran that truss program and got the following output. I'm retyping the error, so there may be typos, but I'll try to avoid them.bash-4.2# truss ../pkg/tool/dragonfly_amd64/go_bootstrap clean -i stdopen("/proc/curproc/mem",0x1,0400032600400) = 3 (0x3)fcntl(0x3,0x2,0x1) = 0 (0x0)ioctl(3,PIOCBIS,0x21) = 0 (0x0)ioctl(3,PIOCSFL,0x1) = 0 (0x0)execve(<missing argument>,<missing argument>,<missing argument>)sysarch(0x81,0x7ffffffff640)SIGNAL 11SIGNAL 11Process stopped because of: 16process exit, rval = 139Segmentation fault: 11bash-4.2# Aug 17 07:37:51 kernel: pid 22655 (go_bootstrap), uid 0: exited on signal 11 (core dumped)Aug 17 07:37:51 kernel: pid 22654 (truss), uid 0: exited on signal 11I stayed up all night because I hoped that my current effort would prevent this error. Please help!
check out with gdb from where execve is called and from where sysarch is calledwhy does execve say missing argument? this is quite suspiciouscheck that 0x81 is the correct sysarch numbercheck that address passed to sysarch is addressable
Most current truss versions have a -f option. If the DragonFly one
supports -f, use it.
Ian
I'm not very familiar with Google Groups or writing to mailing lists. This reply is intended for both Dmitry and Ian.Dmitry, I don't know assembly pretty much at all. I very likely could have done that part incorrectly. I'll try to figure out how to do what you suggest tomorrow.On Saturday, August 17, 2013 8:10:33 AM UTC-6, Dmitry Vyukov wrote:check out with gdb from where execve is called and from where sysarch is calledwhy does execve say missing argument? this is quite suspiciouscheck that 0x81 is the correct sysarch numbercheck that address passed to sysarch is addressable
On Saturday, August 17, 2013 8:12:57 AM UTC-6, Ian Lance Taylor wrote:
Most current truss versions have a -f option. If the DragonFly one
supports -f, use it.
IanIan, it does not support the -f option. If I can simply re-compile an newer version I'll try that tomorrow, but if it's a customized port, I may not get that done.
Thanks,Alex
--
OK, now it's clear that this piece of code needs to be changed for dragonfly:// set tls base to DITEXT runtime·settls(SB),NOSPLIT,$8ADDQ $16, DI // adjust for ELF: wants to use -16(FS) and -8(FS) for g and mMOVQ DI, 0(SP)MOVQ SP, SIMOVQ $129, DI // AMD64_SET_FSBASEMOVQ $165, AX // sysarchSYSCALLJCC 2(PC)MOVL $0xf1, 0xf1 // crashRETAt best you just need to change the $129 constant. I don't know where dragonfly syscall are described.Another possibility isthat threads work differently -- runtime·thr_start expects to receive pointer to M in DI register. 0x7ffffffff640 does not look completely wrong, but it may be...
The go binary now builds and the tests start running, but many tests fail and I think one test gets stuck, but I suppose it could just be taking a really long time. Yesterday it turned out that the build was not without errors, it just wasn't crashing on errors. As soon as I fixed all the errors, the tests started running.