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

cmd/link: panic with index out of range in cmd/link/internal/loader.(*Loader).resolve #62355

Open
gopherbot opened this issue Aug 29, 2023 · 8 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@gopherbot
Copy link
Contributor

gopherbot commented Aug 29, 2023

#!watchflakes
post <- log ~ `panic: runtime error: index out of range` && log ~ `^\s*cmd/link/internal/loader\.\(\*Loader\)\.resolve`

Issue created automatically to collect these failures.

Example (log):

panic: runtime error: index out of range [2147483635] with length 6

goroutine 22 [running]:
cmd/link/internal/loader.(*Loader).resolve(0xc000142a80, 0xc000070680, {0x7ffffff3, 0x1f})
	cmd/link/internal/loader/loader.go:658 +0x2ac
cmd/link/internal/loader.Reloc.Sym({0x7fffaa5498c1, 0xc000070680, 0xc000142a80})
	cmd/link/internal/loader/loader.go:61 +0x94
cmd/link/internal/ld.(*relocSymState).relocsym(0xc001200ef0, 0xb3aa, {0x7fffa94071a0, 0xf8, 0x204e60})
	cmd/link/internal/ld/data.go:202 +0x148
cmd/link/internal/ld.writeBlock(0xc000174200, 0xc0000b6070, 0xc000142a80, {0xc001208000, 0x57c2, 0x57c2}, 0x2b0000, 0x114140, {0x52bae0, 0x200, ...})
	cmd/link/internal/ld/data.go:1084 +0x410
cmd/link/internal/ld.writeBlocks.func1(0xc0000b6070, 0xc000142a80, {0xc001208000, 0x57c2, 0x57c2}, 0x2b0000, 0x114140, {0x52bae0, 0x200, 0x200})
	cmd/link/internal/ld/data.go:1040 +0x90
created by cmd/link/internal/ld.writeBlocks in goroutine 62
	cmd/link/internal/ld/data.go:1039 +0x4a8
go tool dist: FAILED: /tmp/workdir-host-linux-loong64-3a5000/go/pkg/tool/linux_loong64/go_bootstrap install cmd: exit status 1

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 29, 2023
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "cmd/link" && test == ""
2023-08-29 18:31 linux-loong64-3a5000 go@22f9e0ef cmd/link [build] (log)
panic: runtime error: index out of range [2147483635] with length 6

goroutine 22 [running]:
cmd/link/internal/loader.(*Loader).resolve(0xc000142a80, 0xc000070680, {0x7ffffff3, 0x1f})
	cmd/link/internal/loader/loader.go:658 +0x2ac
cmd/link/internal/loader.Reloc.Sym({0x7fffaa5498c1, 0xc000070680, 0xc000142a80})
	cmd/link/internal/loader/loader.go:61 +0x94
cmd/link/internal/ld.(*relocSymState).relocsym(0xc001200ef0, 0xb3aa, {0x7fffa94071a0, 0xf8, 0x204e60})
	cmd/link/internal/ld/data.go:202 +0x148
cmd/link/internal/ld.writeBlock(0xc000174200, 0xc0000b6070, 0xc000142a80, {0xc001208000, 0x57c2, 0x57c2}, 0x2b0000, 0x114140, {0x52bae0, 0x200, ...})
	cmd/link/internal/ld/data.go:1084 +0x410
cmd/link/internal/ld.writeBlocks.func1(0xc0000b6070, 0xc000142a80, {0xc001208000, 0x57c2, 0x57c2}, 0x2b0000, 0x114140, {0x52bae0, 0x200, 0x200})
	cmd/link/internal/ld/data.go:1040 +0x90
created by cmd/link/internal/ld.writeBlocks in goroutine 62
	cmd/link/internal/ld/data.go:1039 +0x4a8
go tool dist: FAILED: /tmp/workdir-host-linux-loong64-3a5000/go/pkg/tool/linux_loong64/go_bootstrap install cmd: exit status 1

watchflakes

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Aug 29, 2023
@bcmills bcmills changed the title cmd/link: unrecognized failures runtime: failures with index out of range panics on loong64 Aug 29, 2023
@bcmills bcmills added the arch-loong64 Issues solely affecting the loongson architecture. label Aug 29, 2023
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
post <- goarch == "loong64" && log ~ `panic: runtime error: index out of range`
2023-07-06 13:09 linux-loong64-3a5000 go@b490bdc2 archive/tar.test [build] (log)
panic: runtime error: index out of range [2147482621] with length 2

goroutine 1 [running]:
panic({0x2e7ac0, 0xc000012360})
	runtime/panic.go:1017 +0x428 fp=0xc0001425c0 sp=0xc000142518 pc=0x4ef98
runtime.goPanicIndex(0x7ffffbfd, 0x2)
	runtime/panic.go:114 +0xb0 fp=0xc0001425f8 sp=0xc0001425c0 pc=0x4cf10
cmd/link/internal/loader.(*Loader).resolve(0xc00010ea80, 0xc0000a6280, {0x7ffffbfd, 0x24})
	cmd/link/internal/loader/loader.go:658 +0x2ac fp=0xc000142620 sp=0xc0001425f8 pc=0x14712c
cmd/link/internal/loader.Aux.Sym({0xc0000a5053, 0xc0000a6280, 0xc00010ea80})
	cmd/link/internal/loader/loader.go:73 +0x94 fp=0xc000142648 sp=0xc000142620 pc=0x144cb4
cmd/link/internal/ld.(*deadcodePass).flood(0xc000142938)
	cmd/link/internal/ld/deadcode.go:254 +0xea8 fp=0xc000142848 sp=0xc000142648 pc=0x1bdf68
cmd/link/internal/ld.deadcode(0xc000130200)
	cmd/link/internal/ld/deadcode.go:407 +0x60 fp=0xc0001429c8 sp=0xc000142848 pc=0x1bf180
cmd/link/internal/ld.Main(0x4d8c60, {0x10, 0x20, 0x1, 0x3, 0x1, 0x0, {0xc00000c3fc, 0x4, 0x4}, ...})
	cmd/link/internal/ld/main.go:286 +0x1444 fp=0xc000142c60 sp=0xc0001429c8 pc=0x20aea4
main.main()
	cmd/link/main.go:72 +0xefc fp=0xc000143f48 sp=0xc000142c60 pc=0x29a9dc
runtime.main()
	runtime/proc.go:267 +0x324 fp=0xc000143fd8 sp=0xc000143f48 pc=0x523f4
runtime.goexit()
	runtime/asm_loong64.s:640 +0x4 fp=0xc000143fd8 sp=0xc000143fd8 pc=0x88eb4
2023-08-29 15:33 linux-loong64-3a5000 go@2efebf3e internal/coverage/slicereader.test [build] (log)
panic: runtime error: index out of range [2147483635] with length 8

goroutine 81 [running]:
panic({0x2f8240, 0xc000012198})
	runtime/panic.go:774 +0x168 fp=0xc000b08ac0 sp=0xc000b08a18 pc=0x4eea8
runtime.goPanicIndex(0x7ffffff3, 0x8)
	runtime/panic.go:114 +0xb0 fp=0xc000b08af8 sp=0xc000b08ac0 pc=0x4db10
cmd/link/internal/loader.(*Loader).resolve(0xc00076c000, 0xc00075c700, {0x7ffffff3, 0xaeb})
	cmd/link/internal/loader/loader.go:658 +0x2ac fp=0xc000b08b20 sp=0xc000b08af8 pc=0x14b6dc
cmd/link/internal/loader.Reloc.Sym({0x7fffa9f73201, 0xc00075c700, 0xc00076c000})
	cmd/link/internal/loader/loader.go:61 +0x94 fp=0xc000b08b48 sp=0xc000b08b20 pc=0x1491f4
cmd/link/internal/ld.(*relocSymState).relocsym(0xc000b08ef0, 0x13668, {0x7fffa7fa0120, 0x154, 0x1dbee0})
	cmd/link/internal/ld/data.go:202 +0x148 fp=0xc000b08dc0 sp=0xc000b08b48 pc=0x1a8f28
cmd/link/internal/ld.writeBlock(0xc000134200, 0xc000110070, 0xc00076c000, {0xc000fa8000, 0x9cd, 0xc00}, 0x11000, 0x100930, {0xc00000c42c, 0x4, ...})
	cmd/link/internal/ld/data.go:1084 +0x410 fp=0xc000b08f10 sp=0xc000b08dc0 pc=0x1afb00
cmd/link/internal/ld.writeBlocks.func1(0xc000110070, 0xc00076c000, {0xc000fa8000, 0x9cd, 0xc00}, 0x11000, 0x100930, {0xc00000c42c, 0x4, 0x4})
	cmd/link/internal/ld/data.go:1040 +0x90 fp=0xc000b08f80 sp=0xc000b08f10 pc=0x1af6b0
cmd/link/internal/ld.writeBlocks.gowrap1()
	cmd/link/internal/ld/data.go:1043 +0x9c fp=0xc000b08fd8 sp=0xc000b08f80 pc=0x1af60c
runtime.goexit()
	runtime/asm_loong64.s:640 +0x4 fp=0xc000b08fd8 sp=0xc000b08fd8 pc=0x892d4
created by cmd/link/internal/ld.writeBlocks in goroutine 64
	cmd/link/internal/ld/data.go:1039 +0x4a8
2023-08-29 16:49 linux-loong64-3a5000 go@2e644cce test.Test (log)
--- FAIL: Test (0.02s)
    --- FAIL: Test/typeparam/issue50121b.go (0.19s)
        testdir_test.go:141: exit status 1
            panic: runtime error: index out of range [2147483635] with length 8

            goroutine 9 [running]:
            panic({0x2f8240, 0xc00079e6a8})
            	runtime/panic.go:774 +0x168 fp=0xc0010caac0 sp=0xc0010caa18 pc=0x4eea8
            runtime.goPanicIndex(0x7ffffff3, 0x8)
            	runtime/panic.go:114 +0xb0 fp=0xc0010caaf8 sp=0xc0010caac0 pc=0x4db10
            cmd/link/internal/loader.(*Loader).resolve(0xc000774000, 0xc0000f7000, {0x7ffffff3, 0x49b})
            	cmd/link/internal/loader/loader.go:658 +0x2ac fp=0xc0010cab20 sp=0xc0010caaf8 pc=0x14b6dc
            cmd/link/internal/loader.Reloc.Sym({0x7fffa8e337a1, 0xc0000f7000, 0xc000774000})
            	cmd/link/internal/loader/loader.go:61 +0x94 fp=0xc0010cab48 sp=0xc0010cab20 pc=0x1491f4
            cmd/link/internal/ld.(*relocSymState).relocsym(0xc0010caef0, 0x32b5, {0x7fffa84b71d0, 0x980, 0xb8e30})
            	cmd/link/internal/ld/data.go:202 +0x148 fp=0xc0010cadc0 sp=0xc0010cab48 pc=0x1a8f28
            cmd/link/internal/ld.writeBlock(0xc0000f0200, 0xc0000bc8c0, 0xc000774000, {0xc0007b0a00, 0x49f, 0x540}, 0x11000, 0x6c914, {0xc0000ba2ec, 0x4, ...})
            	cmd/link/internal/ld/data.go:1084 +0x410 fp=0xc0010caf10 sp=0xc0010cadc0 pc=0x1afb00
            cmd/link/internal/ld.writeBlocks.func1(0xc0000bc8c0, 0xc000774000, {0xc0007b0a00, 0x49f, 0x540}, 0x11000, 0x6c914, {0xc0000ba2ec, 0x4, 0x4})
            	cmd/link/internal/ld/data.go:1040 +0x90 fp=0xc0010caf80 sp=0xc0010caf10 pc=0x1af6b0
            cmd/link/internal/ld.writeBlocks.gowrap1()
            	cmd/link/internal/ld/data.go:1043 +0x9c fp=0xc0010cafd8 sp=0xc0010caf80 pc=0x1af60c
            runtime.goexit()
            	runtime/asm_loong64.s:640 +0x4 fp=0xc0010cafd8 sp=0xc0010cafd8 pc=0x892d4
            created by cmd/link/internal/ld.writeBlocks in goroutine 5
            	cmd/link/internal/ld/data.go:1039 +0x4a8
2023-08-29 18:28 linux-loong64-3a5000 go@208f3618 test.Test (log)
--- FAIL: Test (0.02s)
    --- FAIL: Test/typeparam/dictionaryCapture.go (0.14s)
        testdir_test.go:141: exit status 1
            panic: runtime error: index out of range [2147483635] with length 8

            goroutine 1 [running]:
            panic({0x2f8240, 0xc000e582b8})
            	runtime/panic.go:774 +0x168 fp=0xc0000d65c0 sp=0xc0000d6518 pc=0x4eea8
            runtime.goPanicIndex(0x7ffffff3, 0x8)
            	runtime/panic.go:114 +0xb0 fp=0xc0000d65f8 sp=0xc0000d65c0 pc=0x4db10
            cmd/link/internal/loader.(*Loader).resolve(0xc000011180, 0xc0007aa800, {0x7ffffff3, 0x7a9})
            	cmd/link/internal/loader/loader.go:658 +0x2ac fp=0xc0000d6620 sp=0xc0000d65f8 pc=0x14b6dc
            cmd/link/internal/loader.Reloc.Sym({0x7fffabfa9ac1, 0xc0007aa800, 0xc000011180})
            	cmd/link/internal/loader/loader.go:61 +0x94 fp=0xc0000d6648 sp=0xc0000d6620 pc=0x1491f4
            cmd/link/internal/ld.(*deadcodePass).flood(0xc0000d6900)
            	cmd/link/internal/ld/deadcode.go:228 +0xc00 fp=0xc0000d6848 sp=0xc0000d6648 pc=0x1c1ac0
            cmd/link/internal/ld.deadcode(0xc0000c4200)
            	cmd/link/internal/ld/deadcode.go:407 +0x60 fp=0xc0000d69c0 sp=0xc0000d6848 pc=0x1c2f70
            cmd/link/internal/ld.Main(0x4e8ce0, {0x10, 0x20, 0x1, 0x3, 0x1, 0x0, {0xc00000c43c, 0x4, 0x4}, ...})
            	cmd/link/internal/ld/main.go:343 +0x1594 fp=0xc0000d6c78 sp=0xc0000d69c0 pc=0x20ebf4
            main.main()
            	cmd/link/main.go:72 +0xf80 fp=0xc0000d7f60 sp=0xc0000d6c78 pc=0x2a1c80
            runtime.main()
            	runtime/proc.go:267 +0x2f8 fp=0xc0000d7fd8 sp=0xc0000d7f60 pc=0x52b68
            runtime.goexit({})
            	runtime/asm_loong64.s:640 +0x4 fp=0xc0000d7fd8 sp=0xc0000d7fd8 pc=0x892d4

watchflakes

@bcmills
Copy link
Contributor

bcmills commented Aug 29, 2023

(attn @golang/loong64)

@abner-chenc
Copy link
Contributor

Thanks!.

I have tested on other machines and the error has not been reproduced. This problem and the problem described in #62336 may be caused by the memory stability of this builder. I have reproduced these two errors before on machines with memory stability bugs.

I have replaced the memory module of this builder to see if these two errors still occur. At the same time, I also tested on other local machines to see if the two errors can be reproduced.

@mknyszek mknyszek added this to the Backlog milestone Aug 30, 2023
@bcmills bcmills changed the title runtime: failures with index out of range panics on loong64 runtime,cmd/link: failures with index out of range panics on loong64 Nov 1, 2023
@bcmills bcmills changed the title runtime,cmd/link: failures with index out of range panics on loong64 cmd/link: panic with index out of range in cmd/link/internal/loader.(*Loader).resolve Nov 1, 2023
@bcmills bcmills removed the arch-loong64 Issues solely affecting the loongson architecture. label Nov 1, 2023
@bcmills
Copy link
Contributor

bcmills commented Nov 1, 2023

