[syslog-ng] segfault in 3.4 alpha1

Peter Czanik czanik at balabit.hu
Tue Mar 13 21:31:21 CET 2012


Hello,

I tried to compile and run alpha1 on openSUSE 12.1 and FreeBSD 8.1. I 
got a segfault on start on both. Here are the backtraces:

fb81# gdb74 -c syslog-ng.core /usr/local/sbin/syslog-ng
GNU gdb (GDB) 7.4 [GDB v7.4 for FreeBSD]
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd8.1".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/sbin/syslog-ng...(no debugging symbols 
found)...done.
[New process 100055]
[New Thread 8018041c0 (LWP 100055)]
Core was generated by `syslog-ng'.
Program terminated with signal 11, Segmentation fault.
#0  file_perm_options_set_file_perm (self=0x0, file_perm=384)
     at file-perms.c:60
60    file-perms.c: No such file or directory.
(gdb) backtrace
#0  file_perm_options_set_file_perm (self=0x0, file_perm=384)
     at file-perms.c:60
#1  0x0000000801c0cda0 in afsocket_parse (lexer=0x80196b000,
     instance=0x7fffffffc788, arg=0x0) at afsocket-grammar.y:1186
#2  0x000000080068b4f3 in cfg_parser_parse (arg=<optimized out>,
     instance=<optimized out>, lexer=0x80196b000, self=0x801d16fc0)
     at cfg-parser.h:83
#3  plugin_parse_config (self=0x801d174b0, cfg=<optimized out>,
     yylloc=<optimized out>, arg=0x0) at plugin.c:211
#4  0x0000000800698730 in main_parse (lexer=0x80196b000,
     dummy=0x7fffffffec48, arg=0x0) at cfg-grammar.y:518
#5  0x0000000800669ef9 in cfg_parser_parse (arg=<optimized out>,
     instance=<optimized out>, lexer=<optimized out>, self=<optimized out>)
     at cfg-parser.h:83
#6  cfg_run_parser (self=0x801949180, lexer=0x80196b000, 
parser=0x8007c4140,
     result=0x7fffffffec48, arg=0x801c0f760) at cfg.c:316
#7  0x000000080066a006 in cfg_read_config (self=0x801949180,
     fname=0x8006ab16b "/usr/local/etc/syslog-ng.conf",
     syntax_only=<optimized out>, preprocess_into=0x0) at cfg.c:347
#8  0x0000000800685baa in main_loop_init () at mainloop.c:674
#9  0x000000000040171f in main ()
(gdb)


And the same core file with gdb from the base system:

fb81# gdb -c syslog-ng.core /usr/local/sbin/syslog-ng
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...(no debugging 
symbols found)...
Core was generated by `syslog-ng'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so...done.
Loaded symbols for /usr/local/lib/libsyslog-ng-3.4.0alpha1.so
Reading symbols from /usr/local/lib/libnet115/libnet.so.7...done.
Loaded symbols for /usr/local/lib/libnet115/libnet.so.7
Reading symbols from /usr/lib/librt.so.1...done.
Loaded symbols for /usr/lib/librt.so.1
Reading symbols from /usr/local/lib/libgmodule-2.0.so.0...done.
Loaded symbols for /usr/local/lib/libgmodule-2.0.so.0
Reading symbols from /usr/local/lib/libgthread-2.0.so.0...done.
Loaded symbols for /usr/local/lib/libgthread-2.0.so.0
Reading symbols from /usr/local/lib/libglib-2.0.so.0...done.
Loaded symbols for /usr/local/lib/libglib-2.0.so.0
Reading symbols from /usr/local/lib/libintl.so.9...done.
Loaded symbols for /usr/local/lib/libintl.so.9
Reading symbols from /usr/local/lib/libiconv.so.3...done.
Loaded symbols for /usr/local/lib/libiconv.so.3
Reading symbols from /usr/local/lib/libevtlog.so.0...done.
Loaded symbols for /usr/local/lib/libevtlog.so.0
Reading symbols from /usr/local/lib/libpcre.so.1...done.
Loaded symbols for /usr/local/lib/libpcre.so.1
Reading symbols from /lib/libthr.so.3...done.
Loaded symbols for /lib/libthr.so.3
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /usr/local/lib/syslog-ng/libconfgen.so...done.
Loaded symbols for /usr/local/lib/syslog-ng/libconfgen.so
Reading symbols from /usr/lib/libz.so...done.
Loaded symbols for /usr/lib/libz.so
Reading symbols from /usr/local/lib/syslog-ng/libafsocket.so...done.
Loaded symbols for /usr/local/lib/syslog-ng/libafsocket.so
Reading symbols from /usr/local/lib/syslog-ng/libsyslog-ng-crypto.so...done.
Loaded symbols for /usr/local/lib/syslog-ng/libsyslog-ng-crypto.so
Reading symbols from /usr/local/lib/libcrypto.so.7...done.
Loaded symbols for /usr/local/lib/libcrypto.so.7
Reading symbols from /usr/local/lib/libssl.so.7...done.
Loaded symbols for /usr/local/lib/libssl.so.7
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  file_perm_options_set_file_perm (self=0x0, file_perm=384)
     at file-perms.c:60
60    file-perms.c: No such file or directory.
     in file-perms.c
[New Thread 8018041c0 (LWP 100055)]
(gdb) backtrace
#0  file_perm_options_set_file_perm (self=0x0, file_perm=384)
     at file-perms.c:60
#1  0x0000000801c0cda0 in afsocket_parse (lexer=0x80196b000,
     instance=0x7fffffffc788, arg=0x0) at afsocket-grammar.y:1186
#2  0x000000080068b4f3 in plugin_parse_config (self=0x801d174b0, 
cfg=Variable "cfg" is not available.
)
     at cfg-parser.h:83
#3  0x0000000800698730 in main_parse (lexer=0x80196b000,
     dummy=0x7fffffffec48, arg=0x0) at cfg-grammar.y:518
#4  0x0000000800669ef9 in cfg_run_parser (self=0x801949180,
     lexer=0x80196b000, parser=0x8007c4140, result=0x7fffffffec48, 
arg=Variable "arg" is not available.
)
     at cfg-parser.h:83
#5  0x000000080066a006 in cfg_read_config (self=0x801949180,
     fname=0x8006ab16b "/usr/local/etc/syslog-ng.conf", 
syntax_only=Variable "syntax_only" is not available.
)
     at cfg.c:347
#6  0x0000000800685baa in main_loop_init () at mainloop.c:674
#7  0x000000000040171f in main ()
(gdb)

This binary was compiled by copying sysutils/syslog-ng port to 
syslog-ng-devel, adding --enable-debug to configure args. I ran into one 
more interesting thing: with json-c enabled in "make config", configure 
failed with:

configure: error: Cannot find json-c version >= 0.9: is pkg-config in path?

When disabled json-c in "make config" it was found by configure and was 
built. The relevant part of "Makefile" is:

.if defined(WITH_JSON_GLIB)
LIB_DEPENDS+=           json-glib-1.0.0:${PORTSDIR}/devel/json-glib
CONFIGURE_ARGS+=        --enable-json --with-json=json-glib
PLIST_FILES+=           lib/syslog-ng/libtfjson.la 
lib/syslog-ng/libtfjson.so
.elif defined(WITH_JSON_C)
LIB_DEPENDS+=           json.0:${PORTSDIR}/devel/json-c
CONFIGURE_ARGS+=        --enable-json --with-json=json-c
PLIST_FILES+=           lib/syslog-ng/libtfjson.la 
lib/syslog-ng/libtfjson.so
.else
CONFIGURE_ARGS+=        --disable-json
.endif

So, in theory json support was disabled...

And another backtrace, this time from openSUSE:

(gdb) backtrace
#0 0xb7684e8d in cfg_tree_compile_node () from 
/lib/libsyslog-ng-3.4.0alpha1.so
#1 0xb7684f60 in cfg_tree_compile_node () from 
/lib/libsyslog-ng-3.4.0alpha1.so
#2 0xb7685557 in cfg_tree_compile_rule () from 
/lib/libsyslog-ng-3.4.0alpha1.so
#3 0xb7685954 in cfg_tree_compile () from /lib/libsyslog-ng-3.4.0alpha1.so
#4 0xb76859ee in cfg_tree_start () from /lib/libsyslog-ng-3.4.0alpha1.so
#5 0xb76808c0 in cfg_init () from /lib/libsyslog-ng-3.4.0alpha1.so
#6 0xb76a07ea in main_loop_init () from /lib/libsyslog-ng-3.4.0alpha1.so
#7 0x080491a7 in main ()
(gdb)

Bye,

-- 
Peter Czanik (CzP)<czanik at balabit.hu>
BalaBit IT Security / syslog-ng upstream
http://czanik.blogs.balabit.com/




More information about the syslog-ng mailing list