[syslog-ng]crash version 1.5.20 under stress with tcp

Puschmann Johannes Johannes.Puschmann@patent.bmwa.gv.at
Thu, 26 Sep 2002 17:11:48 +0200


Hi List.
I am testing syslog-ng 1.5.20.
Its an RH 7.2 kernel 2.4.18
syslog-ng was compiled from source.
 When you flood the machine with messages over tcp, it crashes
Under udp port 514 its looks nice.
(20000 messages/min no Problem)


see Backtrace and configfile below.
Looks like the template makes problems.



best regards
Johannes

gc_mark: Marking object of class 'UNKNOWN' (1)
AF_INET client connected from 192.168.129.102, port 1609
io.c: Preparing fd 8 for reading
192.168.129.102... adding as 707 (1 iters).
io.c: Preparing fd 9 for writing
io.c: Preparing fd 10 for writing

Program received signal SIGSEGV, Segmentation fault.
0x080526a0 in expand_macros (cfg=0x6f6c7379, template=0x65742067,
    template_escape=1830843507, msg=0x61737365) at affile.c:866
866   while (left && (i < template->length)) {
(gdb) bt
#0  0x080526a0 in expand_macros (cfg=0x6f6c7379, template=0x65742067,
    template_escape=1830843507, msg=0x61737365) at affile.c:866
#1  0x53207369 in ?? ()
Cannot access memory at address 0x20736968

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

options { dir_perm(0755); perm(0644); chain_hostnames(no);
          keep_hostname(yes); };

source local {
        unix-stream("/dev/log");
        udp(ip(0.0.0.0) port(514));
        tcp(ip(0.0.0.0) port(514));
        internal();
};

# *.*                                                   @192.168.129.164

filter f_1 {
        level(debug...emerg);
};

#destination d_1 {
#       udp("192.168.129.164" port(514));
#};

#log { source(local); filter(f_1); destination(d_1); };

# *.info;mail.none;news.none;authpriv.none;cron.none;daemon.none
/var/log/messages

filter f_2 {
        not facility(authpriv);
};

filter f_3 {
        not facility(cron);
};

filter f_4 {
        not facility(daemon);
};

filter f_5 {
        level(info...emerg);
};

filter f_6 {
        not facility(mail);
};

filter f_7 {
        not facility(news);
};

destination d_2 {
        file("/var/log/messages" create_dirs(yes));
};

log { source(local); filter(f_2); filter(f_3); filter(f_4); filter(f_5);
filter(f_6); filter(f_7); destination(d_2); };

# authpriv.*                                            /var/log/secure

filter f_8 {
        facility(authpriv) and level(debug...emerg);
};

destination d_3 {
        file("/var/log/secure" create_dirs(yes));
};

log { source(local); filter(f_8); destination(d_3); };

# daemon.*                                              /var/log/daemon

filter f_9 {
        facility(daemon) and level(debug...emerg);
};

destination d_4 {
        file("/var/log/daemon" create_dirs(yes));
};

log { source(local); filter(f_9); destination(d_4); };

# mail.*
/var/log/maillog

filter f_10 {
        facility(mail) and level(debug...emerg);
};

destination d_5 {
        file("/var/log/maillog" create_dirs(yes));
};

log { source(local); filter(f_10); destination(d_5); };

# cron.*
/var/log/cron

filter f_11 {
        facility(cron) and level(debug...emerg);
};

destination d_6 {
        file("/var/log/cron" create_dirs(yes));
};

log { source(local); filter(f_11); destination(d_6); };

# *.emerg                                                       *

filter f_12 {
        level(emerg);
};

destination d_7 {
        usertty("*");
};

log { source(local); filter(f_12); destination(d_7); };

# uucp,news.crit
/var/log/spooler

filter f_13 {
        facility(uucp,news) and level(crit...emerg);
};

destination d_8 {
        file("/var/log/spooler" create_dirs(yes));
};

log { source(local); filter(f_13); destination(d_8); };

# local7.*                                              /var/log/boot.log

filter f_14 {
        facility(local7) and level(debug...emerg);
};

destination d_9 {
        file("/var/log/boot.log" create_dirs(yes));
};

log { source(local); filter(f_14); destination(d_9); };

# news.=crit                                        /var/log/news/news.crit

filter f_15 {
        facility(news) and level(crit...emerg);
};

destination d_10 {
        file("/var/log/news/news.crit" create_dirs(yes));
};

log { source(local); filter(f_15); destination(d_10); };

# news.=err                                         /var/log/news/news.err

filter f_16 {
        facility(news) and level(err...emerg);
};

destination d_11 {
        file("/var/log/news/news.err" create_dirs(yes));
};

log { source(local); filter(f_16); destination(d_11); };

# news.notice
/var/log/news/news.notice

filter f_17 {
        facility(news) and level(notice...emerg);
};

destination d_12 {
        file("/var/log/news/news.notice" create_dirs(yes));
};

log { source(local); filter(f_17); destination(d_12); };

## Log syslog-ng to mysql database
                                    ##
                                        destination d_mysql {
                                            pipe("/tmp/mysql.pipe"
                                            template("INSERT INTO logs
(host, facility, priority, level, tag, date,
                                            time, program, msg) VALUES (
'$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG',
                                            '$YEAR-$MONTH-$DAY',
'$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n") template-escape(yes));
                                             };
                                        log { source(local);
destination(d_mysql);
                                        };
[root@test src]#