[syslog-ng] Logging with db-parser issue

Nate Hausrath hausrath at gmail.com
Thu May 14 21:14:32 CEST 2009


That did it!  It is working properly now. :)

Thanks for your help!

-Nate

On Thu, May 14, 2009 at 2:21 PM, ILLES, Marton <illes.marton at balabit.hu> wrote:
> Hi Nate,
>
> Thanks for the core and congratulation for your gdb skills :), though I
> could reproduce your problem meanwhile.
>
> In your configuration there is a problem that Bazsi has also spotted:
>
>>> log {
>>>         source(s_net);
>>>         destination(d_parsed);
>>>         parser(p_db);
>>> };
>>
>> the log statements define a 'pipeline', thus your messages will reach
>> the db-parser() only after having been written to the d_parsed
>> destination.
>
> It is not just a semantic error, but this is the cause of your segfault.
> As statements are evaluated one after an other the parser can not queue
> the message for the next statement (the pipeline ends unexpectedly as
> parser must always have a next pipe) and a null-pointer deref occurs and
> syslog-ng dies. It should be detected on configuration parsing time and
> should not die any latter.
>
> Changing your configuration would eliminate the segfault and would also
> make use of the parser. So you should have something like this:
>
> log {
>        source(s_net);
>        parser(p_db);
>        destination(d_parsed);
> };
>
> Hope it solves your problem.
>
> Marton
>
>
> On Wed, 2009-05-13 at 11:04 -0400, Nate Hausrath wrote:
>> > >
>> > > 2, You have a segfault. I would need a backtrace or a core file to track
>> > > down the problem. To get a core file you can use the --enable-core
>> > > option to syslog-ng and gdb after that to get a backtrace.
>> > >
>> > > Sorry again for the version problem, I will push an update to my git
>> > > tree with the new version 2 xml handling.
>> > >
>> > > best,
>> > >
>> > > Marton
>> > >
>>
>> Hi Marton,
>>
>> I finally have the backtrace.  If you need to core file as well, let me know.
>>
>> Core was generated by `/opt/syslog-ng-src/sbin/syslog-ng --no-caps
>> --enable-core'.
>> Program terminated with signal 11, Segmentation fault.
>> [New process 5429]
>> #0  0x08064117 in log_pipe_queue (s=0x0, msg=0x80a53c0,
>> path_options=0xbfd749e4) at logpipe.h:121
>> 121     s->queue(s, msg, path_options);
>> (gdb) bt full
>> #0  0x08064117 in log_pipe_queue (s=0x0, msg=0x80a53c0,
>> path_options=0xbfd749e4) at logpipe.h:121
>> No locals.
>> #1  0x080640c5 in log_process_pipe_queue (s=0x80a0a38, msg=0x80a53c0,
>> path_options=0xbfd749e4) at logprocess.c:73
>>       self = (LogProcessPipe *) 0x80a0a38
>> #2  0x08054874 in log_pipe_queue (s=0x80a0a38, msg=0x80a53c0,
>> path_options=0xbfd749e4) at logpipe.h:121
>> No locals.
>> #3  0x0805483c in log_pipe_forward_msg (self=0x80a09c0, msg=0x80a53c0,
>> path_options=0xbfd749e4) at logpipe.c:72
>> No locals.
>> #4  0x0806446c in log_multiplexer_queue (s=0x80a09c0, msg=0x80a53c0,
>> path_options=0xbfd749e4) at logmpx.c:115
>>       self = (LogMultiplexer *) 0x80a09c0
>>       i = 1
>>       local_options = {flow_control = 0, matched = 0xbfd7498c}
>>       matched = 1
>>       delivered = 1
>>       last_delivery = 0
>>       fallback = 1
>> #5  0x08064490 in log_pipe_queue (s=0x80a09c0, msg=0x80a53c0,
>> path_options=0xbfd749e4) at logpipe.h:121
>> No locals.
>> #6  0x080643f8 in log_multiplexer_queue (s=0x80a0990, msg=0x80a53c0,
>> path_options=0xbfd74b28) at logmpx.c:105
>>       next_hop = (LogPipe *) 0x80a09c0
>>       self = (LogMultiplexer *) 0x80a0990
>>       i = 0
>>       local_options = {flow_control = 0, matched = 0xbfd749fc}
>>       matched = 1
>>       delivered = 0
>>       last_delivery = 1
>>       fallback = 0
>> #7  0x0806b792 in log_pipe_queue (s=0x80a0990, msg=0x80a53c0,
>> path_options=0xbfd74b28) at logpipe.h:121
>> No locals.
>> #8  0x0806b75d in log_source_group_queue (s=0x80a0370, msg=0x80a53c0,
>> path_options=0xbfd74b28) at sgroup.c:97
>>       self = (LogSourceGroup *) 0x80a0370
>>       cfg = (GlobalConfig *) 0x809baa0
>> #9  0x08054874 in log_pipe_queue (s=0x80a0370, msg=0x80a53c0,
>> path_options=0xbfd74b28) at logpipe.h:121
>> No locals.
>> #10 0x0805483c in log_pipe_forward_msg (self=0x80a01f0, msg=0x80a53c0,
>> path_options=0xbfd74b28) at logpipe.c:72
>> No locals.
>> #11 0x08054874 in log_pipe_queue (s=0x80a01f0, msg=0x80a53c0,
>> path_options=0xbfd74b28) at logpipe.h:121
>> No locals.
>> #12 0x0805483c in log_pipe_forward_msg (self=0x80a3100, msg=0x80a53c0,
>> path_options=0xbfd74b28) at logpipe.c:72
>> No locals.
>> #13 0x0807a833 in log_pipe_queue (s=0x80a3100, msg=0x80a53c0,
>> path_options=0xbfd74b28) at logpipe.h:121
>> No locals.
>> #14 0x0807a7b5 in log_source_queue (s=0x80a51d0, msg=0x80a53c0,
>> path_options=0xbfd74b98) at logsource.c:167
>>       self = (LogSource *) 0x80a51d0
>>       local_options = {flow_control = -1, matched = 0x0}
>>       processed_counter = (guint32 *) 0x0
>>       stamp = (guint32 *) 0x0
>>       new = 13
>>       handle = (StatsCounter *) 0x0
>>       __PRETTY_FUNCTION__ = "log_source_queue"
>> #15 0x0806c577 in log_pipe_queue (s=0x80a51d0, msg=0x80a53c0,
>> path_options=0xbfd74b98) at logpipe.h:121
>> No locals.
>> #16 0x0806c544 in log_reader_handle_line (self=0x80a51d0,
>>     line=0x80a31c8 "Apr 12 06:02:39 12log01 syslog-ng[7991]: syslog-ng
>> starting up; version='2.0.5'\n\n", length=81,
>>     saddr=0x80a55e0, parse_flags=0) at logreader.c:267
>>       m = (LogMessage *) 0x80a53c0
>>       path_options = {flow_control = -1, matched = 0x0}
>> #17 0x0806c79d in log_reader_fetch_log (self=0x80a51d0,
>> proto=0x80a3168) at logreader.c:346
>>       msg = (
>>     const guchar *) 0x80a31c8 "Apr 12 06:02:39 12log01
>> syslog-ng[7991]: syslog-ng starting up; version='2.0.5'\n\n"
>>       msg_len = 81
>>       status = LPS_SUCCESS
>>       sa = (GSockAddr *) 0x80a55e0
>>       msg_count = 1
>>       may_read = 1
>>       parse_flags = 0
>>       __PRETTY_FUNCTION__ = "log_reader_fetch_log"
>> #18 0x0806c383 in log_reader_fd_dispatch (source=0x80a5248,
>> callback=0, user_data=0x0) at logreader.c:207
>>       self = (LogReaderWatch *) 0x80a5248
>> #19 0xb7e75cf6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
>> No symbol table info available.
>> #20 0xb7e790b3 in ?? () from /usr/lib/libglib-2.0.so.0
>> No symbol table info available.
>> #21 0xb7e7966e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
>> No symbol table info available.
>> #22 0x0804dff6 in main_loop_run (cfg=0xbfd74db0) at main.c:149
>>       iters = 3
>>       stats_timer_id = 5
>> #23 0x0804e64d in main (argc=1, argv=0xbfd74e54) at main.c:394
>>       cfg = (GlobalConfig *) 0x809baa0
>>       rc = 0
>>       ctx = (GOptionContext *) 0x808ecc8
>>       error = (GError *) 0x0
>>
>> Thanks,
>> Nate
>> ______________________________________________________________________________
>> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
>> Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
>> FAQ: http://www.campin.net/syslog-ng/faq.html
>>
>>
> --
> Key fingerprint = F78C 25CA 5F88 6FAF EA21 779D 3279 9F9E 1155 670D
>
>
> ______________________________________________________________________________
> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
> FAQ: http://www.campin.net/syslog-ng/faq.html
>
>


More information about the syslog-ng mailing list