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

Crashes after a few minutes #42

Closed
thefinn93 opened this issue Apr 22, 2015 · 7 comments
Closed

Crashes after a few minutes #42

thefinn93 opened this issue Apr 22, 2015 · 7 comments
Assignees
Labels
Milestone

Comments

@thefinn93
Copy link

Hi,
I've been playing with sngrep a bit on a test PBX, and I find that it crashes after being run for a few minutes. It's not a consistent amount of time, so I assume it's crashing when some data goes in or out and the parser fails. I'd love to be able to give more info, but i'm not really sure how to collect it. I have a pcap of it happening, but need to go through and scrub any passwords/private info out of it before posting. Anything else I should do?

@Kaian
Copy link
Member

Kaian commented Apr 22, 2015

Hi @thefinn93 ,

What command line arguments are you using? I found some crashes while parsing some non-SIP packets.

@Kaian Kaian added the bug label Apr 22, 2015
@Kaian Kaian self-assigned this Apr 22, 2015
@Kaian Kaian added this to the v0.3.2 milestone Apr 22, 2015
@thefinn93
Copy link
Author

no arguments

@Kaian
Copy link
Member

Kaian commented Apr 23, 2015

As a temporal fix you can filter traffic by port (usually 5060), just to check that is not a problem with SIP packets.

sngrep port 5060

I think I can reproduce the problem. What version are you using? Binary or compiled?

Thanks a lot for the feedback!!

@thefinn93
Copy link
Author

sngrep - 0.3.1
Copyright (C) 2013-2015 Irontec S.L.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
 * Compiled with OpenSSL support.
 * Compiled with Wide-character support.
 * Compiled with Perl Compatible regular expressions support.
 * Compiled with IPv6 support.

Binary from the debian (wheezy) packages. I'll see if it crashes when I use those arguments, so far it hasn't

@Kaian
Copy link
Member

Kaian commented Apr 23, 2015

Okey, Thanks for the testing :)

I'll try to get a crashing pcap file to properly test the fixes.

@thefinn93
Copy link
Author

Just confirming that that filter definitely fixes it. I left it running all night, has yet to crash.

@Kaian
Copy link
Member

Kaian commented Apr 23, 2015

I still haven't make it crash, but most of the times it happened, was related with packets that are not SIP but still captured because no bpf filter was applied.

Beware! sngrep stores all packet payload in memory! It can eat all of it if letf alone!
That's why capture.limit setting exists (default to 50000 dialogs).

Thanks a lot for the feedback!

@Kaian Kaian closed this as completed in 517fdca Apr 30, 2015
Kaian added a commit that referenced this issue Apr 30, 2015
Some packets with payload with Call-Id headers were being considered
SIP packets, and that may no be true.

For example, homer packets or moving a sip pcap file to a NFS will
create packets with Call-Id in its payload. Improve the regexp for
matching METHOD and REQUEST CODE to ensure the payload is an actual
SIP message.
@Kaian Kaian mentioned this issue Jun 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants