[syslog-ng] segfault in 3.4 alpha1

Balazs Scheidler bazsi at balabit.hu
Wed Mar 14 09:50:06 CET 2012


On Tue, 2012-03-13 at 21:31 +0100, Peter Czanik wrote:
> 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)


This is either a linking related problem, or I'm blind while staring at
the source code. Can you post your configuration file too?


> 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...

hmm.. there's no such switch as --enable-json, although I'd tend to
agree that this is confusing. The reason is that we support two json
implementations and that's usually specified using --with-json=<xxx>,
and once that is supplied --enable-json is not needed.

So to disable json support you'd need to use --without-json, but
suggestions how this should work is appreciated.

-- 
Bazsi




More information about the syslog-ng mailing list