dreadl0ck / netcap

A framework for secure and scalable network traffic analysis - https://netcap.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

net.collect error after some minutes of running

dpicollege opened this issue · comments

Hello, i encounter error when net.collect modules run after some minutes
any help?

panic: runtime error: index out of range

goroutine 194 [running]:
compress/flate.(*huffmanBitWriter).indexTokens(0xc00011e1e0, 0xc0009d0000, 0x4001, 0x4001, 0xc00006bc58, 0x4db6d5)
/usr/local/go/src/compress/flate/huffman_bit_writer.go:551 +0x2d8
compress/flate.(*huffmanBitWriter).writeBlock(0xc00011e1e0, 0xc0009d0000, 0x4001, 0x4001, 0x6e00, 0xc0009c6de1, 0x8949, 0x921f)
/usr/local/go/src/compress/flate/huffman_bit_writer.go:440 +0xa1
compress/flate.(*compressor).writeBlock(0xc00091e000, 0xc0009d0000, 0x4000, 0x4001, 0xf72a, 0x19, 0x6ef0)
/usr/local/go/src/compress/flate/deflate.go:170 +0xc2
compress/flate.(*compressor).deflate(0xc00091e000)
/usr/local/go/src/compress/flate/deflate.go:493 +0x3be
compress/flate.(*compressor).write(0xc00091e000, 0xc00064225c, 0x2791, 0xda4, 0x2800, 0x5a453e55, 0xc0001d4340)
/usr/local/go/src/compress/flate/deflate.go:551 +0x83
compress/flate.(*Writer).Write(...)
/usr/local/go/src/compress/flate/deflate.go:709
compress/gzip.(*Writer).Write(0xc0004a8630, 0xc000640800, 0x2791, 0x2800, 0xc0001d43e0, 0xc0000ac801, 0xc)
/usr/local/go/src/compress/gzip/gzip.go:196 +0xce
main.udpServer.func1.1(0xc00009d8c0, 0xc0000af9a0)
/go/src/github.com/dreadl0ck/netcap/cmd/collect/main.go:230 +0xb2b
created by main.udpServer.func1
/go/src/github.com/dreadl0ck/netcap/cmd/collect/main.go:167 +0x5b

commented

Interesting, I will have a look.

Seems like the gzipWriter for the auditRecords was closed. Do you see any log message related to that before the stack trace?

Did you send the process an OS signal?
The signal cleanup trap closes the gzipWriter, but should also exit the program immediately.

Also the obligatory questions: What OS, what version of OS, Golang and netcap did you use?

thanks for attention. i explain what happen
1- i compiled code on ubuntu 14 and run agent on abuntu 14. the agent work but when lot's of log send to collector i encounter this error.
2- i compiled on ubuntu 18 and have same problem
3- i run your release in hope to no problem would exist so i download the latest release and install libpcap-dev and musl and then execute collector and after a while have this problem.
4- as same of number 3 insted of linux i run windows version of release. i run exe file on windows 2012 and after some minutes i have same error.
i search internet and some one face this problem with other project but i couldn't realize what is exact problem?

so no i just have stack trace log. before i assign any argument for net.collect i have below error.
root@mylinux:/go# ./net.collect
panic: open : no such file or directory

goroutine 1 [running]:
main.udpServer(0xd0a0a0, 0xc000036278, 0xc0b5ef, 0xe, 0xcfa180, 0xc0004641e0)

    /go/src/github.com/dreadl0ck/netcap/cmd/collect/main.go:129 +0x504

main.main()
/go/src/github.com/dreadl0ck/netcap/cmd/collect/main.go:96 +0xf8

and as the release file it's EXE or ELF file i don't installed go ever. but for compile in my labtop i installed latest go version and after compile in dynamic or static linking library i have same problem.

at least which library i should installed ? could you write with exact version on linux and windows?
after encounter with log when i run it again all log that saved in root was deleted any idea to make another file ?
could you make a config file for log rotation cause i want to installed encap on at least 10 server.

any idea from you would be great.
thank for time.

commented

Closed due to age.
If the problem still appears with the latest version, please open a new issue.