-
Notifications
You must be signed in to change notification settings - Fork 3
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
memory leak #1
Comments
Hello, this is something to investigate. For sure there is an invalid read reported by valgrind:
Running |
Thanks, I have referred to the logic of wireshark, tshark, and rawshark source code to implement different versions of offline and online packet capture parsing logic. |
Invalid read size fixed in cf3c876.
Inspecting the leaks, they are related to some state that wireshark does not clean up (e.g. Please post links to your custom code, trying to minimizing the changes w.r.t. this repo example so that I can try to reproduce this. |
I'm having a memory leak when modifying the real-time traffic that ushark uses to parse fetched from the network device:
pcap_open_offline
function incap_example.c
topcap_open_live
to listen for the traffic of a network device.atop -m
command to observe the change of the memory occupation of the program, and find that the memory occupation is increasing.valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --trace-children=yes --log-file=leak.txt -v ./test
gave the memory leak analysis report and found that there was nodefinitely lost
.memcpy(ws_buffer_start_ptr(buf), sk->dissect.pkt, len);
changed tomemcpy(ws_buffer_start_ptr(buf), "", len);
When testing, the memory leak problem disappeared, so it can be judged that it is a problem with BUF. When I tried to add the processing logic for bufws_buffer_free(&buf);
There is no improvement either.The text was updated successfully, but these errors were encountered: