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

s2: Investigate crash #600

Closed
klauspost opened this issue May 24, 2022 · 1 comment · Fixed by #601
Closed

s2: Investigate crash #600

klauspost opened this issue May 24, 2022 · 1 comment · Fixed by #601

Comments

@klauspost
Copy link
Owner

"Random" failure. Should be investigated.

unexpected fault address 0xc0212a0000
fatal error: fault
[signal 0xc0000005 code=0x0 addr=0xc0212a0000 pc=0x11e5f2f]

goroutine 30020 [running]:
runtime.throw({0x126dca6?, 0x0?})
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/runtime/panic.go:992 +0x76 fp=0xc000243e38 sp=0xc000243e08 pc=0xf58f56
runtime.sigpanic()
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/runtime/signal_windows.go:261 +0x125 fp=0xc000243e80 sp=0xc000243e38 pc=0xf6d625
github.com/klauspost/compress/s2.encodeBlockAsm4MB({0xc004fb800b, 0x4ffd, 0x[19](https://github.com/klauspost/compress/runs/6576795659?check_suite_focus=true#step:5:20)004}, {0xc02129b000, 0x5000, 0x5000})
	D:/a/compress/compress/s2/encodeblock_amd64.s:2253 +0xcaf fp=0xc000253ea8 sp=0xc000243e80 pc=0x11e5f2f
github.com/klauspost/compress/s2.encodeBlock({0xc004fb800b?, 0x1035348?, 0x0?}, {0xc02129b000?, 0xc0041b[20](https://github.com/klauspost/compress/runs/6576795659?check_suite_focus=true#step:5:21)00?, 0x12adc?})
	D:/a/compress/compress/s2/encode_amd64.go:27 +0x159 fp=0xc000253ef0 sp=0xc000253ea8 pc=0x11c1ad9
github.com/klauspost/compress/s2.(*Writer).encodeBlock(0xc000853f60?, {0xc004fb800b?, 0xc0[21](https://github.com/klauspost/compress/runs/6576795659?check_suite_focus=true#step:5:22)29b000?, 0xc0021ca000?}, {0xc02129b000?, 0x1000d?, 0xc000853fb0?})
	D:/a/compress/compress/s2/encode.go:789 +0x139 fp=0xc000253f30 sp=0xc000253ef0 pc=0x11bde19
github.com/klauspost/compress/s2.(*Writer).EncodeBuffer.func1()
	D:/a/compress/compress/s2/encode.go:745 +0x14d fp=0xc000253fe0 sp=0xc000253f30 pc=0x11bda6d
runtime.goexit()
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc000253fe8 sp=0xc000253fe0 pc=0xf89061
created by github.com/klauspost/compress/s2.(*Writer).EncodeBuffer
	D:/a/compress/compress/s2/encode.go:736 +0x2c5

goroutine 1 [chan send]:
github.com/klauspost/compress/s2.(*Writer).Flush(0xc00177be00)
	D:/a/compress/compress/s2/encode.go:1079 +0xda
github.com/klauspost/compress/s2.(*Writer).closeIndex(0xc00177be00, 0x1)
	D:/a/compress/compress/s2/encode.go:1102 +0x6c
github.com/klauspost/compress/s2.(*Writer).CloseIndex(...)
	D:/a/compress/compress/s2/encode.go:1098
github.com/klauspost/compress/s2_test.ExampleIndex_Load()
	D:/a/compress/compress/s2/index_test.go:37 +0x1be
testing.runExample({{0x1271eb5, 0x11}, 0x12a1680, {0x12860[22](https://github.com/klauspost/compress/runs/6576795659?check_suite_focus=true#step:5:23), 0x1ab}, 0x0})
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/testing/run_example.go:63 +0x28d
testing.runExamples(0xc000055e58, {0x14bb5a0?, 0x1, 0x26?})
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/testing/example.go:44 +0x186
testing.(*M).Run(0xc000090aa0)
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/testing/testing.go:1721 +0x689
main.main()
	_testmain.go:169 +0x1aa

goroutine 29967 [syscall, locked to thread]:
syscall.SyscallN(0x2030013?, {0xc000153ce8?, 0x1000?, 0x8000?})
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/runtime/syscall_windows.go:538 +0x109
syscall.Syscall6(0xf50410?, 0x27db99dac60?, 0x8000?, 0x4?, 0xc000153da0?, 0xf37b93?, 0x0?, 0x0?)
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/runtime/syscall_windows.go:482 +0x50
syscall.ReadFile(0xc000153dd8?, {0xc004fd2000?, 0x8000, 0x800000?}, 0x7ffff800000?, 0x2?)
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/syscall/zsyscall_windows.go:10[24](https://github.com/klauspost/compress/runs/6576795659?check_suite_focus=true#step:5:25) +0x94
syscall.Read(0xc0000c2f00?, {0xc004fd2000?, 0x121b2e0?, 0x1?})
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/syscall/syscall_windows.go:380 +0x2e
internal/poll.(*FD).Read(0xc0000c2f00, {0xc004fd2000, 0x8000, 0x8000})
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/internal/poll/fd_windows.go:427 +0x1b4
os.(*File).read(...)
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/os/file_posix.go:31
os.(*File).Read(0xc0000c0060, {0xc004fd2000?, 0xc000ef1ba0?, 0x27d934c0598?})
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/os/file.go:119 +0x5e
io.copyBuffer({0x12fb180, 0xc000ef1ba0}, {0x12fb0c0, 0xc0000c0060}, {0x0, 0x0, 0x0})
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/io/io.go:426 +0x1b2
io.Copy(...)
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/io/io.go:385
testing.runExample.func1()
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/testing/run_example.go:37 +0x76
created by testing.runExample
	C:/hostedtoolcache/windows/go/1.18.2/x64/src/testing/run_example.go:35 +0x1c5

goroutine 30019 [chan send]:
github.com/klauspost/compress/s2.(*Writer).EncodeBuffer.func1()
	D:/a/compress/compress/s2/encode.go:769 +0x311
created by github.com/klauspost/compress/s2.(*Writer).EncodeBuffer
	D:/a/compress/compress/s2/encode.go:736 +0x2c5

goroutine 29069 [chan receive]:
github.com/klauspost/compress/s2.(*Writer).Reset.func1()
	D:/a/compress/compress/s2/encode.go:485 +0xc5
created by github.com/klauspost/compress/s2.(*Writer).Reset
	D:/a/compress/compress/s2/encode.go:481 +0x22a

goroutine 29968 [chan receive]:
github.com/klauspost/compress/s2.(*Writer).Reset.func1()
	D:/a/compress/compress/s2/encode.go:487 +0xff
created by github.com/klauspost/compress/s2.(*Writer).Reset
	D:/a/compress/compress/s2/encode.go:481 +0x22a

goroutine 30018 [runnable]:
github.com/klauspost/compress/s2.(*Writer).EncodeBuffer.func1()
	D:/a/compress/compress/s2/encode.go:736
created by github.com/klauspost/compress/s2.(*Writer).EncodeBuffer
	D:/a/compress/compress/s2/encode.go:736 +0x2c5
FAIL	github.com/klauspost/compress/s2	64.454s
ok  	github.com/klauspost/compress/s2/cmd/internal/filepathx	0.036s
?   	github.com/klauspost/compress/s2/cmd/internal/readahead	[no test files]
?   	github.com/klauspost/compress/s2/cmd/s2c	[no test files]
?   	github.com/klauspost/compress/s2/cmd/s2d	[no test files]
ok  	github.com/klauspost/compress/snappy	0.929s
ok  	github.com/klauspost/compress/zip	43.884s
?   	github.com/klauspost/compress/zip/internal/obscuretestdata	[no test files]
ok  	github.com/klauspost/compress/zlib	0.584s
ok  	github.com/klauspost/compress/zstd	[25](https://github.com/klauspost/compress/runs/6576795659?check_suite_focus=true#step:5:26)7.9[62](https://github.com/klauspost/compress/runs/6576795659?check_suite_focus=true#step:5:63)s
ok  	github.com/klauspost/compress/zstd/internal/xxhash	0.[102](https://github.com/klauspost/compress/runs/6576795659?check_suite_focus=true#step:5:103)s
FAIL
@klauspost
Copy link
Owner Author

Seems like OOB read. Source cannot be over-read.

klauspost added a commit that referenced this issue May 25, 2022
When emitting the final literals we may not have enough input to safely read all without over-reading.

Set output margin to 0 for exact copies in this case.

Fixes #600
klauspost added a commit that referenced this issue May 25, 2022
When emitting the final literals we may not have enough input to safely read all without over-reading.

Set output margin to 0 for exact copies in this case.

Fixes #600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant