sipcapture / heplify

Portable and Lightweight HEP Capture Agent for HOMER
https://sipcapture.org
GNU Affero General Public License v3.0
187 stars 66 forks source link

heplify crashes #82

Closed pnlsantos closed 5 years ago

pnlsantos commented 5 years ago

i am using heplify binary as agent but it crashes time to time. I am using centos 6. any idea ?

negbie commented 5 years ago

Hi @pnlsantos to be able to help you I need more information.

  1. Which heplify version do you use?
  2. With which flags do you run heplify?
  3. What are the last log lines before a crash?
  4. How often does it crash?
  5. Do you have a stack trace (what heplify prints on console after crash)?
pnlsantos commented 5 years ago

this is the output error:

[root@ipbx-3b ~]# panic: runtime error: index out of range

goroutine 1 [running]: github.com/negbie/heplify/protos.ParseRTCP(0xc4258aed4c, 0x34, 0x34, 0xc4275c97b8, 0x13, 0x20, 0x13, 0x20, 0xffffffffffffffff, 0x7fbbdd8e6ee3, ...) /go/src/github.com/negbie/heplify/protos/rtcp.go:206 +0x24c7 github.com/negbie/heplify/decoder.(Decoder).correlateRTCP(0xc42010e000, 0xc4258aed3c, 0x4, 0x44, 0x7fbbde07fead, 0xc4258aed4c, 0x34, 0x34, 0x0, 0x0, ...) /go/src/github.com/negbie/heplify/decoder/correlator.go:93 +0x144 github.com/negbie/heplify/decoder.(Decoder).Process(0xc42010e000, 0xc4258aed20, 0x60, 0x60, 0xc426e32b40, 0x60, 0x60, 0x60) /go/src/github.com/negbie/heplify/decoder/decoder.go:252 +0x10d4 github.com/negbie/heplify/sniffer.(MainWorker).OnPacket(0xc42003a000, 0xc4258aed20, 0x60, 0x60, 0xc426e32b40) /go/src/github.com/negbie/heplify/sniffer/sniffer.go:72 +0x69 github.com/negbie/heplify/sniffer.(SnifferSetup).Run(0xc420114080, 0x7fbbddef5860, 0xc420114080) /go/src/github.com/negbie/heplify/sniffer/sniffer.go:285 +0x3f2 main.main() /go/src/github.com/negbie/heplify/main.go:101 +0xde

pnlsantos commented 5 years ago

. /etc/init.d/functions

RETVAL=0 prog="heplify" LOCKFILE=/var/lock/subsys/$prog pid=$(pidof $prog)

Declare variables for GlassFish Server

start() { echo -n "Starting $prog: " daemon /usr/bin/heplify -hs 193.136.200.148:9060 -m SIPRTCP -dim REGISTER,SUBSCRIBE,NOTIFY,OPTIONS -p /var/log/hep & RETVAL=$? [ $RETVAL -eq 0 ] && touch $LOCKFILE echo $pid return $RETVAL }

status() {

pid=$(pidof $prog)

    if [ "$pid" != "" ]; then
    echo -e "$prog pid $pid is running"
    else
    echo -e "$prog is stopped"
    fi

}

stop() { echo -n "Shutting down $prog: " killall heplify RETVAL=$? [ $RETVAL -eq 0 ] && rm -f $LOCKFILE echo return $RETVAL } case "$1" in start) start ;; stop) stop ;; status) status ;; restart) stop start ;; *) echo "Usage: $prog {start|stop|status|restart}" exit 1 ;; esac exit $RETVAL

pnlsantos commented 5 years ago

How can i see the version ?

pnlsantos commented 5 years ago

last logs:

018-11-20T11:47:59Z INFO Packets since last minute IPv4: 600, IPv6: 0, UDP: 464, TCP: 0, RTCP: 257, RTCPFail: 15, DNS: 20, duplicate: 18, fragments: 136, unknown: 0 2018-11-20T11:47:59Z INFO SIPCache EntryCount: 26232, LookupCount: 8610, HitCount: 18, ExpiredCount: 8723, OverwriteCount: 0 2018-11-20T11:47:59Z INFO SDPCache EntryCount: 726, LookupCount: 14, HitCount: 11, ExpiredCount: 0, OverwriteCount: 29 2018-11-20T11:47:59Z INFO RTCPCache EntryCount: 484, LookupCount: 260, HitCount: 246, ExpiredCount: 0, OverwriteCount: 0 2018-11-20T11:48:59Z INFO Packets since last minute sent: 461 2018-11-20T11:48:59Z INFO Packets overall received: 583741, dropped by OS: 0, dropped by interface: 0 2018-11-20T11:48:59Z INFO Packets since last minute IPv4: 711, IPv6: 0, UDP: 477, TCP: 0, RTCP: 274, RTCPFail: 16, DNS: 4, duplicate: 20, fragments: 234, unknown: 0 2018-11-20T11:48:59Z INFO SIPCache EntryCount: 26263, LookupCount: 8761, HitCount: 20, ExpiredCount: 8710, OverwriteCount: 0 2018-11-20T11:48:59Z INFO SDPCache EntryCount: 741, LookupCount: 22, HitCount: 12, ExpiredCount: 0, OverwriteCount: 28 2018-11-20T11:48:59Z INFO RTCPCache EntryCount: 496, LookupCount: 284, HitCount: 262, ExpiredCount: 0, OverwriteCount: 0

pnlsantos commented 5 years ago

sometimes very often 1 per hour

negbie commented 5 years ago

@pnlsantos Thank you for all the information. You can check heplify version with ./heplify -h On top you should see something like "Use heplify 1.45 like: ./heplify [option]"

Nevertheless you already gave me the most important information with:

this is the output error:

[root@ipbx-3b ~]# panic: runtime error: index out of range

goroutine 1 [running]: github.com/negbie/heplify/protos.ParseRTCP(0xc4258aed4c, 0x34, 0x34, 0xc4275c97b8, 0x13, 0x20, 0x13, 0x20, 0xffffffffffffffff, 0x7fbbdd8e6ee3, ...) /go/src/github.com/negbie/heplify/protos/rtcp.go:206 +0x24c7 github.com/negbie/heplify/decoder.(*Decoder).correlateRTCP(0xc42010e000, 0xc4258aed3c, 0x4, 0x44, 0x7fbbde07fead, 0xc4258aed4c, 0x34, 0x34, 0x0, 0x0, ...)

I will check that.

pnlsantos commented 5 years ago

heplify -h Use heplify 1.2 like: heplify [option]

negbie commented 5 years ago

@pnlsantos I will upload heplify 1.46 with the fix soon. Thank you!

negbie commented 5 years ago

@pnlsantos heplify 1.46 is up under https://github.com/sipcapture/heplify/releases

negbie commented 5 years ago

@pnlsantos If the latest fix resolves your problem please feel free to close this issue. Thanks.

negbie commented 5 years ago

Issue has been fixed, let's close it.

pnlsantos commented 5 years ago

thank you negbie, you rock

pnlsantos commented 5 years ago

i just have time to see it now

negbie commented 5 years ago

@pnlsantos thanks, your welcome!