This turns out not to be specific to loong64 after all (see #63876 (comment)).

(attn @golang/compiler for re-triage)

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
post <- log ~ `panic: runtime error: index out of range` && log ~ `^\s*cmd/link/internal/loader\.\(\*Loader\)\.resolve`
2023-11-01 07:10 linux-ppc64-sid-buildlet go@1a58fd0f test.Test (log)
--- FAIL: Test (0.11s)
    --- FAIL: Test/rangegen.go (154.13s)
        testdir_test.go:142: exit status 1
            # command-line-arguments
            panic: runtime error: index out of range [755141] with length 243821

            goroutine 1 [running]:
            panic({0x2b8220?, 0xc000014360?})
            	runtime/panic.go:772 +0x174 fp=0xc0000ac4e0 sp=0xc0000ac420 pc=0x4a534
            runtime.goPanicIndex(0xb85c5, 0x3b86d)
            	runtime/panic.go:114 +0x98 fp=0xc0000ac530 sp=0xc0000ac4e0 pc=0x492d8
            cmd/link/internal/loader.(*Loader).resolve(0xc000096e00?, 0xc00009c200?, {0xc0?, 0xf2000?})
            	cmd/link/internal/loader/loader.go:648 +0x27c fp=0xc0000ac570 sp=0xc0000ac530 pc=0x13392c
            cmd/link/internal/loader.Reloc.Sym({0x7fff5c58ffeb?, 0xc00009c200?, 0xc000096e00?})
            	cmd/link/internal/loader/loader.go:61 +0x64 fp=0xc0000ac5a8 sp=0xc0000ac570 pc=0x131754
            cmd/link/internal/ld.(*deadcodePass).flood(0xc0000ac8e8)
            	cmd/link/internal/ld/deadcode.go:247 +0xb0c fp=0xc0000ac810 sp=0xc0000ac5a8 pc=0x19d7cc
            cmd/link/internal/ld.deadcode(0xc00009a200)
            	cmd/link/internal/ld/deadcode.go:433 +0x80 fp=0xc0000ac990 sp=0xc0000ac810 pc=0x19ea40
            cmd/link/internal/ld.Main(_, {0x10, 0x20, 0x1, 0x1, 0x41, 0x1c00000, {0x0, 0x0, 0x0}, ...})
            	cmd/link/internal/ld/main.go:353 +0x13ec fp=0xc0000acc40 sp=0xc0000ac990 pc=0x1e34bc
            main.main()
            	cmd/link/main.go:72 +0x106c fp=0xc0000adf38 sp=0xc0000acc40 pc=0x26152c
            runtime.main()
            	runtime/proc.go:269 +0x2f0 fp=0xc0000adfc0 sp=0xc0000adf38 pc=0x4dcc0
            runtime.goexit({})
            	runtime/asm_ppc64x.s:993 +0x4 fp=0xc0000adfc0 sp=0xc0000adfc0 pc=0x81244

watchflakes

@Guvanchhojamov
Copy link

What version of Go do you use? I saw GOVERSION="go1.18" but I cannot reproduce it with go1.18.
Maybe try clean your cache (go clean -cache, go clean -modcache) in case some cached file is corrupted?

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
post <- log ~ `panic: runtime error: index out of range` && log ~ `^\s*cmd/link/internal/loader\.\(\*Loader\)\.resolve`
2024-05-13 16:40 x_telemetry-go1.21-darwin-amd64-nocgo telemetry@80019551 release-branch.go1.21@8fbd4d7b [build] (log)
[I2024-05-13T09:59:43.807945-07:00 58258 0 sink.go:276] SinkServer: warm-up started
[I2024-05-13T09:59:43.808510-07:00 58258 0 sink.go:346] SinkServer: starting HTTP server...
[I2024-05-13T09:59:43.812076-07:00 58258 0 sink.go:281] SinkServer: warm-up ended
[I2024-05-13T09:59:43.812531-07:00 58258 0 cmd_stream.go:483] rdb-stream: starting the test command - ["/Users/swarming/.swarming/w/ir/cache/tools/bin/result_adapter" "go" "-v=false" "--" "/Users/swarming/.swarming/w/ir/x/w/goroot/bin/go" "test" "-json" "-short" "./..."]
# golang.org/x/telemetry/godev/cmd/telemetrygodev.test
panic: runtime error: index out of range [2147483135] with length 43

goroutine 1 [running]:
cmd/link/internal/loader.(*Loader).resolve(0x1264b60?, 0xc000054b10?, {0x1484b60?, 0x0?})
	cmd/link/internal/loader/loader.go:658 +0x179
...
panic: runtime error: index out of range [2147483135] with length 43

goroutine 1 [running]:
cmd/link/internal/loader.(*Loader).resolve(0x1264b60?, 0xc00076e390?, {0x1484b60?, 0x0?})
	cmd/link/internal/loader/loader.go:658 +0x179
cmd/link/internal/loader.Reloc.Sym(...)
	cmd/link/internal/loader/loader.go:61
cmd/link/internal/ld.(*deadcodePass).flood(0xc00014c920)
	cmd/link/internal/ld/deadcode.go:244 +0xbe5
cmd/link/internal/ld.deadcode(0xc000112200)
...
Warning: no '=' in invocation-link-artifacts pair: "", ignoring
[I2024-05-13T10:00:25.111127-07:00 58258 0 cmd_stream.go:479] rdb-stream: the test process terminated
[I2024-05-13T10:00:25.111446-07:00 58258 0 sink.go:371] SinkServer: shutdown started
[I2024-05-13T10:00:25.111540-07:00 58258 0 sink.go:349] SinkServer: HTTP server stopped with "http: Server closed"
[I2024-05-13T10:00:25.111567-07:00 58258 0 sink_server.go:95] SinkServer: draining TestResult channel started
[I2024-05-13T10:00:25.202052-07:00 58258 0 sink_server.go:97] SinkServer: draining TestResult channel ended
[I2024-05-13T10:00:25.202093-07:00 58258 0 sink_server.go:99] SinkServer: draining Artifact channel started
[I2024-05-13T10:00:25.297678-07:00 58258 0 sink_server.go:101] SinkServer: draining Artifact channel ended
[I2024-05-13T10:00:25.297724-07:00 58258 0 sink.go:374] SinkServer: shutdown completed successfully
[I2024-05-13T10:00:25.297769-07:00 58258 0 cmd_stream.go:411] rdb-stream: exiting with 1

watchflakes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: No status
Development

No branches or pull requests

5 participants