Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: nacl/arm build is failing #11956

Closed
davecheney opened this issue Jul 31, 2015 · 11 comments
Closed

runtime: nacl/arm build is failing #11956

davecheney opened this issue Jul 31, 2015 · 11 comments
Labels
FrozenDueToAge OS-NaCl GOOS=nacl, Native Client, removed in Go 1.14
Milestone

Comments

@davecheney
Copy link
Contributor

The nacl/arm build has been failing for some time, this has been exacerbated by the irregularity of access to a nacl/arm builder (which cannot currently be run by our build farm on scaleway)

http://build.golang.org/log/01c873c2363df1c651e2f3ac0114b2a6bb46058e

The ./make.bash stage completes, but every binary produced fails to run under sel_ldr_arm.

Various attempts to debug this, or coax more information out of sel_ldr_arm have failed.

Here is some debugging output using pepper44 (previously tried with pepper41 with the same result)

[root@alarm src]# env GOOS=nacl GOARCH=arm go test -x -v bufio
WORK=/tmp/go-build079271012
mkdir -p $WORK/bufio/_test/
mkdir -p $WORK/bufio/_test/_obj_test/
cd /root/go/src/bufio
/root/go/pkg/tool/linux_arm/compile -o $WORK/bufio/_test/bufio.a -trimpath $WORK -p bufio -complete -buildid e9988b6efe45138d111b0061dcbb0afd2144d4d0 -D _/root/go/src/bufio -I $WORK -pack ./bufio.go ./scan.go ./export_test.go
mkdir -p $WORK/bufio/_test/_obj_xtest/
/root/go/pkg/tool/linux_arm/compile -o $WORK/bufio/_test/bufio_test.a -trimpath $WORK -p bufio_test -complete -D _/root/go/src/bufio -I $WORK/bufio/_test -I $WORK -pack ./bufio_test.go ./example_test.go ./scan_test.go
cd $WORK/bufio/_test
/root/go/pkg/tool/linux_arm/compile -o ./main.a -trimpath $WORK -p main -complete -D "" -I . -I $WORK -pack ./_testmain.go
cd .
/root/go/pkg/tool/linux_arm/link -o $WORK/bufio/_test/bufio.test -L $WORK/bufio/_test -L $WORK -w -extld=gcc -buildmode=exe $WORK/bufio/_test/main.a
/root/bin/go_nacl_arm_exec $WORK/bufio/_test/bufio.test -test.v=true
++ go env
+ eval 'GOARCH="arm"' 'GOBIN=""' 'GOEXE=""' 'GOHOSTARCH="arm"' 'GOHOSTOS="linux"' 'GOOS="nacl"' 'GOPATH="/root"' 'GORACE=""' 'GOROOT="/root/go"' 'GOTOOLDIR="/root/go/pkg/tool/linux_arm"' 'GO15VENDOREXPERIMENT=""' 'CC="gcc"' 'GOGCCFLAGS="-fPIC' -marm '-fmessage-length=0"' 'CXX="g++"' 'CGO_ENABLED="0"'
++ GOARCH=arm
++ GOBIN=
++ GOEXE=
++ GOHOSTARCH=arm
++ GOHOSTOS=linux
++ GOOS=nacl
++ GOPATH=/root
++ GORACE=
++ GOROOT=/root/go
++ GOTOOLDIR=/root/go/pkg/tool/linux_arm
++ GO15VENDOREXPERIMENT=
++ CC=gcc
++ GOGCCFLAGS='-fPIC -marm -fmessage-length=0'
++ CXX=g++
++ CGO_ENABLED=0
+ export NACLENV_GOARCH=arm
+ NACLENV_GOARCH=arm
+ export NACLENV_GOOS=nacl
+ NACLENV_GOOS=nacl
+ export NACLENV_GOROOT=/go
+ NACLENV_GOROOT=/go
++ pwd
++ sed 's;/root/go;/go;'
+ export NACLENV_NACLPWD=/go/src/bufio
+ NACLENV_NACLPWD=/go/src/bufio
++ which sel_ldr_arm
+ exec nacl_helper_bootstrap_arm /root/bin/sel_ldr_arm -v -v -v -v --reserved_at_zero=0xXXXXXXXXXXXXXXXX -l /dev/null -S -e /tmp/go-build079271012/bufio/_test/bufio.test -test.v=true
[18590,1992093696:00:25:59.843452] NaClHandleReservedAtZero: Could not parse reserved_at_zero argument value of 0xXXXXXXXXXXXXXXXX
POST-ABORT: LOG_FATAL abort exit
signal: aborted (core dumped)
FAIL    bufio   0.098s
@davecheney davecheney added the OS-NaCl GOOS=nacl, Native Client, removed in Go 1.14 label Jul 31, 2015
@davecheney davecheney added this to the Go1.5 milestone Jul 31, 2015
@davecheney
Copy link
Contributor Author

--reserved_at_zero=0xXXXXXXXXXXXXXXXX must be the first argument to sel_ldr_arm for the helper to detect it properly, so the error about parsing was due to the extra -v's I added. With that corrected, the output is now.

+ exec nacl_helper_bootstrap_arm /root/bin/sel_ldr_arm --reserved_at_zero=0xXXXXXXXXXXXXXXXX -v -v -v -v -l /dev/null -S -e /tmp/go-build551330618/bufio/_test/bufio.test -test.v=true
sel_ldr argument list:
/root/bin/sel_ldr_arm --reserved_at_zero=0x0000000040002000 -v -v -v -v -l /dev/null -S -e /tmp/go-build551330618/bufio/_test/bufio.test -test.v=true
Dumping vmmap.
In PrintVmmap
Done.
exit status 1
FAIL    bufio   0.273s

@davecheney
Copy link
Contributor Author

Ahh, it's a validation failure (maybe we shouldn't pass -l /dev/null ?)

https://gist.github.com/davecheney/f56e28ca4573f241d9fc

@davecheney
Copy link
Contributor Author

Here are the offending instructions

   0x001b5e54 <+84>:    ldr     r11, [pc, #1836]        ; 0x1b6588 <runtime/pprof.writeHeap+1928>
   0x001b5e58 <+88>:    str     r0, [sp, r11]                  <<<< this one
   0x001b5e5c <+92>:    ldr     r11, [pc, #1832]        ; 0x1b658c <runtime/pprof.writeHeap+1932>
   0x001b5e60 <+96>:    str     r0, [sp, r11]                  <<<<< and this one

@rsc
Copy link
Contributor

rsc commented Jul 31, 2015

FWIW in the old versions of NaCl, if you didn't pass -l /dev/null then you got stderr spam every time you ran a program, which breaks output tests. So you had to take it off explicitly when you wanted the output, but leave it there by default. Maybe that's fixed (I did report the problem), but maybe not. I haven't checked recently.

@davecheney
Copy link
Contributor Author

@rsc, pepper44 has some nice new debug flags, including a -q. I'll leave the fettling of the nacl helper scripts for 1.6.

Via the build dashboard I have chased this back to 79986e2, but I think this commit was just unlucky, not the cause.

@rsc
Copy link
Contributor

rsc commented Jul 31, 2015

Yes, that commit just made the stack frame big enough to hit the bug.

@davecheney
Copy link
Contributor Author

Yup, that'll be the problem. Note the lack of BIC instructions to mask off the store address.

   0x001b5e38 <+56>:    ldr     r11, [pc, #1860]        ; 0x1b6584 <runtime/pprof.writeHeap+1924>
   0x001b5e3c <+60>:    add     r1, sp, r11
   0x001b5e40 <+64>:    add     r2, r1, #32
   0x001b5e44 <+68>:    bic     r1, r1, #-1073741824    ; 0xc0000000     <<< GOOD
   0x001b5e48 <+72>:    str     r0, [r1], #4
   0x001b5e4c <+76>:    cmp     r2, r1
   0x001b5e50 <+80>:    bne     0x1b5e44 <runtime/pprof.writeHeap+68>
   0x001b5e54 <+84>:    ldr     r11, [pc, #1836]        ; 0x1b6588 <runtime/pprof.writeHeap+1928>
   0x001b5e58 <+88>:    str     r0, [sp, r11]           <<< OOPS, no BIC r11, r11, n
   0x001b5e5c <+92>:    ldr     r11, [pc, #1832]        ; 0x1b658c <runtime/pprof.writeHeap+1932>
   0x001b5e60 <+96>:    str     r0, [sp, r11]
   0x001b5e64 <+100>:   mov     r0, #0

@rsc
Copy link
Contributor

rsc commented Jul 31, 2015

First two: https://go-review.googlesource.com/13010 and https://go-review.googlesource.com/13011.
Running nacltest.bash on my ARM Chromebook now.

@gopherbot
Copy link

CL https://golang.org/cl/13010 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/13011 mentions this issue.

rsc added a commit that referenced this issue Jul 31, 2015
For #11956.

Change-Id: Ic9b57cafa197953cc7f435941e44d42b60b3ddf0
Reviewed-on: https://go-review.googlesource.com/13011
Reviewed-by: Dave Cheney <dave@cheney.net>
rsc added a commit that referenced this issue Jul 31, 2015
The code already fixed large non-stack offsets
but explicitly excluded stack references.
Perhaps you could get away with that before,
but current versions of nacl reject such stack
references. Rewrite them the same as the others.

For #11956 but probably not the last problem.

Change-Id: I0db4e3a1ed4f88ccddf0d30228982960091d9fb7
Reviewed-on: https://go-review.googlesource.com/13010
Reviewed-by: Dave Cheney <dave@cheney.net>
@davecheney
Copy link
Contributor Author

Fixed. See #11961 for followup work.

@golang golang locked and limited conversation to collaborators Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge OS-NaCl GOOS=nacl, Native Client, removed in Go 1.14
Projects
None yet
Development

No branches or pull requests

3 participants