-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,


running on CentOS 5.3 / RHEL5.3 32 and 64bit , cf3 trunk build 434.
When compiling cf3 without special options the cf-agent binary is
throwing a segfault after every run.
When disabling FORTIFY_SOURCE with CFLAGS="-g -O2 -D_FORTIFY_SOURCE=0"
the binary is running somewhat stable ... but on configuration errors it
still reacts sometimes with segmentation faults. The bad side is that
cf-agent intends to go into failsafe mode but never does because of the
segfault.
Below you can find some examples.

- -- this seems to be reproducable -------------------------

looks like when cf-agent is called with the -f option and through the
path variable (not direct path) it is segfaulting ...
Same happens when instead of the -f option an broken promise is
configured. The agent will segfault.

> this is fine
[r...@mir inputs]# /var/cfengine/bin/cf-agent -K -f testing/hello_world.cf
R: Hello World

> this is bad
r...@mir inputs]# cf-agent -K -f testing/hello_world.cf
R: Hello World
*** buffer overflow detected ***: cf-agent terminated
======= Backtrace: =========
/lib/i686/nosegneg/libc.so.6(__chk_fail+0x41)[0x907f61]
/lib/i686/nosegneg/libc.so.6(__strcpy_chk+0x43)[0x907383]
cf-agent[0x809f95e]
cf-agent[0x809fefa]

another example.
- ----- wrong defined body should not finish in a segfault of cf-agent
- --------------------

[r...@mir inputs]# cf-agent -K
cf3:/var/cfengine/inputs/sys/main.cf:3,1: Redefinition of body control
for common is a broken promise, near token '{'
cf3:/var/cfengine/inputs/sys/main.cf:12,20: Redefinition of input list
(broken promise), near token '}'
Summarizing promises as text to /var/cfengine/inputs/promises.cf.txt
Summarizing promises as html to /var/cfengine/inputs/promises.cf.html
cf-agent was not able to get confirmation of promises from cf-promises,
so going to failsafe
*** buffer overflow detected ***: cf-agent terminated
======= Backtrace: =========
/lib/i686/nosegneg/libc.so.6(__chk_fail+0x41)[0x907f61]
/lib/i686/nosegneg/libc.so.6(__strcpy_chk+0x43)[0x907383]
cf-agent[0x809f95e]
cf-agent[0x809fefa]
cf-agent[0x804cba4]
/lib/i686/nosegneg/libc.so.6(__libc_start_main+0xdc)[0x835e8c]
cf-agent[0x804ad51]

well it never goes into failsafe because of the segfault and my clients
will become unmanaged through this.

- --------------------------------------------------


and yet another example. I was trying to fill an slist with
execresult("/bin/ls /mydir/*.cf","noshell") and divine what. The
cf-agent process dies with a segmentation fault .... but this one is
different than the others ;)

when using execresult to get a dynamic configfile list all processes do
segfaults
cf3   > Parsing file /var/cfengine/inputs/sys/update.cf
cf3   > Parsing file /var/cfengine/inputs/sys/library.cf
cf3   > Parsing file /var/cfengine/inputs/sys/server.cf
cf3   > Parsing file /var/cfengine/inputs/sys/cfengine_maintenance.cf
Segmentation fault

- ------ details ---
GetVariable(global,files_unixnews): using scope 'global' for variable
'files_unixnews'
return final variable type=slist, value={
/bin/ls: /var/cfengine/unixnews.ch/*.cf: No such file or directory}
ExpandPrivateRval(scope=sys,type=/)
Cannot append X to rval-list [(null)]
Segmentation fault
- -------------------------


- ------- slist for dynmic variables finishes with segfault
- ---------------------
GetVariable(global,files_unixnews): using scope 'global' for variable
'files_unixnews'
return final variable type=slist, value={
hostname_test.cf main.cf}
ExpandPrivateRval(scope=sys,type=n)
Cannot append X to rval-list [(null)]
Segmentation fault



Thanks in advance for reviewing.
Kind regards
marco








-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iEYEARECAAYFAkp/8IgACgkQ27XhMxhUCo2tuwCdHuvHHzy4xShHiVmDl2M2pmGL
fAkAn1FVFw73Ukc9MvELP7kp8tyZMgR2
=8QoZ
-----END PGP SIGNATURE-----
_______________________________________________
Bug-cfengine mailing list
Bug-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/bug-cfengine

Reply via email to