Skip to content

PANIC: pkg: runtime error: slice bounds out of range Addr: #408

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

Closed
neeraj9 opened this issue Dec 23, 2016 · 9 comments
Closed

PANIC: pkg: runtime error: slice bounds out of range Addr: #408

neeraj9 opened this issue Dec 23, 2016 · 9 comments

Comments

@neeraj9
Copy link

neeraj9 commented Dec 23, 2016

After running the the tool for a 6+ hours it threw a panic. A possible bug.

$ sudo ~/bin/gor --input-raw :9090 --output-file=%Y-%m-%d_%H-%M-requests.log.gz --input-raw-track-response --output-file-append
Version:
2016/12/23 14:00:37 PANIC: pkg: runtime error: slice bounds out of range Addr:

Source port: 9090
Dest port:21920
Sequence:2948825057
Acknowledgment:1824782714
Header len:8
FIN:false
Data size:1426
Data:3="http://www.w3.org/2001/XMLSchema-instance" ns3:nil="true" /><ns2:SomeAlteNo>1234567890</ns2:SomeAlteNo><ns2:Someab>124</ns2:Someab><ns2:ContactPerson>123456</ns2:ContactPerson><ns2:DisplayOnline> goroutine 8 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
        /usr/lib/go-1.6/src/runtime/debug/stack.go:24 +0x80
github.com/buger/gor/raw_socket_listener.(*Listener).processTCPPacket.func1(0xc821c87050)
        /home/neeraj9/go/src/github.com/buger/gor/raw_socket_listener/listener.go:676 +0x75
panic(0xa67520, 0xc82000e0a0)
        /usr/lib/go-1.6/src/runtime/panic.go:443 +0x4e9
github.com/buger/gor/proto.ParseHeaders(0xc8227974a0, 0x14, 0x14, 0xc820039a40)
        /home/neeraj9/go/src/github.com/buger/gor/proto/proto.go:233 +0x680
github.com/buger/gor/raw_socket_listener.(*TCPMessage).updateBodyType(0xc82286b340)
        /home/neeraj9/go/src/github.com/buger/gor/raw_socket_listener/tcp_message.go:376 +0x107
github.com/buger/gor/raw_socket_listener.(*TCPMessage).AddPacket(0xc82286b340, 0xc821c87050)
        /home/neeraj9/go/src/github.com/buger/gor/raw_socket_listener/tcp_message.go:149 +0x4cd
github.com/buger/gor/raw_socket_listener.(*Listener).processTCPPacket(0xc82014c500, 0xc821c87050)
        /home/neeraj9/go/src/github.com/buger/gor/raw_socket_listener/listener.go:743 +0x8a2
github.com/buger/gor/raw_socket_listener.(*Listener).listen(0xc82014c500)
        /home/neeraj9/go/src/github.com/buger/gor/raw_socket_listener/listener.go:148 +0x1dd
created by github.com/buger/gor/raw_socket_listener.NewListener
        /home/neeraj9/go/src/github.com/buger/gor/raw_socket_listener/listener.go:119 +0x3aa
@buger
Copy link
Owner

buger commented Dec 23, 2016

Hello! Since version field is empty, I assume you are running custom build. May I ask what version of Gor it is?

@neeraj9
Copy link
Author

neeraj9 commented Dec 23, 2016 via email

@buger
Copy link
Owner

buger commented Dec 23, 2016

Just to clarify, it does not crash the process, but sometimes throws error into logs, right? What is the average requests per second? Just to understand how common issue is. Thanks!

@neeraj9
Copy link
Author

neeraj9 commented Dec 24, 2016

I was running the application in foreground for testing and unfortunately I did not notice whether it continued working. I do remember that I killed it manually via ctrl-c (sigint) signal. I will have to dig into the details to give an exact number but my initial guess regarding RPS would be somewhere in tens per second. I would revise the estimate once I am done with detailed analysis through.

@neeraj9
Copy link
Author

neeraj9 commented Dec 26, 2016

Huh! So, the panic probably doesn't handle the message which caused the panic but the application stays up and continues to intercept and log messages. It does leads to loss of the message which caused the panic, but it does continue working.
I will continue to monitor the quantum of panics, but it will be great to have a patch for the issue.

@buger
Copy link
Owner

buger commented Dec 26, 2016

Cool! Thank you for the feedback!

@buger
Copy link
Owner

buger commented Dec 27, 2016

Issue was fixed, using fuzzer helped #411

@buger
Copy link
Owner

buger commented Dec 27, 2016

Here is latest binary with fix gor_DEV-1482850025_x64.tar.gz

@neeraj9
Copy link
Author

neeraj9 commented Dec 28, 2016

@buger Thanks.

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

No branches or pull requests

2 participants