Project

General

Profile

Actions

Bug #217

closed

Segv when rule profiling enabled but no rules loaded

Added by Will Metcalf over 14 years ago. Updated over 14 years ago.

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

Description

Forgot to pass a rules file via command line and with rule perf enabled we segv if no rules are loaded. I realize it's not a high priority but we should probably have better error handling here.

ulimit c unlimited; sudo src/suricata -c suricata.yaml -l ./ -r ../pcaps/tests/sandnet.pcap
....
[23599] 21/7/2010 -
19:51:28 - (alert-unified2-alert.c:603) <Info> (Unified2AlertThreadDeinit) -- Alert unified2 module wrote 0 alerts
[23599] 21/7/2010 -- 19:51:28 - (log-httplog.c:396) <Info> (LogHttpLogExitPrintStats) -- (Outputs) HTTP requests 11725
[23600] 21/7/2010 -- 19:51:28 - (flow.c:1107) <Info> (FlowManagerThread) -- 4776 new flows, 57624 established flows were timed out, 53615 flows in closed state
[23569] 21/7/2010 -- 19:51:28 - (stream-tcp-reassemble.c:288) <Info> (StreamTcpReassembleFree) -- Max memuse of the stream reassembly engine 11448800 (in use 0)
[23569] 21/7/2010 -- 19:51:28 - (stream-tcp.c:462) <Info> (StreamTcpFreeConfig) -- Max memuse of stream engine 5505024 (in use 0)
[23569] 21/7/2010 -- 19:51:28 - (detect.c:2754) <Info> (SigAddressCleanupStage1) -- cleaning up signature grouping structure...
[23569] 21/7/2010 -- 19:51:28 - (detect.c:2769) <Info> (SigAddressCleanupStage1) -- cleaning up signature grouping structure... done
Segmentation fault

(gdb) bt full
#0 0x000000000049c44d in SCProfilingDump (output=0x7febb94c4780) at util-profiling.c:200
i = <value optimized out>
count = <value optimized out>
total_ticks = <value optimized out>
FUNCTION = "SCProfilingDump"
#1 0x0000000000405ecf in main (argc=7, argv=<value optimized out>) at suricata.c:1219
opt = <value optimized out>
pcap_file = 0x7fff843b05b9 "../pcaps/tests/sandnet.pcap"
pcap_dev = "\302\000\000\000\000\000\000\000\357\353:\204\377\177\000\000\356\353:\204\377\177\000\000\000\000\000\000\000\000\000\000\200\244[\272\353\177\000\000\000\354:\204\377\177\000\000\030\354:\204\377\177\000\000\344\262\360\000\001\000\000\000\302\000\000\000\000\000\000\000\031\"@\000\000\000\000\000\357\353:\204\377\177\000\000\001", '\000' <repeats 15 times>, "&K\035\271\353\177\000\000\000\000\000\000\000\000\000\000\060\314I\000\000\000\000"
sig_file = 0x0
conf_filename = 0x7fff843b05a2 "suricata.yaml"
pid_filename = 0x0
dump_config = 0
list_unittests = 0
list_cuda_cards = 0
daemon = 0
erf_file = 0x0
log_dir = 0x25012b0 "./"
buf = {st_dev = 2055, st_ino = 5023682, st_nlink = 10, st_mode = 16877, st_uid = 1000, st_gid = 1000, pad0 = 0, st_rdev = 0, st_size = 4096, st_blksize = 4096, st_blocks = 8, st_atim = {tv_sec = 1279754660, tv_nsec = 0},
st_mtim = {tv_sec = 1279755027, tv_nsec = 0}, st_ctim = {tv_sec = 1279755027, tv_nsec = 0}, __unused = {0, 0, 0}}
__FUNCTION
= "main"
long_opts = {{name = 0x49cd67 "dump-config", has_arg = 0, flag = 0x7fff843ae75c, val = 1}, {name = 0x49cd73 "pfring-int", has_arg = 1, flag = 0x0, val = 0}, {name = 0x49cd7e "pfring-cluster-id", has_arg = 1, flag = 0x0,
val = 0}, {name = 0x49cd90 "pfring-cluster-type", has_arg = 1, flag = 0x0, val = 0}, {name = 0x49cda4 "pcap-buffer-size", has_arg = 1, flag = 0x0, val = 0}, {name = 0x49cdb5 "unittest-filter", has_arg = 1, flag = 0x0,
val = 85}, {name = 0x49cdc5 "list-unittests", has_arg = 0, flag = 0x7fff843ae758, val = 1}, {name = 0x49cdd4 "list-cuda-cards", has_arg = 0, flag = 0x7fff843ae754, val = 1}, {name = 0x49cde4 "pidfile", has_arg = 1,
flag = 0x0, val = 0}, {name = 0x49cdec "init-errors-fatal", has_arg = 0, flag = 0x0, val = 0}, {name = 0x49cdfe "fatal-unittests", has_arg = 0, flag = 0x0, val = 0}, {name = 0x49ce0e "user", has_arg = 1, flag = 0x0,
val = 0}, {name = 0x49ce13 "group", has_arg = 1, flag = 0x0, val = 0}, {name = 0x49ce19 "erf-in", has_arg = 1, flag = 0x0, val = 0}, {name = 0x49ce20 "dag", has_arg = 1, flag = 0x0, val = 0}, {name = 0x0, has_arg = 0,
flag = 0x0, val = 0}}
option_index = 0
short_opts = "c:Dhi:l:q:d:r:us:U:V"
c = <value optimized out>
i = <value optimized out>
de_ctx = 0x2cbf100
start_time = {tv_sec = 1279755060, tv_usec = 421671}

Actions #1

Updated by Victor Julien over 14 years ago

  • Assignee changed from OISF Dev to Pablo Rincon
Actions #2

Updated by Victor Julien over 14 years ago

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

Patch applied, thanks Pablo. Commit c1486d7f2e1be0177e18a61fd2552b218f2401e0

Actions

Also available in: Atom PDF