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

assert: invalid memory address or nil pointer dereference for assert.Error on darwin/arm64 #1596

Open
samanhappy opened this issue May 14, 2024 · 0 comments
Labels

Comments

@samanhappy
Copy link

I was testing our project on Darwin/arm64, but there were some test failures with the following example log:

=== RUN   TestTwilio
    nexmo_test.go:61: 
        	Error Trace:	/Users/runner/work/easeprobe/easeprobe/notify/sms/nexmo/nexmo_test.go:36
        	            				/Users/runner/work/easeprobe/easeprobe/notify/sms/nexmo/nexmo_test.go:61
        	            				/Users/runner/work/easeprobe/easeprobe/notify/sms/nexmo/nexmo_test.go:87
        	Error:      	An error is expected but got nil.
        	Test:       	TestTwilio
--- FAIL: TestTwilio (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x18 pc=0x1047c45a8]

Almost all errors occurred when calling assert.Error like here.

func assertError(t *testing.T, err error, msg string) {
	t.Helper()
	assert.Error(t, err) // Line 36
	assert.Equal(t, msg, err.Error())
}

I'm not sure if this was caused by testify. Does testify support Darwin/arm64? Can you guys help to check it?

@samanhappy samanhappy added the bug label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant