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: TestAsyncPreempt failed on linux/arm64 and amd64 #35608

Closed
shawndx opened this issue Nov 15, 2019 · 6 comments
Closed

runtime: TestAsyncPreempt failed on linux/arm64 and amd64 #35608

shawndx opened this issue Nov 15, 2019 · 6 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@shawndx
Copy link
Contributor

shawndx commented Nov 15, 2019

What version of Go are you using (go version)?

$ go version
go version devel +3f21c2381d Thu Nov 14 01:57:00 2019 +0000 linux/arm64

The issue was observed on linux/amd64 as well, so far the initial analysis is made on linux/arm64 only.

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/home/xiaji01/.cache/go-build"
GOENV="/home/xiaji01/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/xiaji01/.go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/xiaji01/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/xiaji01/go/pkg/tool/linux_arm64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/xiaji01/go/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build634223204=/tmp/go-build -gno-record-gcc-switches"

What did you do?

build and run package testing with the latest code.

What did you expect to see?

The case pass on all linux/arm64 and linux/amd64 platforms.

What did you see instead?

ok regexp/syntax 0.757s

--- FAIL: TestAsyncPreempt (60.01s)

crash_test.go:95: testprog AsyncPreempt exit status: exit status 2

proc_test.go:367: want OK

    , got SIGQUIT: quit

    PC=0xcb088 m=0 sigcode=0

    

    goroutine 7 [running]:

    main.frameless()

    	/root/ci-scripts/golang/src/runtime/testdata/testprog/preempt.go:56 +0x8 fp=0x40000cafc0 sp=0x40000cafc0 pc=0xcb088

    main.AsyncPreempt.func2(0x400001c154)

    	/root/ci-scripts/golang/src/runtime/testdata/testprog/preempt.go:36 +0x2c fp=0x40000cafd0 sp=0x40000cafc0 pc=0xce5ac

    runtime.goexit()

    	/home/root/ci-scripts/golang/src/runtime/asm_arm64.s:1148 +0x4 fp=0x40000cafd0 sp=0x40000cafd0 pc=0x6ae94

    created by main.AsyncPreempt

    	/root/ci-scripts/golang/src/runtime/testdata/testprog/preempt.go:34 +0xa8

    

    goroutine 1 [runnable]:

    runtime.Gosched(...)

    	/home/root/ci-scripts/golang/src/runtime/proc.go:269

    main.AsyncPreempt()

    	/root/ci-scripts/golang/src/runtime/testdata/testprog/preempt.go:42 +0xc8

    main.main()

    	/root/ci-scripts/golang/src/runtime/testdata/testprog/main.go:34 +0x194

    

    goroutine 6 [runnable]:

    main.AsyncPreempt.func1(0x400001c150)

    	/root/ci-scripts/golang/src/runtime/testdata/testprog/preempt.go:28

    created by main.AsyncPreempt

    	/root/ci-scripts/golang/src/runtime/testdata/testprog/preempt.go:26 +0x88

    

    r0      0x8e847c962

    r1      0xab9f639d053fa011

    r2      0x40000cafd0

    r3      0x0

    r4      0x40000ca800

    r5      0x40000013b8

    r6      0xce580

    r7      0x400001c154

    r8      0x1e7940

    r9      0x0

    r10     0x0

    r11     0x1bdea0

    r12     0x129068

    r13     0x0

    r14     0xf1

    r15     0x0

    r16     0x0

    r17     0x30

    r18     0x0

    r19     0xd0

    r20     0xffffe970c920

    r21     0x1e7940

    r22     0x4000002000

    r23     0x0

    r24     0x0

    r25     0x0

    r26     0x112288

    r27     0x4000000000000000

    r28     0x4000001380

    r29     0x40000cafb8

    lr      0xce5ac

    sp      0x40000cafc0

    pc      0xcb088

    fault   0x0

FAIL

@shawndx
Copy link
Contributor Author

shawndx commented Nov 15, 2019

The issue was observed on specific arm64 and amd64 machines only, 'frameless' is interrupted at consistent addresses which are considered to be non-safe every time upon preemption.

// arm64 machine
Architecture: aarch64
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Thread(s) per core: 1
Core(s) per socket: 32
Socket(s): 1
NUMA node(s): 1
Vendor ID: APM
Model: 2
Model name: X-Gene
Stepping: 0x3
BogoMIPS: 80.00
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
NUMA node0 CPU(s): 0-31
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid

// amd64 machine (just for your reference, I haven't made analysis on it)
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 2
NUMA node(s): 8
Vendor ID: AuthenticAMD
CPU family: 23
Model: 1
Model name: AMD EPYC 7251 8-Core Processor
Stepping: 2
CPU MHz: 2096.019
CPU max MHz: 2100.0000
CPU min MHz: 1200.0000
BogoMIPS: 4192.26
Virtualization: AMD-V
L1d cache: 32K
L1i cache: 64K
L2 cache: 512K
L3 cache: 4096K
NUMA node0 CPU(s): 0,1,16,17
NUMA node1 CPU(s): 2,3,18,19
NUMA node2 CPU(s): 4,5,20,21
NUMA node3 CPU(s): 6,7,22,23
NUMA node4 CPU(s): 8,9,24,25
NUMA node5 CPU(s): 10,11,26,27
NUMA node6 CPU(s): 12,13,28,29
NUMA node7 CPU(s): 14,15,30,31
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid amd_dcm aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca

@shawndx
Copy link
Contributor Author

shawndx commented Nov 15, 2019

@cherrymui

@ianlancetaylor ianlancetaylor added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Nov 15, 2019
@ianlancetaylor ianlancetaylor added this to the Go1.14 milestone Nov 15, 2019
@mwhudson
Copy link
Contributor

I am seeing this in my go-tip snap builds too.

@cherrymui
Copy link
Member

The functions being tested, although preemptible, may be preemptible only on small ranges of PCs, especially on architectures where we use REGTMP for returning from the injected call. It is possible that in some unlucky runs all the signals land on the non-preemptible ranges. We can relax the test a little bit, making it more preemptible.

With CL http://golang.org/cl/208126 and http://golang.org/cl/208217, it will not be a problem. But maybe not this cycle.

@gopherbot
Copy link

Change https://golang.org/cl/208221 mentions this issue: runtime: relax TestAsyncPreempt

@golang golang locked and limited conversation to collaborators Nov 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Projects
None yet
Development

No branches or pull requests

6 participants