bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Several Bugs in cfengine 2.0.4?


From: Mark . Burgess
Subject: Re: Several Bugs in cfengine 2.0.4?
Date: Thu, 12 Sep 2002 22:58:47 +0200 (MET DST)

Thanks for these notes.

On 12 Sep, Andreas Poenicke wrote:
> Hallo,
> 
> having some trouble with a segmentation fault,
> I did an intense debugging of cfengine 2.0.4.
> 
> Probably there are some problems:
> 
> ========================================
> 
> cfagent.c:
> ----------
> 
> Line 122: 
> In ParseInputFiles(), DeleteParser() is called.
> This includes free(LINKTO). Nevertheless LINKTO
> is used intensively later on.

Doesn't matter


> Line 300:
>       RAND_bytes(s,16) 
>       seed=ElfHash(s)
> 
> ElfHash seems to assume a NULL terminated string.
> But "RAND_bytes() puts num cryptographically strong 
> pseudo-random bytes into buf." This means s is not
> NULL terminated and even can have zeros earlier.
> Therefor probably a loop " while(*s){... *s++ ...} "
> like in ElfHash is not a good idea.


Fixed

> ========================================
> 
> init.c:
> ------ 
> Line 140:
> SIGNALS[SIGINT] is defined a second time. 
> -> Small memory leak.
> 

Fixed

> ========================================
> 
> install.c -> do.c -> link.c
> ------
> 
> The Argument "nofile" calling functions like
>   int LinkChildFiles(from,to,type,inclusions,exclusions,copy,nofile,ptr)      
> (of link.c) seems to be never initialised.

Fixed 
     
> At least I can't find anything in 
> install.c,L1757: void  InstallLinkChildrenItem(from,to) 
> or later on.
> 
> ========================================
> 
> do.c
> ----
> lp->filters seems to be not initialized in MakeChildLinks,
> before calling in line 444  RecursiveLink()


Don't understand this.

> ========================================
> 
> parse.c
> -------
> L.104 via the if(){} statement the function can
> be left without calling DeleteParser().
> This gives rise to a memory leak, if there is no 
> update.conf. 
> 

Fixed.


> ==================================================
> 
> Sorry, that I don't contribute any patches but the
> whole source is to complex for me. Hope this helps
> nevertheless.
> 
> Regards,
> Andreas

You can download the patched sources from developer
pages of www.cfengine.org if you would like to see if
this helps. I don't think the changes will do much.


If you are seeing a segfault, please try to run in gdb
and when it stops, get a backtrace, so that I can see
what is happening. You can also run with -d2 to find
more info,

best
Mark

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  address@hidden
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~






reply via email to

[Prev in Thread] Current Thread [Next in Thread]