Hi

I had the same (or a similar phenomena) on my box for quite some time, and got 
every 3 hours a crash.

I recompiled cfengine2 to get a more useful stack trace and then after running 
twice cfagent -K under gdb I got the following stack trace.

gdb) run -K
Starting program: /usr/sbin/cfagent -K
[Thread debugging using libthread_db enabled]
[New Thread 805417120 (LWP 19894)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 805417120 (LWP 19894)]
0x0fb7c61c in strlen () from /lib/tls/libc.so.6
(gdb) thread apply all bt full

Thread 1 (Thread 805417120 (LWP 19894)):
#0  0x0fb7c61c in strlen () from /lib/tls/libc.so.6
No symbol table info available.
#1  0x0fbc1e8c in regexec () from /lib/tls/libc.so.6
No symbol table info available.
#2  0x10023efc in LocateItemMatchingRegExp (list=<value optimized out>, 
string=0x7fae1428 "") at item-ext.c:416
        ip = (struct Item *) 0x10165cf0
        rx = {buffer = 0x10165cf0 "\020\026]\210", allocated = 144, used = 
144, syntax = 242428, fastmap = 0x1015dda0 "",
  translate = 0x0, re_nsub = 0, can_be_null = 0, regs_allocated = 0, 
fastmap_accurate = 1, no_sub = 0, not_bol = 0, not_eol = 0,
  newline_anchor = 0}
        rxcache = {buffer = 0x10165cf0 "\020\026]\210", allocated = 144, used 
= 144, syntax = 242428, fastmap = 0x1015dda0 "",
  translate = 0x0, re_nsub = 0, can_be_null = 0, regs_allocated = 0, 
fastmap_accurate = 1, no_sub = 0, not_bol = 0, not_eol = 0,
  newline_anchor = 0}
        pmatch = {rm_so = 0, rm_eo = 0}
        line = 2
#3  0x10038a48 in DoEditFile (ptr=0x10176490, 
filename=0x101764e0 "/etc/pbbuttonsd.conf") at edittools.c:766
        ep = <value optimized out>
        loopstart = (struct Edlist *) 0x0
        filestart = (struct Item *) 0x1014c7a0
        currenteditscript = '\0' <repeats 4095 times>
        searchstr = '\0' <repeats 1960 times>, "\177®0à", '\0' <repeats 12 
times>, "\177®0à\020\v\000\000\020\a
´ð\000\000\000\002\177®5\000\020\006gÌCouldn't stat /etc/hotplug/blacklist - 
no file to edit\n", '\0' <repeats 973 
times>, 
"\177®zX\020\026÷°\020\020zÐ\177®5\230\020\026ø\000\177®5\220\020\002xø", '\0' 
<repeats 64 
times>, 
"(\000D\"\000\000\000\000\020\rÁè\020\r\000\000\020\v\000\000\020\r\000\000\020\v\000\000\177®5\230\020\v\000\000\000\000\000\003\177®5\220\020\v\000\000\020"...
        expdata = "TPMode .*", '\0' <repeats 8182 times>
        sp = 0x100b5c88 "editfile"
        currentitem = "\000\000\000\000\177®%\\\177®%P\020\005#\230any", '\0' 
<repeats 21 times>, "eth1394", '\0' <repeats 976 times>
        tmpstat = {st_dev = 1155454779666399232, st_ino = 1159386633248110512, 
st_mode = 110, st_nlink = 110, st_uid = 2142115136,
  st_gid = 269940784, st_rdev = 9200349981624725228, __pad2 = 0, st_size = 
9200314315947638784, st_blksize = 0,
  st_blocks = 9200314315947638784, st_atim = {tv_sec = 269156352, tv_nsec = 
2142119256}, st_mtim = {tv_sec = 0, tv_nsec = 269156352},
  st_ctim = {tv_sec = 0, tv_nsec = 2142115112}, __unused4 = 2142115104, 
__unused5 = 3}
        spliton = 58 ':'
        todo = <value optimized out>
        potentially_outstanding = 0
        loop_fp = (FILE *) 0x0
        global_replace = -1
#4  0x1003a3fc in WrapDoEditFile (ptr=0x10176490, 
filename=0x101764e0 "/etc/pbbuttonsd.conf") at edittools.c:330
        statbuf = {st_dev = 777, st_ino = 2123453, st_mode = 33188, st_nlink = 
1, st_uid = 0, st_gid = 0, st_rdev = 0, __pad2 = 0,
  st_size = 3587, st_blksize = 4096, st_blocks = 8, st_atim = {tv_sec = 
1161710034, tv_nsec = 0}, st_mtim = {tv_sec = 1161710034,
    tv_nsec = 0}, st_ctim = {tv_sec = 1161710034, tv_nsec = 0}, __unused4 = 0, 
__unused5 = 0}
---Type <return> to continue, or q <return> to quit---
        statbuf2 = {st_dev = 0, st_ino = 0, st_mode = 0, st_nlink = 0, st_uid 
= 0, st_gid = 0, st_rdev = 0, __pad2 = 0, st_size = 0,
  st_blksize = 0, st_blocks = 0, st_atim = {tv_sec = 0, tv_nsec = 0}, st_mtim 
= {tv_sec = 0, tv_nsec = 0}, st_ctim = {tv_sec = 0,
    tv_nsec = 0}, __unused4 = 2142132848, __unused5 = 0}
        linkname 
= 
"\000\000\000\000\000\000\000\000\177®Zp\000\000\000\000\020\v\000\000\177®j¨\000\000\000\000\020\v\000\000\000\000\000\000\177®Zx\177®Zp\000\000\000\003\000\000\000\000\177®j¬\177®j \020\005#\230any",
 '\0' 
<repeats 29 times>, "editfiles", '\0' <repeats 3990 times>
        realname = '\0' <repeats 71 
times>, 
"\003\020\026ÄH\000\000\000\000\000\000\000\000\020\v\000\000\020\aqø\000\000\000\003\000®j¨\020\026ÄH\177®zÐ\020\005'(any",
 '\0' 
<repeats 3933 
times>, 
"(\000D\"\000\000\000\000\020\rÁè\020\r\000\000\020\v\000\000\020\r\000\000\000\000\000\000\000\000\000\000\020\v\000\000\000\000\000\003\020\ar4\020\v\000"
#5  0x1000c9d4 in EditFiles () at do.c:2269
        ptr = (struct Edit *) 0x10
        statbuf = {st_dev = 777, st_ino = 2123453, st_mode = 33188, st_nlink = 
1, st_uid = 0, st_gid = 0, st_rdev = 0, __pad2 = 0,
  st_size = 3587, st_blksize = 4096, st_blocks = 8, st_atim = {tv_sec = 
1161710034, tv_nsec = 0}, st_mtim = {tv_sec = 1161710034,
    tv_nsec = 0}, st_ctim = {tv_sec = 1161710034, tv_nsec = 0}, __unused4 = 0, 
__unused5 = 0}
#6  0x10005364 in DoTree (passes=1, info=0x10100000 "") at cfagent.c:1280
        action = (struct Item *) 0x1016c408
#7  0x10008030 in main (argc=2, argv=0x100771f8) at cfagent.c:180
        ip = <value optimized out>
(gdb)                
 
As I am not at all familiar with cfengine internals I did not try to find the 
reason for the Segmentation fault. But at least I seem to have a more or less 
reliable way to reproduce the failure and willing to try patches.

Best regards

-- 
Niklaus Giger

Reply via email to