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

Test fails due to stack traces #21

Closed
rockstorm101 opened this issue Jan 30, 2019 · 8 comments · Fixed by #24
Closed

Test fails due to stack traces #21

rockstorm101 opened this issue Jan 30, 2019 · 8 comments · Fixed by #24

Comments

@rockstorm101
Copy link

Hi, tests are failing again since go 1.11.

Maybe @gabrielf could come up again with a solution for this? :P

Thanks a lot.

$ go version
go version go1.11.5 linux/amd64

$ go test -vet=off -v -p 4 github.com/go-errors/errors
=== RUN   TestStackFormat
--- FAIL: TestStackFormat (0.00s)
    error_test.go:33: Stack trace does not contain source line: 'a: b(5)'
    error_test.go:34: /build/golang-github-go-errors-errors-1.0.1/obj-x86_64-linux-gnu/src/github.com/go-errors/errors/error_test.go:21 (0x4f5f35)
        	TestStackFormat.func1: e, expected := Errorf("hi"), callers()
        /usr/lib/go-1.11/src/runtime/asm_amd64.s:522 (0x455b3b)
        	call32: CALLFN(·call32, 32)
        /usr/lib/go-1.11/src/runtime/panic.go:513 (0x429df9)
        	gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
        /build/golang-github-go-errors-errors-1.0.1/obj-x86_64-linux-gnu/src/github.com/go-errors/errors/error_test.go:245 (0x4f38ff)
        	TestStackFormat: panic('a')
        /usr/lib/go-1.11/src/testing/testing.go:827 (0x4b573f)
        	tRunner: fn(t)
        /usr/lib/go-1.11/src/runtime/asm_amd64.s:1333 (0x4576d1)
        	goexit: BYTE	$0x90	// NOP

Originally reported in Debian [1] by Adrian Bunk.

@rockstorm101
Copy link
Author

Hi, is there any update on this? Maybe even a "Won't Fix"?

@ConradIrwin
Copy link
Contributor

ConradIrwin commented Apr 26, 2019 via email

@rockstorm101
Copy link
Author

Hi @ConradIrwin, I would love a PR on this too :P.

In all honesty, I've tried and failed. I clearly lack the knowledge here. If this is going to be a "won't-fix" I'll have to propose ignoring this particular test on the Debian package, which is something I'm currently reluctant to do.

Thanks for answering anyway.

@anthonyfok
Copy link

For some reasons, this test seems to pass with Go 1.12, but continues to fail with Go 1.11.

Tested with go1.12.7 and go1.11.12.

@rockstorm101
Copy link
Author

For some reasons, this test seems to pass with Go 1.12, but continues to fail with Go 1.11.

Great news. Thanks for the fix in Debian.

@anthonyfok
Copy link

For some reasons, this test seems to pass with Go 1.12, but continues to fail with Go 1.11.

Great news. Thanks for the fix in Debian.

You're very welcome. I needed the fix myself anyway. :-)

The stack trace test seems very flaky; or, rather, Go sometimes generate unpredictable stack trace? I am seeing different stack trace outputs with gccgo-8 and gccgo-9, for example, on amd64 vs mipsel.

  • gccgo-8 on amd64: FAIL.
  • gccgo-9 on amd64: PASS. Yay!
  • gccgo-8 on amd64: TestStackFormat passes, but TestNew fails:
--- FAIL: TestNew (0.00s)
	error_test.go:81: Stack didn't match
	error_test.go:82: First entry PC diff to large (36)
		Actual stack trace:
		/home/foka/golang-github-go-errors-errors-1.0.1/error_test.go:78 (0x5559d307)
			__home_foka_golang_github_go_errors_errors_1_0_1.TestNew
		../../../src/libgo/go/testing/testing.go:777 (0x77924fbb)
			testing.tRunner
		../../../src/libgo/go/runtime/proc.go:1167 (0x778a2293)
			runtime.kickoff
		
		Expected stack trace:
		/home/foka/golang-github-go-errors-errors-1.0.1/error_test.go:78 (0x5559d32b)
			__home_foka_golang_github_go_errors_errors_1_0_1.TestNew
		../../../src/libgo/go/testing/testing.go:777 (0x77924fbb)
			testing.tRunner
		../../../src/libgo/go/runtime/proc.go:1167 (0x778a2293)
			runtime.kickoff
  • gccgo-9 on mipsel:
# _/home/foka/golang-github-go-errors-errors-1.0.1 [_/home/foka/golang-github-go-errors-errors-1.0.1.test]
go1: internal compiler error: in mangled_name, at go/gofrontend/names.cc:559
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.
FAIL	_/home/foka/golang-github-go-errors-errors-1.0.1 [build failed]

Oh well...

@rockstorm101
Copy link
Author

The stack trace test seems very flaky; or, rather, Go sometimes generate unpredictable stack trace? I am seeing different stack trace outputs with gccgo-8 and gccgo-9, for example, on amd64 vs mipsel.

Traces look the same but for that number at the end (the program counter?):
/home/foka/golang-github-go-errors-errors-1.0.1/error_test.go:78 (0x5559d307)
/home/foka/golang-github-go-errors-errors-1.0.1/error_test.go:78 (0x5559d32b)

So maybe the stack comparison should be relaxed to allow such mismatch? I'm honestly too lost here.

@anthonyfok
Copy link

So maybe the stack comparison should be relaxed to allow such mismatch? I'm honestly too lost here.

Sorry, I might have overemphasized and missed the main point. Although the test is indeed a bit flaky, or rather, Go's stack trace does not seem to produce identical output, I wouldn't worry too much as long as, for instance, it builds fine on Debian buildd machine and passes the automated tests:

where both the buildd and the automated tests runs only on amd64 with the standard Go compiler (gc) and never with MIPS or gccgo. Furthermore, this particular test really doesn't affect the usability of this Go library, so all is fine now IMHO. :-)

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.

3 participants