syslog-ng double free problem appears when the system runs two or more syslog-ng processes at the same time and the log space in which the syslog-ng log is located is full

Q & Asyslog-ng double free problem appears when the system runs two or more syslog-ng processes at the same time and the log space in which the syslog-ng log is located is full
Addison asked 1 month ago

Hello,everyone, these days I met a double free problem about syslog-ng. The problem appears when the system runs two or more syslog-ng processes at the same time and the log space in which the syslog-ng log is located is full. The problem also exists in the latest version. Following is the error information:
*** Error in `/usr/sbin/syslog-ng’: double free or corruption (!prev): 0x00120148 ***
process ‘/usr/sbin/syslog-ng -f /etc/syslog-ng/syslog-ng.conf -p /var/run/syslogd.pid -F’ (pid 8849) exited. Scheduling for r
starting pid 10694, tty ”: ‘/usr/sbin/syslog-ng -f /etc/syslog-ng/syslog-ng.conf -p /var/run/syslogd.pid -F’
 
And I introduce the steps:
【1】# /usr/sbin/syslog-ng -f /etc/syslog-ng/syslog-ng.conf
         # /usr/sbin/syslog-ng -f /etc/syslog-ng/syslog-ng.conf
【2】#sh syslog-ng_memleak.sh
Following is the syslog-ng_memleak.sh file:
#!/bin/sh
ulimit -c unlimited
test=”This_is_syslog-ng_memleak_test.”
i=0
while [ $i -lt 200 ]
do
    test=”${test}_This_is_syslog-ng_memleak_test.”
    i=`expr $i + 1`
done
 
test_logger()
{
    while [ 1 ]
    do
        logger “$1” 
    done
}
kill_syslogng()
{  
    while [ 1 ]
    do
        pid=`ps -ef | grep syslog-ng | grep -v grep | awk ‘{print $2}’`
        kill -HUP $pid
        #top -n 1 -p $pid > /tmp/topfile
        #mem=`cat /tmp/topfile | grep syslog-ng | awk ‘{print $11}’`
        #echo “syslog-ng mem: $mem”
        sleep 0.1
    done
}
test_logger $test &
kill_syslogng
【3】/var/log #dd if=/dev/zero of=./file.txt bs=100M count=2
【4】rm file.txt
【5】kill –HUP syslog-ng_pid