Project

General

Profile

Actions

Bug #994

closed

valgrind warnings in unittests

Added by Victor Julien about 11 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

$ gcc --version
gcc (Ubuntu/Linaro 4.8.1-10ubuntu7) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
It was created by suricata configure 2.0dev, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-unittests --disable-gccmarch-native CFLAGS=-Werror -O0 -ggdb --no-create --no-recursion
$ valgrind --version
valgrind-3.8.1

Suricata tests started as:

valgrind -v --trace-children=yes ./src/suricata -u -l tmp/

The trace children is because I have libhtp in the tree and run from the tree, causing ./src/suricata to be a libtool wrapper script.

==7084== 1 errors in context 2 of 13:
==7084== Conditional jump or move depends on uninitialised value(s)
==7084==    at 0x52DA14: SignatureIsDEOnly (detect.c:1975)
==7084==    by 0x52EC53: SigAddressPrepareStage1 (detect.c:2507)
==7084==    by 0x5331F2: SigGroupBuild (detect.c:4317)
==7084==    by 0x509024: DetectAppLayerEventTest05 (detect-app-layer-event.c:676)
==7084==    by 0x8F2F94: UtRunTests (util-unittest.c:202)
==7084==    by 0x7B17A8: RunUnittests (runmode-unittests.c:265)
==7084==    by 0x811C89: main (suricata.c:1874)
==7084== 
==7084== 
==7084== 1 errors in context 3 of 13:
==7084== Conditional jump or move depends on uninitialised value(s)
==7084==    at 0x52D73C: SignatureIsIPOnly (detect.c:1846)
==7084==    by 0x52EBCD: SigAddressPrepareStage1 (detect.c:2495)
==7084==    by 0x5331F2: SigGroupBuild (detect.c:4317)
==7084==    by 0x509024: DetectAppLayerEventTest05 (detect-app-layer-event.c:676)
==7084==    by 0x8F2F94: UtRunTests (util-unittest.c:202)
==7084==    by 0x7B17A8: RunUnittests (runmode-unittests.c:265)
==7084==    by 0x811C89: main (suricata.c:1874)
==7084== 
==7084== 
==7084== 1 errors in context 4 of 13:
==7084== Conditional jump or move depends on uninitialised value(s)
==7084==    at 0x723FAB: SigValidate (detect-parse.c:1209)
==7084==    by 0x725638: SigInitHelper (detect-parse.c:1553)
==7084==    by 0x725864: SigInit (detect-parse.c:1589)
==7084==    by 0x508FF5: DetectAppLayerEventTest05 (detect-app-layer-event.c:671)
==7084==    by 0x8F2F94: UtRunTests (util-unittest.c:202)
==7084==    by 0x7B17A8: RunUnittests (runmode-unittests.c:265)
==7084==    by 0x811C89: main (suricata.c:1874)
==7084== 
==7084== 
==7084== 1 errors in context 5 of 13:
==7084== Conditional jump or move depends on uninitialised value(s)
==7084==    at 0x724B70: SigInitHelper (detect-parse.c:1366)
==7084==    by 0x725864: SigInit (detect-parse.c:1589)
==7084==    by 0x508FF5: DetectAppLayerEventTest05 (detect-app-layer-event.c:671)
==7084==    by 0x8F2F94: UtRunTests (util-unittest.c:202)
==7084==    by 0x7B17A8: RunUnittests (runmode-unittests.c:265)
==7084==    by 0x811C89: main (suricata.c:1874)
==7084== 
==7084== 
==7084== 1 errors in context 6 of 13:
==7084== Conditional jump or move depends on uninitialised value(s)
==7084==    at 0x52DA14: SignatureIsDEOnly (detect.c:1975)
==7084==    by 0x52EC53: SigAddressPrepareStage1 (detect.c:2507)
==7084==    by 0x5331F2: SigGroupBuild (detect.c:4317)
==7084==    by 0x508A23: DetectAppLayerEventTest04 (detect-app-layer-event.c:557)
==7084==    by 0x8F2F94: UtRunTests (util-unittest.c:202)
==7084==    by 0x7B17A8: RunUnittests (runmode-unittests.c:265)
==7084==    by 0x811C89: main (suricata.c:1874)
==7084== 
==7084== 
==7084== 1 errors in context 7 of 13:
==7084== Conditional jump or move depends on uninitialised value(s)
==7084==    at 0x52D73C: SignatureIsIPOnly (detect.c:1846)
==7084==    by 0x52EBCD: SigAddressPrepareStage1 (detect.c:2495)
==7084==    by 0x5331F2: SigGroupBuild (detect.c:4317)
==7084==    by 0x508A23: DetectAppLayerEventTest04 (detect-app-layer-event.c:557)
==7084==    by 0x8F2F94: UtRunTests (util-unittest.c:202)
==7084==    by 0x7B17A8: RunUnittests (runmode-unittests.c:265)
==7084==    by 0x811C89: main (suricata.c:1874)
==7084== 
==7084== 
==7084== 1 errors in context 8 of 13:
==7084== Conditional jump or move depends on uninitialised value(s)
==7084==    at 0x723FAB: SigValidate (detect-parse.c:1209)
==7084==    by 0x725638: SigInitHelper (detect-parse.c:1553)
==7084==    by 0x725864: SigInit (detect-parse.c:1589)
==7084==    by 0x5089F4: DetectAppLayerEventTest04 (detect-app-layer-event.c:552)
==7084==    by 0x8F2F94: UtRunTests (util-unittest.c:202)
==7084==    by 0x7B17A8: RunUnittests (runmode-unittests.c:265)
==7084==    by 0x811C89: main (suricata.c:1874)
==7084== 
==7084== 
==7084== 1 errors in context 9 of 13:
==7084== Conditional jump or move depends on uninitialised value(s)
==7084==    at 0x724B70: SigInitHelper (detect-parse.c:1366)
==7084==    by 0x725864: SigInit (detect-parse.c:1589)
==7084==    by 0x5089F4: DetectAppLayerEventTest04 (detect-app-layer-event.c:552)
==7084==    by 0x8F2F94: UtRunTests (util-unittest.c:202)
==7084==    by 0x7B17A8: RunUnittests (runmode-unittests.c:265)
==7084==    by 0x811C89: main (suricata.c:1874)
==7084== 
==7084== 
==7084== 1 errors in context 10 of 13:
==7084== Conditional jump or move depends on uninitialised value(s)
==7084==    at 0x52DA14: SignatureIsDEOnly (detect.c:1975)
==7084==    by 0x52EC53: SigAddressPrepareStage1 (detect.c:2507)
==7084==    by 0x5331F2: SigGroupBuild (detect.c:4317)
==7084==    by 0x508421: DetectAppLayerEventTest03 (detect-app-layer-event.c:454)
==7084==    by 0x8F2F94: UtRunTests (util-unittest.c:202)
==7084==    by 0x7B17A8: RunUnittests (runmode-unittests.c:265)
==7084==    by 0x811C89: main (suricata.c:1874)
==7084== 
==7084== 
==7084== 1 errors in context 11 of 13:
==7084== Conditional jump or move depends on uninitialised value(s)
==7084==    at 0x52D73C: SignatureIsIPOnly (detect.c:1846)
==7084==    by 0x52EBCD: SigAddressPrepareStage1 (detect.c:2495)
==7084==    by 0x5331F2: SigGroupBuild (detect.c:4317)
==7084==    by 0x508421: DetectAppLayerEventTest03 (detect-app-layer-event.c:454)
==7084==    by 0x8F2F94: UtRunTests (util-unittest.c:202)
==7084==    by 0x7B17A8: RunUnittests (runmode-unittests.c:265)
==7084==    by 0x811C89: main (suricata.c:1874)
==7084== 
==7084== 
==7084== 1 errors in context 12 of 13:
==7084== Conditional jump or move depends on uninitialised value(s)
==7084==    at 0x723FAB: SigValidate (detect-parse.c:1209)
==7084==    by 0x725638: SigInitHelper (detect-parse.c:1553)
==7084==    by 0x725864: SigInit (detect-parse.c:1589)
==7084==    by 0x5083F2: DetectAppLayerEventTest03 (detect-app-layer-event.c:449)
==7084==    by 0x8F2F94: UtRunTests (util-unittest.c:202)
==7084==    by 0x7B17A8: RunUnittests (runmode-unittests.c:265)
==7084==    by 0x811C89: main (suricata.c:1874)
==7084== 
==7084== 
==7084== 1 errors in context 13 of 13:
==7084== Conditional jump or move depends on uninitialised value(s)
==7084==    at 0x724B70: SigInitHelper (detect-parse.c:1366)
==7084==    by 0x725864: SigInit (detect-parse.c:1589)
==7084==    by 0x5083F2: DetectAppLayerEventTest03 (detect-app-layer-event.c:449)
==7084==    by 0x8F2F94: UtRunTests (util-unittest.c:202)
==7084==    by 0x7B17A8: RunUnittests (runmode-unittests.c:265)
==7084==    by 0x811C89: main (suricata.c:1874)

Not seeing these on other boxes, so it may be related to the newer gcc and valgrind versions.

Actions #1

Updated by Victor Julien about 11 years ago

Happens when compiled with clang as well.

$ clang --version
Ubuntu clang version 3.3-5ubuntu4 (branches/release_33) (based on LLVM 3.3)
Target: x86_64-pc-linux-gnu
Thread model: posix

Actions #2

Updated by Victor Julien about 11 years ago

Also seeing this on my main workstation now btw:

==23257== 1 errors in context 2 of 16:
==23257== Conditional jump or move depends on uninitialised value(s)
==23257==    at 0x6AE17F5: _itoa_word (_itoa.c:195)
==23257==    by 0x6AE3837: vfprintf (vfprintf.c:1629)
==23257==    by 0x6AEC8D8: printf (printf.c:35)
==23257==    by 0x4A3C93: AppLayerPPTestData (app-layer-parser.c:2639)
==23257==    by 0x4A4B2E: AppLayerProbingParserTest01 (app-layer-parser.c:3002)
==23257==    by 0xA30B8B: UtRunTests (util-unittest.c:202)
==23257==    by 0x871CCE: RunUnittests (runmode-unittests.c:265)
==23257==    by 0x923D08: main (suricata.c:1874)
==23257== 
==23257== 
==23257== 1 errors in context 3 of 16:
==23257== Use of uninitialised value of size 8
==23257==    at 0x6AE17EB: _itoa_word (_itoa.c:195)
==23257==    by 0x6AE3837: vfprintf (vfprintf.c:1629)
==23257==    by 0x6AEC8D8: printf (printf.c:35)
==23257==    by 0x4A3C93: AppLayerPPTestData (app-layer-parser.c:2639)
==23257==    by 0x4A4B2E: AppLayerProbingParserTest01 (app-layer-parser.c:3002)
==23257==    by 0xA30B8B: UtRunTests (util-unittest.c:202)
==23257==    by 0x871CCE: RunUnittests (runmode-unittests.c:265)
==23257==    by 0x923D08: main (suricata.c:1874)
==23257== 
==23257== 
==23257== 1 errors in context 4 of 16:
==23257== Conditional jump or move depends on uninitialised value(s)
==23257==    at 0x6AE34F1: vfprintf (vfprintf.c:1629)
==23257==    by 0x6AEC8D8: printf (printf.c:35)
==23257==    by 0x4A3C93: AppLayerPPTestData (app-layer-parser.c:2639)
==23257==    by 0x4A4B2E: AppLayerProbingParserTest01 (app-layer-parser.c:3002)
==23257==    by 0xA30B8B: UtRunTests (util-unittest.c:202)
==23257==    by 0x871CCE: RunUnittests (runmode-unittests.c:265)
==23257==    by 0x923D08: main (suricata.c:1874)
==23257== 
==23257== 
==23257== 1 errors in context 5 of 16:
==23257== Conditional jump or move depends on uninitialised value(s)
==23257==    at 0x583AB3: SignatureIsDEOnly (detect.c:1975)
==23257==    by 0x587D77: SigAddressPrepareStage1 (detect.c:2507)
==23257==    by 0x58F691: SigGroupBuild (detect.c:4317)
==23257==    by 0x5569C0: DetectAppLayerEventTest05 (detect-app-layer-event.c:676)
==23257==    by 0xA30B8B: UtRunTests (util-unittest.c:202)
==23257==    by 0x871CCE: RunUnittests (runmode-unittests.c:265)
==23257==    by 0x923D08: main (suricata.c:1874)
==23257== 
==23257== 
==23257== 1 errors in context 6 of 16:
==23257== Conditional jump or move depends on uninitialised value(s)
==23257==    at 0x58360E: SignatureIsIPOnly (detect.c:1846)
==23257==    by 0x587B57: SigAddressPrepareStage1 (detect.c:2495)
==23257==    by 0x58F691: SigGroupBuild (detect.c:4317)
==23257==    by 0x5569C0: DetectAppLayerEventTest05 (detect-app-layer-event.c:676)
==23257==    by 0xA30B8B: UtRunTests (util-unittest.c:202)
==23257==    by 0x871CCE: RunUnittests (runmode-unittests.c:265)
==23257==    by 0x923D08: main (suricata.c:1874)
==23257== 
==23257== 
==23257== 1 errors in context 7 of 16:
==23257== Conditional jump or move depends on uninitialised value(s)
==23257==    at 0x7C851B: SigValidate (detect-parse.c:1209)
==23257==    by 0x7CA29F: SigInitHelper (detect-parse.c:1553)
==23257==    by 0x7CA57F: SigInit (detect-parse.c:1589)
==23257==    by 0x556992: DetectAppLayerEventTest05 (detect-app-layer-event.c:671)
==23257==    by 0xA30B8B: UtRunTests (util-unittest.c:202)
==23257==    by 0x871CCE: RunUnittests (runmode-unittests.c:265)
==23257==    by 0x923D08: main (suricata.c:1874)
==23257== 
==23257== 
==23257== 1 errors in context 8 of 16:
==23257== Conditional jump or move depends on uninitialised value(s)
==23257==    at 0x7C96C2: SigInitHelper (detect-parse.c:1366)
==23257==    by 0x7CA57F: SigInit (detect-parse.c:1589)
==23257==    by 0x556992: DetectAppLayerEventTest05 (detect-app-layer-event.c:671)
==23257==    by 0xA30B8B: UtRunTests (util-unittest.c:202)
==23257==    by 0x871CCE: RunUnittests (runmode-unittests.c:265)
==23257==    by 0x923D08: main (suricata.c:1874)
==23257== 
==23257== 
==23257== 1 errors in context 9 of 16:
==23257== Conditional jump or move depends on uninitialised value(s)
==23257==    at 0x583AB3: SignatureIsDEOnly (detect.c:1975)
==23257==    by 0x587D77: SigAddressPrepareStage1 (detect.c:2507)
==23257==    by 0x58F691: SigGroupBuild (detect.c:4317)
==23257==    by 0x55638A: DetectAppLayerEventTest04 (detect-app-layer-event.c:557)
==23257==    by 0xA30B8B: UtRunTests (util-unittest.c:202)
==23257==    by 0x871CCE: RunUnittests (runmode-unittests.c:265)
==23257==    by 0x923D08: main (suricata.c:1874)
==23257== 
==23257== 
==23257== 1 errors in context 10 of 16:
==23257== Conditional jump or move depends on uninitialised value(s)
==23257==    at 0x58360E: SignatureIsIPOnly (detect.c:1846)
==23257==    by 0x587B57: SigAddressPrepareStage1 (detect.c:2495)
==23257==    by 0x58F691: SigGroupBuild (detect.c:4317)
==23257==    by 0x55638A: DetectAppLayerEventTest04 (detect-app-layer-event.c:557)
==23257==    by 0xA30B8B: UtRunTests (util-unittest.c:202)
==23257==    by 0x871CCE: RunUnittests (runmode-unittests.c:265)
==23257==    by 0x923D08: main (suricata.c:1874)
==23257== 
==23257== 
==23257== 1 errors in context 11 of 16:
==23257== Conditional jump or move depends on uninitialised value(s)
==23257==    at 0x7C851B: SigValidate (detect-parse.c:1209)
==23257==    by 0x7CA29F: SigInitHelper (detect-parse.c:1553)
==23257==    by 0x7CA57F: SigInit (detect-parse.c:1589)
==23257==    by 0x55635C: DetectAppLayerEventTest04 (detect-app-layer-event.c:552)
==23257==    by 0xA30B8B: UtRunTests (util-unittest.c:202)
==23257==    by 0x871CCE: RunUnittests (runmode-unittests.c:265)
==23257==    by 0x923D08: main (suricata.c:1874)
==23257== 
==23257== 
==23257== 1 errors in context 12 of 16:
==23257== Conditional jump or move depends on uninitialised value(s)
==23257==    at 0x7C96C2: SigInitHelper (detect-parse.c:1366)
==23257==    by 0x7CA57F: SigInit (detect-parse.c:1589)
==23257==    by 0x55635C: DetectAppLayerEventTest04 (detect-app-layer-event.c:552)
==23257==    by 0xA30B8B: UtRunTests (util-unittest.c:202)
==23257==    by 0x871CCE: RunUnittests (runmode-unittests.c:265)
==23257==    by 0x923D08: main (suricata.c:1874)
==23257== 
==23257== 
==23257== 1 errors in context 13 of 16:
==23257== Conditional jump or move depends on uninitialised value(s)
==23257==    at 0x583AB3: SignatureIsDEOnly (detect.c:1975)
==23257==    by 0x587D77: SigAddressPrepareStage1 (detect.c:2507)
==23257==    by 0x58F691: SigGroupBuild (detect.c:4317)
==23257==    by 0x555D53: DetectAppLayerEventTest03 (detect-app-layer-event.c:454)
==23257==    by 0xA30B8B: UtRunTests (util-unittest.c:202)
==23257==    by 0x871CCE: RunUnittests (runmode-unittests.c:265)
==23257==    by 0x923D08: main (suricata.c:1874)
==23257== 
==23257== 
==23257== 1 errors in context 14 of 16:
==23257== Conditional jump or move depends on uninitialised value(s)
==23257==    at 0x58360E: SignatureIsIPOnly (detect.c:1846)
==23257==    by 0x587B57: SigAddressPrepareStage1 (detect.c:2495)
==23257==    by 0x58F691: SigGroupBuild (detect.c:4317)
==23257==    by 0x555D53: DetectAppLayerEventTest03 (detect-app-layer-event.c:454)
==23257==    by 0xA30B8B: UtRunTests (util-unittest.c:202)
==23257==    by 0x871CCE: RunUnittests (runmode-unittests.c:265)
==23257==    by 0x923D08: main (suricata.c:1874)
==23257== 
==23257== 
==23257== 1 errors in context 15 of 16:
==23257== Conditional jump or move depends on uninitialised value(s)
==23257==    at 0x7C851B: SigValidate (detect-parse.c:1209)
==23257==    by 0x7CA29F: SigInitHelper (detect-parse.c:1553)
==23257==    by 0x7CA57F: SigInit (detect-parse.c:1589)
==23257==    by 0x555D25: DetectAppLayerEventTest03 (detect-app-layer-event.c:449)
==23257==    by 0xA30B8B: UtRunTests (util-unittest.c:202)
==23257==    by 0x871CCE: RunUnittests (runmode-unittests.c:265)
==23257==    by 0x923D08: main (suricata.c:1874)
==23257== 
==23257== 
==23257== 1 errors in context 16 of 16:
==23257== Conditional jump or move depends on uninitialised value(s)
==23257==    at 0x7C96C2: SigInitHelper (detect-parse.c:1366)
==23257==    by 0x7CA57F: SigInit (detect-parse.c:1589)
==23257==    by 0x555D25: DetectAppLayerEventTest03 (detect-app-layer-event.c:449)
==23257==    by 0xA30B8B: UtRunTests (util-unittest.c:202)
==23257==    by 0x871CCE: RunUnittests (runmode-unittests.c:265)
==23257==    by 0x923D08: main (suricata.c:1874)

Actions #3

Updated by Victor Julien about 11 years ago

  • Assignee changed from Anoop Saldanha to Victor Julien
Actions #4

Updated by Victor Julien about 11 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

Fixed by:

commit 493d531ae81d4889ea48b2985f686335be0231a6
Author: Victor Julien <victor@inliniac.net>
Date:   Mon Nov 25 19:38:14 2013 +0100

    Fix using uninitialized memory (Bug #994)

Actions

Also available in: Atom PDF