[Oisf-devel] Lack of Thread Deinitialization For Decoder Modules

Victor Julien victor at inliniac.net
Wed Nov 20 09:38:56 EST 2013


On 11/20/2013 03:32 PM, amin latifi wrote:
> I checked Suricata code and I found out that decoder thread modules
> don't set ThreadDeinit member of their TmModule in tmm_modules table.
> 
> It somehow doesn't seem normal. Since, decode threads have at least one
> member in their DecodeThreadVars which maybe should be deinitialized.
> Actually, I realized DecodeThreadVars  contains AlpProtoDetectThreadCtx
> member and the AlpProtoDetectThreadCtx variables maybe should be
> deinitialized by using AlpProtoFinalize2Thread function; similar what
> happens in StreamTcpThreadDeinit (StreamTcp thread deinitializing)
> procedure. 
> 
> According what I said, do you think the implementation of decoders'
> deinitialization has been missed mistakenly? or not implementing of that
> doesn't make any problem?

I would prefer to have them, but it's not a big deal currently. The
threads should only end at engine shutdown, so the OS will clean up for us.

There may be a small corner case where a thread failure and restart may
loose some memory, but I think in practice this isn't a big issue either.

-- 
---------------------------------------------
Victor Julien
http://www.inliniac.net/
PGP: http://www.inliniac.net/victorjulien.asc
---------------------------------------------



More information about the Oisf-devel mailing list