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

panic in logging round tripper if request body is passed as nil, instead of NoBody #10

Open
Semior001 opened this issue Feb 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Semior001
Copy link
Member

--- FAIL: TestHandler/create_event_and_read_it (0.03s)
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=0x1044d8da0]

goroutine 78 [running]:
testing.tRunner.func1.2({0x104a35840, 0x104de1b80})
	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1631 +0x1c4
testing.tRunner.func1()
	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1634 +0x33c
panic({0x104a35840?, 0x104de1b80?})
	/opt/homebrew/opt/go/libexec/src/runtime/panic.go:770 +0x124
io.(*LimitedReader).Read(0x14000312bb8, {0x14000360800?, 0x14000259358?, 0x1044d8c88?})
	/opt/homebrew/opt/go/libexec/src/io/io.go:479 +0x40
bytes.(*Buffer).ReadFrom(0x14000248240, {0x104acfdd8, 0x14000312bb8})
	/opt/homebrew/opt/go/libexec/src/bytes/buffer.go:211 +0x90
io.copyBuffer({0x104acfd38, 0x14000248240}, {0x104acfdd8, 0x14000312bb8}, {0x0, 0x0, 0x0})
	/opt/homebrew/opt/go/libexec/src/io/io.go:415 +0x14c
io.Copy(...)
	/opt/homebrew/opt/go/libexec/src/io/io.go:388
io.CopyN({0x104acfd38, 0x14000248240}, {0x0, 0x0}, 0x2801)
	/opt/homebrew/opt/go/libexec/src/io/io.go:364 +0x98
github.com/cappuccinotm/slogx/logger.peek({0x0, 0x0}, 0x2800)
	/Users/semior/go/pkg/mod/github.com/cappuccinotm/[email protected]/logger/io.go:29 +0x60
github.com/cappuccinotm/slogx/logger.(*Logger).readBody(0x140001119a0?, {0x0, 0x0}, 0x0)
	/Users/semior/go/pkg/mod/github.com/cappuccinotm/[email protected]/logger/logger.go:154 +0x88
github.com/cappuccinotm/slogx/logger.(*Logger).obtainRequestInfo(0x1400003c200, 0x1400035b680)
	/Users/semior/go/pkg/mod/github.com/cappuccinotm/[email protected]/logger/logger.go:115 +0x3c
...

rest is trimmed
@Semior001 Semior001 added the bug Something isn't working label Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant