Skip to content

runtime: SIGILL: illegal instruction #13735

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

Closed
matwey opened this issue Dec 26, 2015 · 9 comments
Closed

runtime: SIGILL: illegal instruction #13735

matwey opened this issue Dec 26, 2015 · 9 comments
Milestone

Comments

@matwey
Copy link

matwey commented Dec 26, 2015

Hello, I use go 1.5.2 and trying to build x/crypto from master. I see the following:

[   67s] /usr/lib64/go/pkg/tool/linux_amd64/link -o $WORK/golang.org/x/crypto/pkcs12/internal/rc2/_test/rc2.test -L $WORK/golang.org/x/crypto/pkcs12/internal/rc2/_test -L $WORK -w -extld=gcc -buildmode=exe $WORK/golang.org/x/crypto/pkcs12/internal/rc2/_test/main.a
[   68s] SIGILL: illegal instruction
[   68s] PC=0x7ffd07d7ac99 m=5
[   68s] 
[   68s] goroutine 0 [idle]:
[   68s] 
[   68s] goroutine 3 [running]:
[   68s] runtime.systemstack_switch()
[   68s]    /usr/lib64/go/src/runtime/asm_amd64.s:216 fp=0xc820028f58 sp=0xc820028f50
[   68s] runtime.gosweepone(0x1)
[   68s]    /usr/lib64/go/src/runtime/mgcsweep.go:110 +0x3d fp=0xc820028f80 sp=0xc820028f58
[   68s] runtime.bgsweep(0xc820016070)
[   68s]    /usr/lib64/go/src/runtime/mgcsweep.go:54 +0xb6 fp=0xc820028fb8 sp=0xc820028f80
[   68s] runtime.goexit()
[   68s]    /usr/lib64/go/src/runtime/asm_amd64.s:1721 +0x1 fp=0xc820028fc0 sp=0xc820028fb8
[   68s] created by runtime.gcenable
[   68s]    /usr/lib64/go/src/runtime/mgc.go:206 +0x53
[   68s] 
[   68s] goroutine 1 [chan receive]:
[   68s] testing.RunTests(0x5d41f8, 0x65e940, 0x3, 0x3, 0xc82000a701)
[   68s]    /usr/lib64/go/src/testing/testing.go:562 +0x8ad
[   68s] testing.(*M).Run(0xc820047f08, 0xc82000a740)
[   68s]    /usr/lib64/go/src/testing/testing.go:494 +0x70
[   68s] main.main()
[   68s]    golang.org/x/crypto/cast5/_test/_testmain.go:58 +0x116
[   68s] 
[   68s] goroutine 6 [runnable]:
[   68s] golang.org/x/crypto/cast5.(*Cipher).Encrypt(0xc82048c280, 0xc82000a840, 0x8, 0x10, 0xc82000a840, 0x8, 0x10)
[   68s]    /home/abuild/rpmbuild/BUILD/go/src/golang.org/x/crypto/cast5/cast5.go:33
[   68s] golang.org/x/crypto/cast5.iterate(0xf4240, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
[   68s]    /home/abuild/rpmbuild/BUILD/go/src/golang.org/x/crypto/cast5/cast5_test.go:84 +0x2b6
[   68s] golang.org/x/crypto/cast5.TestFull(0xc820096090)
[   68s]    /home/abuild/rpmbuild/BUILD/go/src/golang.org/x/crypto/cast5/cast5_test.go:60 +0x69
[   68s] testing.tRunner(0xc820096090, 0x65e958)
[   68s]    /usr/lib64/go/src/testing/testing.go:456 +0x98
[   68s] created by testing.RunTests
[   68s]    /usr/lib64/go/src/testing/testing.go:561 +0x86d
[   68s] 
[   68s] rax    0x3a
[   68s] rbx    0x1
[   68s] rcx    0x7f3134976d38
[   68s] rdx    0x2
[   68s] rdi    0x1
[   68s] rsi    0xc820065c40
[   68s] rbp    0xc820065c30
[   68s] rsp    0xc820065c00
[   68s] r8     0x668440
[   68s] r9     0x7f3134976d98
[   68s] r10    0x0
[   68s] r11    0x202
[   68s] r12    0x706a
[   68s] r13    0xc820065c0c
[   68s] r14    0x9d8b400000000
[   68s] r15    0x8
[   68s] rip    0x7ffd07d7ac99
[   68s] rflags 0x10246
[   68s] cs     0x33
[   68s] fs     0x0
[   68s] gs     0x0
[   68s] FAIL   golang.org/x/crypto/cast5   11.346s
[   68s] ok     golang.org/x/crypto/curve25519  0.032s
[   68s] ok     golang.org/x/crypto/hkdf    0.010s
[   68s] ok     golang.org/x/crypto/md4 0.018s
[   68s] ok     golang.org/x/crypto/nacl/box    0.027s
[   68s] ok     golang.org/x/crypto/nacl/secretbox  0.022s
[   68s] ok     golang.org/x/crypto/ocsp    0.049s
[   68s] ok     golang.org/x/crypto/openpgp 1.752s
[   68s] ok     golang.org/x/crypto/openpgp/armor   0.006s
[   68s] ok     golang.org/x/crypto/openpgp/clearsign   0.099s
[   68s] ok     golang.org/x/crypto/openpgp/elgamal 0.080s
[   68s] ?      golang.org/x/crypto/openpgp/errors  [no test files]
@ianlancetaylor ianlancetaylor changed the title x/crypto/cast5: SIGILL: illegal instruction runtime: SIGILL: illegal instruction Dec 26, 2015
@ianlancetaylor
Copy link
Member

Is this repeatable? This looks like a crash in the runtime during GC. The PC value is strange, though. What processor are you using?

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Dec 26, 2015
@matwey
Copy link
Author

matwey commented Dec 28, 2015

This issue is transient. CPU is

[   53s] processor  : 0
[   53s] vendor_id  : AuthenticAMD
[   53s] cpu family : 16
[   53s] model      : 9
[   53s] model name : AMD Opteron(tm) Processor 6180 SE
[   53s] stepping   : 1
[   53s] microcode  : 0x1000065
[   53s] cpu MHz        : 2499.853
[   53s] cache size : 512 KB
[   53s] physical id    : 0
[   53s] siblings   : 1
[   53s] core id        : 0
[   53s] cpu cores  : 1
[   53s] apicid     : 0
[   53s] initial apicid : 0
[   53s] fpu        : yes
[   53s] fpu_exception  : yes
[   53s] cpuid level    : 5
[   53s] wp     : yes
[   53s] flags      : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb lm 3dnowext 3dnow rep_good nopl extd_apicid pni cx16 x2apic popcnt hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw npt nrip_save vmmcall
[   53s] bugs       : tlb_mmatch fxsave_leak sysret_ss_attrs
[   53s] bogomips   : 4999.70
[   53s] TLB size   : 1024 4K pages
[   53s] clflush size   : 64
[   53s] cache_alignment    : 64
[   53s] address sizes  : 42 bits physical, 48 bits virtual
[   53s] power management:

@rsc
Copy link
Contributor

rsc commented Jan 13, 2016

/cc @aclements

This reminds me of the mcall bug that led to this big comment, but that comment does not apply here:

// mcall switches from the g to the g0 stack and invokes fn(g),
// where g is the goroutine that made the call.
// mcall saves g's current PC/SP in g->sched so that it can be restored later.
// It is up to fn to arrange for that later execution, typically by recording
// g in a data structure, causing something to call ready(g) later.
// mcall returns to the original goroutine g later, when g has been rescheduled.
// fn must not return at all; typically it ends by calling schedule, to let the m
// run other goroutines.
//
// mcall can only be called from g stacks (not g0, not gsignal).
//
// This must NOT be go:noescape: if fn is a stack-allocated closure,
// fn puts g on a run queue, and g executes before fn returns, the
// closure will be invalidated while it is still executing.

Nonetheless, it seems like somehow systemstack has jumped to the wrong code, perhaps because the closure is corrupt. I wondered if maybe the stack was being shrunk but I don't see how that would be allowed before systemstack got a chance to do its jump.

@aclements
Copy link
Member

@rsc, @matwey's other SIGILL report from gogo/protobuf#131 doesn't have a systemstack in it.

@matwey, since you've been able to reproduce this multiple times, could you post a few more failures? Then we can look for patterns.

@matwey
Copy link
Author

matwey commented Jan 14, 2016

I wouldn't say that I am able to reproduce this on demand, but when I will see similar issue again I will attach the trace here.

@rsc
Copy link
Contributor

rsc commented Jan 27, 2016

Also please export GOTRACEBACK=system in your environment, which will give us more information if you can reproduce the problem again. Thanks.

@rsc rsc modified the milestones: Go1.7, Go1.6 Jan 27, 2016
@aclements
Copy link
Member

@matwey, have you seen this recently (in particular, with a more recent Go than 1.5.2)?

@matwey
Copy link
Author

matwey commented May 16, 2016

I am planning to test with 1.6. But unfortunately, I can not retest right now. So, if you are concerned about open issue, please close this, I'll reopen when/if the issue appears with 1.6

@aclements
Copy link
Member

@matwey, sounds good. Thanks for the update.

@golang golang locked and limited conversation to collaborators May 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants