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
Bug 1725 #1948
Closed
Closed
Bug 1725 #1948
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Returning early if first function call fail could avoid some issue.
In JsonEmailLogJsonData function, an invalid state was leading to early exit without a proper freeing of resources. This should fix: Indirect leak of 72 byte(s) in 1 object(s) allocated from: #0 0x4c264b in malloc (/home/victor/qa/buildbot/donkey/z600fuzz/Private/src/.libs/lt-suricata+0x4c264b) #1 0x7fb09c1e886a in json_object (/usr/lib/x86_64-linux-gnu/libjansson.so.4+0x686a) #2 0xd6a272 in JsonEmailLogJson /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/output-json-email-common.c:370:19 #3 0xd956b9 in JsonSmtpLogger /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/output-json-smtp.c:103:9 #4 0xdcedac in OutputTxLog /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/output-tx.c:165:17 #5 0xff6669 in TmThreadsSlotVarRun /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/tm-threads.c:132:17 #6 0xffecc1 in TmThreadsSlotVar /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/tm-threads.c:474:17 #7 0x7fb09bfcc181 in start_thread /build/eglibc-3GlaMS/eglibc-2.19/nptl/pthread_create.c:312
This possibly fix: ndirect leak of 64 byte(s) in 1 object(s) allocated from: #0 0x4c264b in malloc (/home/victor/qa/buildbot/donkey/z600fuzz/Private/src/.libs/lt-suricata+0x4c264b) #1 0x7fb09c1e8aaa in json_array (/usr/lib/x86_64-linux-gnu/libjansson.so.4+0x6aaa) #2 0xd67553 in JsonEmailLogJsonData /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/output-json-email-common.c:290:27 #3 0xd6a272 in JsonEmailLogJson /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/output-json-email-common.c:370:19 #4 0xd956b9 in JsonSmtpLogger /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/output-json-smtp.c:103:9 #5 0xdcedac in OutputTxLog /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/output-tx.c:165:17 #6 0xff6669 in TmThreadsSlotVarRun /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/tm-threads.c:132:17 #7 0xffecc1 in TmThreadsSlotVar /home/victor/qa/buildbot/donkey/z600fuzz/Private/src/tm-threads.c:474:17 #8 0x7fb09bfcc181 in start_thread /build/eglibc-3GlaMS/eglibc-2.19/nptl/pthread_create.c:312
Still getting: ================================================================= ==15439==ERROR: LeakSanitizer: detected memory leaks Indirect leak of 945 byte(s) in 21 object(s) allocated from: #0 0x4c610b in malloc (/home/victor/dev/suricata/src/suricata+0x4c610b) #1 0x7f18bb5f2b48 (/usr/lib/x86_64-linux-gnu/libjansson.so.4+0x2b48) Indirect leak of 598 byte(s) in 21 object(s) allocated from: #0 0x4c610b in malloc (/home/victor/dev/suricata/src/suricata+0x4c610b) #1 0x7f18bb5f48ff (/usr/lib/x86_64-linux-gnu/libjansson.so.4+0x48ff) Indirect leak of 560 byte(s) in 7 object(s) allocated from: #0 0x4c610b in malloc (/home/victor/dev/suricata/src/suricata+0x4c610b) #1 0x7f18bb5f28dc (/usr/lib/x86_64-linux-gnu/libjansson.so.4+0x28dc) #2 0xd81fc3 in JsonEmailLogJson /home/victor/dev/suricata/src/output-json-email-common.c:374:19 #3 0xdad47d in JsonSmtpLogger /home/victor/dev/suricata/src/output-json-smtp.c:103:9 #4 0xde6a3d in OutputTxLog /home/victor/dev/suricata/src/output-tx.c:165:17 #5 0x100cb9a in TmThreadsSlotVarRun /home/victor/dev/suricata/src/tm-threads.c:134:17 #6 0x10151ea in TmThreadsSlotVar /home/victor/dev/suricata/src/tm-threads.c:476:17 #7 0x7f18bb3da181 in start_thread /build/eglibc-3GlaMS/eglibc-2.19/nptl/pthread_create.c:312 Indirect leak of 504 byte(s) in 21 object(s) allocated from: #0 0x4c610b in malloc (/home/victor/dev/suricata/src/suricata+0x4c610b) #1 0x7f18bb5f6be7 in json_string_nocheck (/usr/lib/x86_64-linux-gnu/libjansson.so.4+0x6be7) Indirect leak of 504 byte(s) in 7 object(s) allocated from: #0 0x4c610b in malloc (/home/victor/dev/suricata/src/suricata+0x4c610b) #1 0x7f18bb5f686a in json_object (/usr/lib/x86_64-linux-gnu/libjansson.so.4+0x686a) #2 0xd81fc3 in JsonEmailLogJson /home/victor/dev/suricata/src/output-json-email-common.c:374:19 #3 0xdad47d in JsonSmtpLogger /home/victor/dev/suricata/src/output-json-smtp.c:103:9 #4 0xde6a3d in OutputTxLog /home/victor/dev/suricata/src/output-tx.c:165:17 #5 0x100cb9a in TmThreadsSlotVarRun /home/victor/dev/suricata/src/tm-threads.c:134:17 #6 0x10151ea in TmThreadsSlotVar /home/victor/dev/suricata/src/tm-threads.c:476:17 #7 0x7f18bb3da181 in start_thread /build/eglibc-3GlaMS/eglibc-2.19/nptl/pthread_create.c:312 Indirect leak of 448 byte(s) in 7 object(s) allocated from: #0 0x4c610b in malloc (/home/victor/dev/suricata/src/suricata+0x4c610b) #1 0x7f18bb5f6aaa in json_array (/usr/lib/x86_64-linux-gnu/libjansson.so.4+0x6aaa) #2 0xd7f17a in JsonEmailLogJsonData /home/victor/dev/suricata/src/output-json-email-common.c:294:27 #3 0xd81fc3 in JsonEmailLogJson /home/victor/dev/suricata/src/output-json-email-common.c:374:19 #4 0xdad47d in JsonSmtpLogger /home/victor/dev/suricata/src/output-json-smtp.c:103:9 #5 0xde6a3d in OutputTxLog /home/victor/dev/suricata/src/output-tx.c:165:17 #6 0x100cb9a in TmThreadsSlotVarRun /home/victor/dev/suricata/src/tm-threads.c:134:17 #7 0x10151ea in TmThreadsSlotVar /home/victor/dev/suricata/src/tm-threads.c:476:17 #8 0x7f18bb3da181 in start_thread /build/eglibc-3GlaMS/eglibc-2.19/nptl/pthread_create.c:312 Indirect leak of 336 byte(s) in 7 object(s) allocated from: #0 0x4c610b in malloc (/home/victor/dev/suricata/src/suricata+0x4c610b) #1 0x7f18bb5f6a7a in json_array (/usr/lib/x86_64-linux-gnu/libjansson.so.4+0x6a7a) #2 0xd7f17a in JsonEmailLogJsonData /home/victor/dev/suricata/src/output-json-email-common.c:294:27 #3 0xd81fc3 in JsonEmailLogJson /home/victor/dev/suricata/src/output-json-email-common.c:374:19 #4 0xdad47d in JsonSmtpLogger /home/victor/dev/suricata/src/output-json-smtp.c:103:9 #5 0xde6a3d in OutputTxLog /home/victor/dev/suricata/src/output-tx.c:165:17 #6 0x100cb9a in TmThreadsSlotVarRun /home/victor/dev/suricata/src/tm-threads.c:134:17 #7 0x10151ea in TmThreadsSlotVar /home/victor/dev/suricata/src/tm-threads.c:476:17 #8 0x7f18bb3da181 in start_thread /build/eglibc-3GlaMS/eglibc-2.19/nptl/pthread_create.c:312 |
Closed
Replaced by #1952 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt to fix memory leaks detected in redmine issue 1725.
Redmine ticket: https://redmine.openinfosecfoundation.org/issues/1725
PR builds: