syslog-ng 1.9.5 segfaults on many platforms
I've built both the daily snapshot from 2005-08-19 as well as the "stable" (I know it's not really stable) 1.9.5 on three platforms: RHEL4.1 x86_64 RHEL3.5 x86_64 Red Hat 7.3 2.4.29 i686 All three builds were with the default settings to ./configure. The build finishes without a hiccup but segfaults when syslog-ng tries to start. I've attached an strace (it's not very long...) to help show where it's segfaulting. The reason I need this to work is for the enhanced program() destination driver that will respawn programs that die. If somebody has a patch that backports this functionality to 1.6, that would be preferred, but a working 1.9.5 I could live with as well. Any ideas? -- Paul Krizak 5900 E. Ben White Blvd. MS 625 Advanced Micro Devices Austin, Tx 78741 CAD Systems Engineering Phone: (512) 602-8775 Paul.Krizak@amd.com Cell: (512) 791-0686
oops...forgot to attach the strace Paul Krizak 5900 E. Ben White Blvd. MS 625 Advanced Micro Devices Austin, Tx 78741 CAD Systems Engineering Paul.Krizak@amd.com Paul Krizak wrote:
I've built both the daily snapshot from 2005-08-19 as well as the "stable" (I know it's not really stable) 1.9.5 on three platforms:
RHEL4.1 x86_64 RHEL3.5 x86_64 Red Hat 7.3 2.4.29 i686
All three builds were with the default settings to ./configure. The build finishes without a hiccup but segfaults when syslog-ng tries to start. I've attached an strace (it's not very long...) to help show where it's segfaulting.
The reason I need this to work is for the enhanced program() destination driver that will respawn programs that die.
If somebody has a patch that backports this functionality to 1.6, that would be preferred, but a working 1.9.5 I could live with as well.
Any ideas?
[skaven@i-bragi1 ~/work/vtec/etc]$ strace syslog-ng -s -f syslog-ng.conf execve("/usr/local/sbin/syslog-ng", ["syslog-ng", "-s", "-f", "syslog-ng.conf"], [/* 57 vars */]) = 0 uname({sys="Linux", node="i-bragi1", ...}) = 0 brk(0) = 0x546000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95556000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/tool/pandora64/.package/gcc-3.4.0/lib64/tls/x86_64/libnsl.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/tool/pandora64/.package/gcc-3.4.0/lib64/tls/x86_64", 0x7fbfffe870) = -1 ENOENT (No such file or directory) open("/tool/pandora64/.package/gcc-3.4.0/lib64/tls/libnsl.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/tool/pandora64/.package/gcc-3.4.0/lib64/tls", 0x7fbfffe870) = -1 ENOENT (No such file or directory) open("/tool/pandora64/.package/gcc-3.4.0/lib64/x86_64/libnsl.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/tool/pandora64/.package/gcc-3.4.0/lib64/x86_64", 0x7fbfffe870) = -1 ENOENT (No such file or directory) open("/tool/pandora64/.package/gcc-3.4.0/lib64/libnsl.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/tool/pandora64/.package/gcc-3.4.0/lib64", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 open("/etc/ld.so.cache", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=176999, ...}) = 0 mmap(NULL, 176999, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2a95557000 close(3) = 0 open("/lib64/libnsl.so.1", O_RDONLY) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`G\300\r"..., 640) = 640 fstat(3, {st_mode=S_IFREG|0755, st_size=107367, ...}) = 0 mmap(0x3e0dc00000, 1141480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3e0dc00000 mprotect(0x3e0dc13000, 1063656, PROT_NONE) = 0 mmap(0x3e0dd13000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13000) = 0x3e0dd13000 mmap(0x3e0dd15000, 6888, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3e0dd15000 close(3) = 0 open("/tool/pandora64/.package/gcc-3.4.0/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) open("/lib64/tls/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\305\261"..., 640) = 640 lseek(3, 624, SEEK_SET) = 624 read(3, "\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\4\0\0\0"..., 32) = 32 fstat(3, {st_mode=S_IFREG|0755, st_size=1490956, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95583000 mmap(0x3e07b00000, 2305992, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3e07b00000 mprotect(0x3e07c29000, 1089480, PROT_NONE) = 0 mmap(0x3e07d29000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x129000) = 0x3e07d29000 mmap(0x3e07d2f000, 16328, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3e07d2f000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95584000 mprotect(0x3e07d29000, 12288, PROT_READ) = 0 arch_prctl(0x1002, 0x2a955842c0) = 0 munmap(0x2a95557000, 176999) = 0 brk(0) = 0x546000 brk(0x567000) = 0x567000 open("/etc/localtime", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=1279, ...}) = 0 fstat(3, {st_mode=S_IFREG|0644, st_size=1279, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95557000 read(3, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\0\5\0"..., 4096) = 1279 close(3) = 0 munmap(0x2a95557000, 4096) = 0 rt_sigaction(SIGPIPE, {SIG_IGN}, NULL, 8) = 0 rt_sigaction(SIGHUP, {0x4034d0, [], 0x4000000}, NULL, 8) = 0 rt_sigaction(SIGTERM, {0x4034e0, [], 0x4000000}, NULL, 8) = 0 rt_sigaction(SIGINT, {0x4034e0, [], 0x4000000}, NULL, 8) = 0 rt_sigaction(SIGCHLD, {0x403510, [], 0x4000000}, NULL, 8) = 0 rt_sigaction(SIGSEGV, {0x4034f0, [], SA_ONESHOT|0x4000000}, NULL, 8) = 0 open("/etc/eventlog.conf", O_RDONLY) = -1 ENOENT (No such file or directory) open("syslog-ng.conf", O_RDONLY) = 3 ioctl(3, SNDCTL_TMR_TIMEBASE, 0x7fbfffef10) = -1 ENOTTY (Inappropriate ioctl for device) fstat(3, {st_mode=S_IFREG|0644, st_size=2867, ...}) = 0 mmap(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95557000 read(3, "# OPTIONS\n# See http://www.balab"..., 32768) = 2867 read(3, "", 32768) = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 4 fcntl(4, F_GETFL) = 0x2 (flags O_RDWR|O_LARGEFILE) fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(4, {sa_family=AF_UNIX, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(4) = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 4 fcntl(4, F_GETFL) = 0x2 (flags O_RDWR|O_LARGEFILE) fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(4, {sa_family=AF_UNIX, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(4) = 0 open("/etc/nsswitch.conf", O_RDONLY) = 4 fstat(4, {st_mode=S_IFREG|0644, st_size=396, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a9555f000 read(4, "passwd: files nis\nshadow"..., 4096) = 396 read(4, "", 4096) = 0 close(4) = 0 munmap(0x2a9555f000, 4096) = 0 open("/tool/pandora64/.package/gcc-3.4.0/lib64/libnss_files.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 4 fstat(4, {st_mode=S_IFREG|0644, st_size=176999, ...}) = 0 mmap(NULL, 176999, PROT_READ, MAP_PRIVATE, 4, 0) = 0x2a95585000 close(4) = 0 open("/lib64/libnss_files.so.2", O_RDONLY) = 4 read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\"\0\0\0"..., 640) = 640 fstat(4, {st_mode=S_IFREG|0755, st_size=56807, ...}) = 0 mmap(NULL, 1094952, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x2a955b1000 mprotect(0x2a955bb000, 1053992, PROT_NONE) = 0 mmap(0x2a956bb000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0xa000) = 0x2a956bb000 close(4) = 0 munmap(0x2a95585000, 176999) = 0 open("/etc/passwd", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=2477, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2477 close(4) = 0 munmap(0x2a95585000, 4096) = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 4 fcntl(4, F_GETFL) = 0x2 (flags O_RDWR|O_LARGEFILE) fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(4, {sa_family=AF_UNIX, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(4) = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 4 fcntl(4, F_GETFL) = 0x2 (flags O_RDWR|O_LARGEFILE) fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(4, {sa_family=AF_UNIX, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(4) = 0 open("/etc/group", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=801, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 801 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/passwd", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=2477, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2477 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/group", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=801, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 801 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/passwd", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=2477, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2477 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/group", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=801, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 801 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/passwd", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=2477, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2477 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/group", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=801, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 801 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/passwd", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=2477, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2477 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/group", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=801, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 801 close(4) = 0 munmap(0x2a95585000, 4096) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- getpid() = 2926 kill(2926, SIGSEGV) = 0 rt_sigreturn(0xb6e) = 155 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++
Hello, Maybe you can also bt the core file in after setting ulimit -c unlimited and getting a core file. If possible, also ltrace it.
[skaven@i-bragi1 ~/work/vtec/etc]$ strace syslog-ng -s -f syslog-ng.conf execve("/usr/local/sbin/syslog-ng", ["syslog-ng", "-s", "-f", "syslog-ng.conf"], [/* 57 vars */]) = 0 uname({sys="Linux", node="i-bragi1", ...}) = 0 brk(0) = 0x546000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95556000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/tool/pandora64/.package/gcc-3.4.0/lib64/tls/x86_64/libnsl.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/tool/pandora64/.package/gcc-3.4.0/lib64/tls/x86_64", 0x7fbfffe870) = -1 ENOENT (No such file or directory) open("/tool/pandora64/.package/gcc-3.4.0/lib64/tls/libnsl.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/tool/pandora64/.package/gcc-3.4.0/lib64/tls", 0x7fbfffe870) = -1 ENOENT (No such file or directory) open("/tool/pandora64/.package/gcc-3.4.0/lib64/x86_64/libnsl.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/tool/pandora64/.package/gcc-3.4.0/lib64/x86_64", 0x7fbfffe870) = -1 ENOENT (No such file or directory) open("/tool/pandora64/.package/gcc-3.4.0/lib64/libnsl.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/tool/pandora64/.package/gcc-3.4.0/lib64", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
Did you build your own toolchain? Where does this gcc come from? However you don't seem to be using it.
open("/etc/ld.so.cache", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=176999, ...}) = 0 mmap(NULL, 176999, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2a95557000 close(3) = 0 open("/lib64/libnsl.so.1", O_RDONLY) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`G\300\r"..., 640) = 640 fstat(3, {st_mode=S_IFREG|0755, st_size=107367, ...}) = 0 mmap(0x3e0dc00000, 1141480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3e0dc00000 mprotect(0x3e0dc13000, 1063656, PROT_NONE) = 0 mmap(0x3e0dd13000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13000) = 0x3e0dd13000 mmap(0x3e0dd15000, 6888, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3e0dd15000 close(3) = 0 open("/tool/pandora64/.package/gcc-3.4.0/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) open("/lib64/tls/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\305\261"..., 640) = 640 lseek(3, 624, SEEK_SET) = 624 read(3, "\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\4\0\0\0"..., 32) = 32 fstat(3, {st_mode=S_IFREG|0755, st_size=1490956, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95583000 mmap(0x3e07b00000, 2305992, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3e07b00000 mprotect(0x3e07c29000, 1089480, PROT_NONE) = 0 mmap(0x3e07d29000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x129000) = 0x3e07d29000 mmap(0x3e07d2f000, 16328, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3e07d2f000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95584000 mprotect(0x3e07d29000, 12288, PROT_READ) = 0 arch_prctl(0x1002, 0x2a955842c0) = 0 munmap(0x2a95557000, 176999) = 0 brk(0) = 0x546000 brk(0x567000) = 0x567000 open("/etc/localtime", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=1279, ...}) = 0 fstat(3, {st_mode=S_IFREG|0644, st_size=1279, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95557000 read(3, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\0\5\0"..., 4096) = 1279 close(3) = 0 munmap(0x2a95557000, 4096) = 0 rt_sigaction(SIGPIPE, {SIG_IGN}, NULL, 8) = 0 rt_sigaction(SIGHUP, {0x4034d0, [], 0x4000000}, NULL, 8) = 0 rt_sigaction(SIGTERM, {0x4034e0, [], 0x4000000}, NULL, 8) = 0 rt_sigaction(SIGINT, {0x4034e0, [], 0x4000000}, NULL, 8) = 0 rt_sigaction(SIGCHLD, {0x403510, [], 0x4000000}, NULL, 8) = 0 rt_sigaction(SIGSEGV, {0x4034f0, [], SA_ONESHOT|0x4000000}, NULL, 8) = 0 open("/etc/eventlog.conf", O_RDONLY) = -1 ENOENT (No such file or directory) open("syslog-ng.conf", O_RDONLY) = 3 ioctl(3, SNDCTL_TMR_TIMEBASE, 0x7fbfffef10) = -1 ENOTTY (Inappropriate ioctl for device)
Something with your glibc seems to be fishy or I'm misinterpreting this line. I don't see how an ioctl call on SNDCTL_TMR_TIMEBASE can be of any use to syslog-ng.
fstat(3, {st_mode=S_IFREG|0644, st_size=2867, ...}) = 0 mmap(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95557000 read(3, "# OPTIONS\n# See http://www.balab"..., 32768) = 2867 read(3, "", 32768) = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 4 fcntl(4, F_GETFL) = 0x2 (flags O_RDWR|O_LARGEFILE) fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(4, {sa_family=AF_UNIX, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(4) = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 4 fcntl(4, F_GETFL) = 0x2 (flags O_RDWR|O_LARGEFILE) fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(4, {sa_family=AF_UNIX, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(4) = 0 open("/etc/nsswitch.conf", O_RDONLY) = 4 fstat(4, {st_mode=S_IFREG|0644, st_size=396, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a9555f000 read(4, "passwd: files nis\nshadow"..., 4096) = 396 read(4, "", 4096) = 0 close(4) = 0 munmap(0x2a9555f000, 4096) = 0 open("/tool/pandora64/.package/gcc-3.4.0/lib64/libnss_files.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 4 fstat(4, {st_mode=S_IFREG|0644, st_size=176999, ...}) = 0 mmap(NULL, 176999, PROT_READ, MAP_PRIVATE, 4, 0) = 0x2a95585000 close(4) = 0 open("/lib64/libnss_files.so.2", O_RDONLY) = 4
The resolver part. I wonder if it's crashing here?
read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\"\0\0\0"..., 640) = 640 fstat(4, {st_mode=S_IFREG|0755, st_size=56807, ...}) = 0 mmap(NULL, 1094952, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x2a955b1000 mprotect(0x2a955bb000, 1053992, PROT_NONE) = 0 mmap(0x2a956bb000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0xa000) = 0x2a956bb000 close(4) = 0 munmap(0x2a95585000, 176999) = 0 open("/etc/passwd", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=2477, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2477 close(4) = 0 munmap(0x2a95585000, 4096) = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 4 fcntl(4, F_GETFL) = 0x2 (flags O_RDWR|O_LARGEFILE) fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(4, {sa_family=AF_UNIX, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(4) = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 4 fcntl(4, F_GETFL) = 0x2 (flags O_RDWR|O_LARGEFILE) fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(4, {sa_family=AF_UNIX, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(4) = 0 open("/etc/group", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=801, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 801 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/passwd", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=2477, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2477 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/group", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=801, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 801 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/passwd", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=2477, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2477 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/group", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=801, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 801 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/passwd", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=2477, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2477 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/group", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=801, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 801 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/passwd", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=2477, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2477 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/group", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=801, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 801 close(4) = 0 munmap(0x2a95585000, 4096) = 0
strange ... munmap call is correct.
--- SIGSEGV (Segmentation fault) @ 0 (0) --- getpid() = 2926 kill(2926, SIGSEGV) = 0 rt_sigreturn(0xb6e) = 155 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++
I have to note however, that I've also heard from my developers in-house that the new syslog-ng crashes when statically linked. But I need to investigate our issue myself next week. There's not much I can do at that stage. Try to get the backtrace and the ltrace output and we might get some more information. Also if you could attach the minimal syslog-ng.conf you used for the test. Regards, Roberto Nibali, ratz -- echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc
I figured it out! The problem was not with the build, as I originally suspected, but with one of the statements in my config file. If I included this statement, syslog-ng would segfault: destination prog_test { program ( "/usr/bin/tail -f" template("$MSGONLY\n") template-escape(no) ); }; It would also segfault when template-escape was set to "yes". but the following statement would *not* cause syslog-ng to segfault: destination prog_test { program ( "/usr/bin/tail -f" template("$MSGONLY\n") ); }; So it looks like something within the "program" driver (which has been reworked since 1.6 series), in particular the template-escape mechanism, is causing a segfault. With that, I'm going to go ahead and start using 1.9.5, given that it seems to work just fine, as long as you don't mess with the template escaping mechanism in program destinations. Paul Krizak 5900 E. Ben White Blvd. MS 625 Advanced Micro Devices Austin, Tx 78741 CAD Systems Engineering Phone: (512) 602-8775 Paul.Krizak@amd.com Roberto Nibali wrote:
Hello,
Maybe you can also bt the core file in after setting ulimit -c unlimited and getting a core file. If possible, also ltrace it.
[skaven@i-bragi1 ~/work/vtec/etc]$ strace syslog-ng -s -f syslog-ng.conf execve("/usr/local/sbin/syslog-ng", ["syslog-ng", "-s", "-f", "syslog-ng.conf"], [/* 57 vars */]) = 0 uname({sys="Linux", node="i-bragi1", ...}) = 0 brk(0) = 0x546000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95556000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/tool/pandora64/.package/gcc-3.4.0/lib64/tls/x86_64/libnsl.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/tool/pandora64/.package/gcc-3.4.0/lib64/tls/x86_64", 0x7fbfffe870) = -1 ENOENT (No such file or directory) open("/tool/pandora64/.package/gcc-3.4.0/lib64/tls/libnsl.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/tool/pandora64/.package/gcc-3.4.0/lib64/tls", 0x7fbfffe870) = -1 ENOENT (No such file or directory) open("/tool/pandora64/.package/gcc-3.4.0/lib64/x86_64/libnsl.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/tool/pandora64/.package/gcc-3.4.0/lib64/x86_64", 0x7fbfffe870) = -1 ENOENT (No such file or directory) open("/tool/pandora64/.package/gcc-3.4.0/lib64/libnsl.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/tool/pandora64/.package/gcc-3.4.0/lib64", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
Did you build your own toolchain? Where does this gcc come from? However you don't seem to be using it.
open("/etc/ld.so.cache", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=176999, ...}) = 0 mmap(NULL, 176999, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2a95557000 close(3) = 0 open("/lib64/libnsl.so.1", O_RDONLY) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`G\300\r"..., 640) = 640 fstat(3, {st_mode=S_IFREG|0755, st_size=107367, ...}) = 0 mmap(0x3e0dc00000, 1141480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3e0dc00000 mprotect(0x3e0dc13000, 1063656, PROT_NONE) = 0 mmap(0x3e0dd13000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13000) = 0x3e0dd13000 mmap(0x3e0dd15000, 6888, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3e0dd15000 close(3) = 0 open("/tool/pandora64/.package/gcc-3.4.0/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) open("/lib64/tls/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\305\261"..., 640) = 640 lseek(3, 624, SEEK_SET) = 624 read(3, "\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\4\0\0\0"..., 32) = 32 fstat(3, {st_mode=S_IFREG|0755, st_size=1490956, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95583000 mmap(0x3e07b00000, 2305992, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3e07b00000 mprotect(0x3e07c29000, 1089480, PROT_NONE) = 0 mmap(0x3e07d29000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x129000) = 0x3e07d29000 mmap(0x3e07d2f000, 16328, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3e07d2f000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95584000 mprotect(0x3e07d29000, 12288, PROT_READ) = 0 arch_prctl(0x1002, 0x2a955842c0) = 0 munmap(0x2a95557000, 176999) = 0 brk(0) = 0x546000 brk(0x567000) = 0x567000 open("/etc/localtime", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=1279, ...}) = 0 fstat(3, {st_mode=S_IFREG|0644, st_size=1279, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95557000 read(3, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\0\5\0"..., 4096) = 1279 close(3) = 0 munmap(0x2a95557000, 4096) = 0 rt_sigaction(SIGPIPE, {SIG_IGN}, NULL, 8) = 0 rt_sigaction(SIGHUP, {0x4034d0, [], 0x4000000}, NULL, 8) = 0 rt_sigaction(SIGTERM, {0x4034e0, [], 0x4000000}, NULL, 8) = 0 rt_sigaction(SIGINT, {0x4034e0, [], 0x4000000}, NULL, 8) = 0 rt_sigaction(SIGCHLD, {0x403510, [], 0x4000000}, NULL, 8) = 0 rt_sigaction(SIGSEGV, {0x4034f0, [], SA_ONESHOT|0x4000000}, NULL, 8) = 0 open("/etc/eventlog.conf", O_RDONLY) = -1 ENOENT (No such file or directory) open("syslog-ng.conf", O_RDONLY) = 3 ioctl(3, SNDCTL_TMR_TIMEBASE, 0x7fbfffef10) = -1 ENOTTY (Inappropriate ioctl for device)
Something with your glibc seems to be fishy or I'm misinterpreting this line. I don't see how an ioctl call on SNDCTL_TMR_TIMEBASE can be of any use to syslog-ng.
fstat(3, {st_mode=S_IFREG|0644, st_size=2867, ...}) = 0 mmap(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95557000 read(3, "# OPTIONS\n# See http://www.balab"..., 32768) = 2867 read(3, "", 32768) = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 4 fcntl(4, F_GETFL) = 0x2 (flags O_RDWR|O_LARGEFILE) fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(4, {sa_family=AF_UNIX, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(4) = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 4 fcntl(4, F_GETFL) = 0x2 (flags O_RDWR|O_LARGEFILE) fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(4, {sa_family=AF_UNIX, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(4) = 0 open("/etc/nsswitch.conf", O_RDONLY) = 4 fstat(4, {st_mode=S_IFREG|0644, st_size=396, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a9555f000 read(4, "passwd: files nis\nshadow"..., 4096) = 396 read(4, "", 4096) = 0 close(4) = 0 munmap(0x2a9555f000, 4096) = 0 open("/tool/pandora64/.package/gcc-3.4.0/lib64/libnss_files.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 4 fstat(4, {st_mode=S_IFREG|0644, st_size=176999, ...}) = 0 mmap(NULL, 176999, PROT_READ, MAP_PRIVATE, 4, 0) = 0x2a95585000 close(4) = 0 open("/lib64/libnss_files.so.2", O_RDONLY) = 4
The resolver part. I wonder if it's crashing here?
read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\"\0\0\0"..., 640) = 640 fstat(4, {st_mode=S_IFREG|0755, st_size=56807, ...}) = 0 mmap(NULL, 1094952, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x2a955b1000 mprotect(0x2a955bb000, 1053992, PROT_NONE) = 0 mmap(0x2a956bb000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0xa000) = 0x2a956bb000 close(4) = 0 munmap(0x2a95585000, 176999) = 0 open("/etc/passwd", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=2477, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2477 close(4) = 0 munmap(0x2a95585000, 4096) = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 4 fcntl(4, F_GETFL) = 0x2 (flags O_RDWR|O_LARGEFILE) fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(4, {sa_family=AF_UNIX, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(4) = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 4 fcntl(4, F_GETFL) = 0x2 (flags O_RDWR|O_LARGEFILE) fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(4, {sa_family=AF_UNIX, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(4) = 0 open("/etc/group", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=801, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 801 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/passwd", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=2477, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2477 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/group", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=801, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 801 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/passwd", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=2477, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2477 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/group", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=801, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 801 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/passwd", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=2477, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2477 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/group", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=801, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 801 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/passwd", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=2477, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2477 close(4) = 0 munmap(0x2a95585000, 4096) = 0 open("/etc/group", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=801, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95585000 read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 801 close(4) = 0 munmap(0x2a95585000, 4096) = 0
strange ... munmap call is correct.
--- SIGSEGV (Segmentation fault) @ 0 (0) --- getpid() = 2926 kill(2926, SIGSEGV) = 0 rt_sigreturn(0xb6e) = 155 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++
I have to note however, that I've also heard from my developers in-house that the new syslog-ng crashes when statically linked. But I need to investigate our issue myself next week.
There's not much I can do at that stage. Try to get the backtrace and the ltrace output and we might get some more information. Also if you could attach the minimal syslog-ng.conf you used for the test.
Regards, Roberto Nibali, ratz
Thanks for tracking this down. Here's the patch, it should be added in tomorrow's snapshot: --- orig/src/affile.c +++ mod/src/affile.c @@ -367,35 +367,6 @@ affile_dd_set_create_dirs(LogDriver *s, self->flags &= ~AFFILE_CREATE_DIRS; } -void -affile_dd_set_file_template(LogDriver *s, gchar *template) -{ - AFFileDestDriver *self = (AFFileDestDriver *) s; - - g_string_assign(self->template, template); -} - -void -affile_dd_set_template_escape(LogDriver *s, gboolean enable) -{ - AFFileDestDriver *self = (AFFileDestDriver *) s; - - if (self->writer_options.template && self->writer_options.template->def_inline) - { - log_template_set_escape(self->writer_options.template, enable); - } - else - { - msg_notice("Macro escaping can only be specified for inline templates", NULL); - } -} - -void -affile_dd_set_fsync(LogDriver *s G_GNUC_UNUSED, gboolean enable G_GNUC_UNUSED) -{ - msg_error("fsync() does not work yet", NULL); -} - static time_t reap_now = 0; static gboolean @@ -559,7 +530,6 @@ affile_dd_free(LogPipe *s) AFFileDestDriver *self = (AFFileDestDriver *) s; log_template_unref(self->filename_template); - g_string_free(self->template, TRUE); log_pipe_unref(self->writer); if (self->writer_hash) g_hash_table_destroy(self->writer_hash); @@ -579,7 +549,6 @@ affile_dd_new(gchar *filename, guint32 f self->super.super.queue = affile_dd_queue; self->super.super.free_fn = affile_dd_free; self->filename_template = log_template_new(NULL, filename); - self->template = g_string_sized_new(0); self->flags = flags; self->file_uid = self->file_gid = -1; self->file_perm = -1; --- orig/src/affile.h +++ mod/src/affile.h @@ -50,7 +50,6 @@ typedef struct _AFFileDestDriver LogTemplate *filename_template; LogPipe *writer; guint32 flags; - GString *template; uid_t file_uid; gid_t file_gid; mode_t file_perm; @@ -77,8 +76,6 @@ void affile_dd_set_dir_uid(LogDriver *s, void affile_dd_set_dir_gid(LogDriver *s, const gchar *dir_gid); void affile_dd_set_dir_perm(LogDriver *s, mode_t dir_perm); void affile_dd_set_create_dirs(LogDriver *s, gboolean create_dirs); -void affile_dd_set_file_template(LogDriver *s, gchar *template); -void affile_dd_set_template_escape(LogDriver *s, gboolean enable); void affile_dd_set_fsync(LogDriver *s, gboolean enable); #endif --- orig/src/cfg-grammar.y +++ mod/src/cfg-grammar.y @@ -624,8 +624,8 @@ dest_writer_option log_template_ref(last_writer_options->template); free($3); } - | KW_TEMPLATE_ESCAPE '(' yesno ')' { affile_dd_set_template_escape(last_driver, $3); } - | KW_FSYNC '(' yesno ')' { affile_dd_set_fsync(last_driver, $3); } + | KW_TEMPLATE_ESCAPE '(' yesno ')' { log_writer_options_set_template_escape(last_writer_options, $3); } + | KW_FSYNC '(' yesno ')' { msg_error("fsync() does not work yet", NULL); } | KW_KEEP_TIMESTAMP '(' yesno ')' { last_writer_options->keep_timestamp = $3; } | KW_TIME_ZONE '(' string ')' { cfg_timezone_value($3, &last_writer_options->zone_offset); free($3); } | KW_TS_FORMAT '(' string ')' { last_writer_options->ts_format = cfg_ts_format_value($3); free($3); } --- orig/src/logwriter.c +++ mod/src/logwriter.c @@ -412,6 +412,19 @@ log_writer_options_defaults(LogWriterOpt options->zone_offset = -1; } +void +log_writer_options_set_template_escape(LogWriterOptions *options, gboolean enable) +{ + if (options->template && options->template->def_inline) + { + log_template_set_escape(options->template, enable); + } + else + { + msg_notice("Macro escaping can only be specified for inline templates", NULL); + } +} + void log_writer_options_init(LogWriterOptions *options, GlobalConfig *cfg, gboolean fixed_stamp) { -- Bazsi
participants (3)
-
Balazs Scheidler
-
Paul Krizak
-
Roberto Nibali