[syslog-ng] trap divide error
Balazs Scheidler
bazsi at balabit.hu
Thu Dec 22 15:02:56 CET 2011
hi,
This patch should fix it:
commit 511e939f4199af3ae9aaa4a14b77c7f82863c16f
Author: Balazs Scheidler <bazsi at balabit.hu>
Date: Thu Dec 22 15:02:16 2011 +0100
logsource: fixed potential division by zero exception
Reported-By: Dmitry Gilev <dmitry.gilev at me.com>
Signed-off-by: Balazs Scheidler <bazsi at balabit.hu>
On Wed, 2011-12-21 at 12:45 -0800, Dmitry Gilev wrote:
> GDB Info (only thread one as it seems to be the originator of trap):
>
> Core was generated by `syslog-ng --enable-core -F'.
> Program terminated with signal 8, Arithmetic exception.
> #0 0x00007faa78e6d700 in log_source_msg_ack (msg=0x7faa60b94490, user_data=0x1b71780) at logsource.c:100
> 100 self->window_full_sleep_nsec = (diff / (cur_ack_count - self->last_ack_count));
>
> ===============
>
> Thread 1 (Thread 0x7faa52bfd700 (LWP 23628)):
> #0 0x00007faa78e6d700 in log_source_msg_ack (msg=0x7faa60b94490, user_data=0x1b71780) at logsource.c:100
> now = {tv_sec = 57168, tv_nsec = 177746384}
> diff = 1000000568
> self = 0x1b71780
> old_window_size = 1000
> cur_ack_count = 245760
> last_ack_count = 229376
> #1 0x00007faa78e63b3c in log_msg_refcache_stop () at logmsg.c:1446
> old_value = 65538
> current_cached_refs = -1
> current_cached_acks = -1
> __PRETTY_FUNCTION__ = "log_msg_refcache_stop"
> #2 0x00007faa78e71bfd in log_writer_flush (self=0x1ba2780, flush_mode=LW_FLUSH_NORMAL) at logwriter.c:1026
> lm = 0x7faa60b94490
> path_options = {ack_needed = -1, flow_control_requested = 0, matched = 0x0}
> consumed = 1
> proto = 0x1ba3250
> count = 16
> ignore_throttle = 0
> #3 0x00007faa78e6f89c in log_writer_work_perform (s=0x1ba2780) at logwriter.c:129
> self = 0x1ba2780
> __PRETTY_FUNCTION__ = "log_writer_work_perform"
> #4 0x00007faa78e739a9 in main_loop_io_worker_job_start (self=0x1ba2a10) at mainloop.c:367
> lh = 0x1b4e370
> lh2 = 0x1b4e398
> __PRETTY_FUNCTION__ = "main_loop_io_worker_job_start"
> #5 0x00007faa78e9e909 in iv_work_thread_got_event (_thr=0x1ccac20) at iv_work.c:113
> work = 0x1ba2a30
> thr = 0x1ccac20
> pool = 0x1b4e370
> finish = {tv_sec = 57170, tv_nsec = 447346949}
> #6 0x00007faa78e9d94b in iv_event_run_pending_events (_dummy=<value optimized out>) at iv_event.c:67
> ie = <value optimized out>
> current_pending_events = {next = 0x7faa52bfa530, prev = 0x7faa52bfa530}
> #7 0x00007faa78e9dca9 in iv_event_raw_got_event (_this=0x7faa52bfd618) at iv_event_raw.c:82
> this = 0x7faa52bfd618
> buf =
> "\001", '\000' <repeats 551 times>, " \000\000\000\000\000\000\000\004\000\000\000\000\000\000\000P\b", '\000' <repeats 30 times>, " \020\002\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\002", '\000' <repeats 14 times>, "\004\000\000\000\000\000\000 \000\000(\252\177\000\000\000\004\000\000\000\000\000\000\360W\000(\252\177\000\000\060I\000(\252\177\000\000@\000\000\000\000\000\000\000ޙ\247\320\065\000\000\000\000\004\000\000\000\000\000\000 \000\000(\252\177\000\000\360\003\000\000\000\000\000\000\340H\000(\252\177\000\000\320B\264\001", '\000' <repeats 12 times>"\227, \246\340\320\065\000\000\000\230\250\277R\252\177\000\000 \000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\340H\000(\252\177\000\000i\241\247\320\065\000\000\000P\000\000\000\000\000\000\000\210_"...
> ret = <value optimized out>
> #8 0x00007faa78e9b6f6 in iv_run_active_list () at iv_main.c:219
> fd = 0x7faa52bfd628
> notify = 0
> #9 iv_main () at iv_main.c:269
> to = {tv_sec = 10, tv_nsec = 0}
> msec = <value optimized out>
> active = {next = 0x7faa52bfa9b0, prev = 0x7faa52bfa9b0}
> #10 0x00007faa78e9e62c in iv_work_thread (_thr=0x1ccac20) at iv_work.c:196
> thr = 0x1ccac20
> pool = 0x1b4e370
> #11 0x00007faa78e9eeb7 in iv_thread_handler (_thr=0x1cc9f20) at iv_thread.c:100
> __cancel_buf = {__cancel_jmp_buf = {{__cancel_jmp_buf = {0, 1216329564017482648, 140735901864880, 140369509472704, 0, 3, -1173785613423256680, -1173833560446641256}, __mask_was_saved = 0}}, __pad = {0x7faa52bfab50, 0x0, 0x0,
> 0x0}}
> __cancel_routine = 0x7faa78e9ee30 <iv_thread_cleanup_handler>
> __cancel_arg = 0x1cc9f20
> not_first_call = <value optimized out>
> thr = 0x1cc9f20
> #12 0x00000035d0e077f1 in start_thread () from /lib64/libpthread.so.0
> No symbol table info available.
> #13 0x00000035d0ae570d in clone () from /lib64/libc.so.6
>
> Let me know if I need to provide something else.
>
> Thanks,
> Dmitry
>
> On Dec 21, 2011, at 10:00 AM, Gergely Nagy wrote:
>
> > Dmitry Gilev <dmitry.gilev at me.com> writes:
> >
> >> Hi,
> >>
> >> I've started to get the following messages since upgrade to 3.3.3 (from 3.0.7:
> >>
> >> From dmesg logs:
> >> syslog-ng[30744] trap divide error ip:7fa0f8ed5a56 sp:7fa0f64423a0 error:0 in libsyslog-ng-3.3.3.so[7fa0f8ea3000+7b000]
> >> syslog-ng[30798] trap divide error ip:7fa0f8ed5a56 sp:7fa0df5fb3a0 error:0 in libsyslog-ng-3.3.3.so[7fa0f8ea3000+7b000]
> >> syslog-ng[31043] trap divide error ip:7fa0f8ed5a56 sp:7fa0d2bfa3a0 error:0 in libsyslog-ng-3.3.3.so[7fa0f8ea3000+7b000]
> >> syslog-ng[31059] trap divide error ip:7fa0f8ed5a56 sp:7fa0e6bfa3a0 error:0 in libsyslog-ng-3.3.3.so[7fa0f8ea3000+7b000]
> >> syslog-ng[31087] trap divide error ip:7fa0f8ed5a56 sp:7fa0de1f93a0 error:0 in libsyslog-ng-3.3.3.so[7fa0f8ea3000+7b000]
> >> syslog-ng[31145] trap divide error ip:7fa0f8ed5a56 sp:7fa0f64423a0 error:0 in libsyslog-ng-3.3.3.so[7fa0f8ea3000+7b000]
> >> syslog-ng[32733] trap divide error ip:7fa0f8ed5a56 sp:7fa0f64423a0 error:0 in libsyslog-ng-3.3.3.so[7fa0f8ea3000+7b000]
> >> syslog-ng[1404] trap divide error ip:7fa0f8ed5a56 sp:7fa0f6e433a0 error:0 in libsyslog-ng-3.3.3.so[7fa0f8ea3000+7b000]
> >> syslog-ng[1531] trap divide error ip:7fa0f8ed5a56 sp:7fa0f64423a0 error:0 in libsyslog-ng-3.3.3.so[7fa0f8ea3000+7b000]
> >> syslog-ng[1688] trap divide error ip:7fa0f8ed5a56 sp:7fa0e7ffc3a0 error:0 in libsyslog-ng-3.3.3.so[7fa0f8ea3000+7b000]
> >> syslog-ng[2013] trap divide error ip:7fa0f8ed5a56 sp:7fa0f4c2c3a0 error:0 in libsyslog-ng-3.3.3.so[7fa0f8ea3000+7b000]
> >> syslog-ng[2019] trap divide error ip:7fa0f8ed5a56 sp:7fa0f6e433a0 error:0 in libsyslog-ng-3.3.3.so[7fa0f8ea3000+7b000]
> >>
> >> Does anybody know what is wrong here? Is it known bug?
> >
> > Could you perhaps get a backtrace from that?
> >
> > The way to do that, is to run with --enable-debug, and it should drop a
> > core file. Then you can use gdb to get a backtrace:
> >
> > $ gdb -c /path/to/core /usr/local/sbin/syslog-ng
> > (gdb) thread apply all bt full
> > ...
> > (gdb) quit
> >
> > It would be best, if syslog-ng would be compiled with debugging symbols
> > (-g), and not stripped. So that the backtrace would be actually useful
> > :)
> >
> > If this can't be done, then it would help if we'd know more about the
> > stuation: were there any reloads around the time the crash occurred?
> > What config do you use? How frequent does it crash?
> >
> > Thanks!
> >
> > --
> > |8]
> >
> > ______________________________________________________________________________
> > Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
> > Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
> > FAQ: http://www.balabit.com/wiki/syslog-ng-faq
> >
>
> ______________________________________________________________________________
> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
> FAQ: http://www.balabit.com/wiki/syslog-ng-faq
>
--
Bazsi
More information about the syslog-ng
mailing list