Hello, I tried to compile syslog-ng 3.4 alpha git on FreeBSD 8.1 with smtp support, but it does not start: fb81# /usr/local/etc/rc.d/syslog-ng start Starting syslog_ng. Error opening plugin module; module='afsmtp', error='/usr/local/lib/syslog-ng/libafsmtp.so: Undefined symbol "_smtp_message_str_cb"' smtp support can only be disabled by removing libesmtp from the system... There is also a segfault now for each incoming log (nothing appears in log files), so I'm checking if it's related to any of the enabled modules. At first glance it seems to be something FreeBSD specific, I have all modules enabled on openSUSE, and logging seems to work (at least the basics, I checked). Bye, -- Peter Czanik (CzP)<czanik@balabit.hu> BalaBit IT Security / syslog-ng upstream http://czanik.blogs.balabit.com/
On 04/03/2012 12:55 PM, Peter Czanik wrote:
There is also a segfault now for each incoming log (nothing appears in log files), so I'm checking if it's related to any of the enabled modules. At first glance it seems to be something FreeBSD specific, I have all modules enabled on openSUSE, and logging seems to work (at least the basics, I checked). Did a few rebuilds with different options. No matter of configuration, syslog-ng 3.4 git segfaults once each second and there is nothing in the logs. Oddly enough, if I start from the console with "-d", then it works fine.
-- Peter Czanik (CzP)<czanik@balabit.hu> BalaBit IT Security / syslog-ng upstream http://czanik.blogs.balabit.com/
Peter Czanik <czanik@balabit.hu> writes:
On 04/03/2012 12:55 PM, Peter Czanik wrote:
There is also a segfault now for each incoming log (nothing appears in log files), so I'm checking if it's related to any of the enabled modules. At first glance it seems to be something FreeBSD specific, I have all modules enabled on openSUSE, and logging seems to work (at least the basics, I checked). Did a few rebuilds with different options. No matter of configuration, syslog-ng 3.4 git segfaults once each second and there is nothing in the logs. Oddly enough, if I start from the console with "-d", then it works fine.
Can you generate a core and show me a backtrace? (gdb -c /path/to/core /path/to/syslog-ng; and once in gdb: thread apply all backtrace) I tried the current 3.4 git HEAD on freebsd, and with a trivial config, and it appears to work. -- |8]
On 04/03/2012 03:20 PM, Gergely Nagy wrote:
thread apply all backtrace 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 100048] [New Thread 8016041c0 (LWP 100048)] Core was generated by `syslog-ng'. Program terminated with signal 11, Segmentation fault. #0 0x0000000801428b86 in memcpy () from /lib/libc.so.7 (gdb) thread apply all backtrace
Thread 1 (Thread 8016041c0 (LWP 100048)): #0 0x0000000801428b86 in memcpy () from /lib/libc.so.7 #1 0x0000000800687c28 in nv_table_add_value () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #2 0x0000000800676499 in log_msg_set_value () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #3 0x000000080066f6de in log_src_driver_queue_method () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #4 0x000000080067f7dd in log_source_queue () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #5 0x0000000800668fc2 in afinter_source_post () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #6 0x000000080069e167 in iv_event_run_pending_events () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #7 0x000000080069e514 in iv_event_raw_got_event () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #8 0x000000080069fb2a in iv_main () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #9 0x000000080068532e in main_loop_run () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #10 0x00000000004016e2 in main () (gdb) quit -- Peter Czanik (CzP)<czanik@balabit.hu> BalaBit IT Security / syslog-ng upstream http://czanik.blogs.balabit.com/
On 04/03/2012 03:38 PM, Peter Czanik wrote:
On 04/03/2012 03:20 PM, Gergely Nagy wrote:
thread apply all backtrace 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 100048] [New Thread 8016041c0 (LWP 100048)] Core was generated by `syslog-ng'. Program terminated with signal 11, Segmentation fault. #0 0x0000000801428b86 in memcpy () from /lib/libc.so.7 (gdb) thread apply all backtrace
Thread 1 (Thread 8016041c0 (LWP 100048)): #0 0x0000000801428b86 in memcpy () from /lib/libc.so.7 #1 0x0000000800687c28 in nv_table_add_value () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #2 0x0000000800676499 in log_msg_set_value () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #3 0x000000080066f6de in log_src_driver_queue_method () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #4 0x000000080067f7dd in log_source_queue () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #5 0x0000000800668fc2 in afinter_source_post () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #6 0x000000080069e167 in iv_event_run_pending_events () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #7 0x000000080069e514 in iv_event_raw_got_event () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #8 0x000000080069fb2a in iv_main () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #9 0x000000080068532e in main_loop_run () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #10 0x00000000004016e2 in main () (gdb) quit
And compiled with --enable-debug: 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 100064] [New Thread 8016041c0 (LWP 100064)] Core was generated by `syslog-ng'. Program terminated with signal 11, Segmentation fault. #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 (gdb) thread apply all backtrace Thread 1 (Thread 8016041c0 (LWP 100064)): #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 #1 0x00000008006884a8 in nv_table_add_value (self=0x803c00000, handle=7, name=0x80161b1c8 "SOURCE", name_len=6, value=0x80161b4c0 "s_local", value_len=23133952, new_entry=0x7fffffffe424) at nvtable.c:464 #2 0x0000000800676809 in log_msg_set_value (self=0x801610500, handle=7, value=0x80161b4c0 "s_local", value_len=23133952) at logmsg.c:450 #3 0x000000080066fa4e in log_src_driver_queue_method (s=0x80160b800, msg=0x801610500, path_options=0x7fffffffe4a0, user_data=<optimized out>) at driver.c:161 #4 0x000000080067fedd in log_pipe_queue (path_options=<optimized out>, msg=<optimized out>, s=<optimized out>) at logpipe.h:304 #5 log_pipe_forward_msg (path_options=<optimized out>, msg=<optimized out>, self=<optimized out>) at logpipe.h:290 #6 log_source_queue (s=0x80160ff00, msg=0x801610500, path_options=<optimized out>, user_data=<optimized out>) at logsource.c:290 #7 0x0000000800669332 in log_pipe_queue (path_options=<optimized out>, msg=<optimized out>, s=<optimized out>) at logpipe.h:304 #8 afinter_source_post (s=<optimized out>) at afinter.c:115 #9 0x00000008006a3297 in iv_event_run_pending_events () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #10 0x00000008006a3644 in iv_event_raw_got_event () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #11 0x00000008006a4c5a in iv_main () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #12 0x0000000800685bae in main_loop_run () at mainloop.c:731 #13 0x0000000000401722 in main () The config is quite simple: fb81# cat /usr/local/etc/syslog-ng.conf ############################################################################# # Default syslog-ng.conf file which collects all local logs into a # single file called /var/log/messages. # @version: 3.4 @include "scl.conf" source s_local { system(); internal(); }; source s_network { udp(); }; destination d_local { file("/var/log/messages"); }; log { source(s_local); # uncomment this line to open port 514 to receive messages #source(s_network); destination(d_local); }; Bye, -- Peter Czanik (CzP)<czanik@balabit.hu> BalaBit IT Security / syslog-ng upstream http://czanik.blogs.balabit.com/
Peter Czanik <czanik@balabit.hu> writes:
Program terminated with signal 11, Segmentation fault. #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 (gdb) thread apply all backtrace
Thread 1 (Thread 8016041c0 (LWP 100064)): #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 #1 0x00000008006884a8 in nv_table_add_value (self=0x803c00000, handle=7, name=0x80161b1c8 "SOURCE", name_len=6, value=0x80161b4c0 "s_local", value_len=23133952, new_entry=0x7fffffffe424) at nvtable.c:464
Interesting. Can you perhaps try with commit bb667115b80b24055dd1245084c7d2e26d01d184 reverted? -- |8]
On 04/03/2012 03:53 PM, Gergely Nagy wrote:
Peter Czanik<czanik@balabit.hu> writes:
Program terminated with signal 11, Segmentation fault. #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 (gdb) thread apply all backtrace
Thread 1 (Thread 8016041c0 (LWP 100064)): #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 #1 0x00000008006884a8 in nv_table_add_value (self=0x803c00000, handle=7, name=0x80161b1c8 "SOURCE", name_len=6, value=0x80161b4c0 "s_local", value_len=23133952, new_entry=0x7fffffffe424) at nvtable.c:464 Interesting. Can you perhaps try with commit bb667115b80b24055dd1245084c7d2e26d01d184 reverted?
Yes, that solved the problem on FreeBSD 8.1. Previously I wrote, that this problem does not seem to affect Linux. I checked it again, and have some mixed results: I have some logs from yesterday, even from after I installed the git version with NVtable changes, but right now it's also segfaults on openSUSE 12.1. Bye, -- Peter Czanik (CzP)<czanik@balabit.hu> BalaBit IT Security / syslog-ng upstream http://czanik.blogs.balabit.com/
I have reverted the changes for now. ----- Original message -----
On 04/03/2012 03:53 PM, Gergely Nagy wrote:
Peter Czanik<czanik@balabit.hu> writes:
Program terminated with signal 11, Segmentation fault. #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 (gdb) thread apply all backtrace
Thread 1 (Thread 8016041c0 (LWP 100064)): #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 #1 0x00000008006884a8 in nv_table_add_value (self=0x803c00000, handle=7, name=0x80161b1c8 "SOURCE", name_len=6, value=0x80161b4c0 "s_local", value_len=23133952, new_entry=0x7fffffffe424) at nvtable.c:464 Interesting. Can you perhaps try with commit bb667115b80b24055dd1245084c7d2e26d01d184 reverted?
Yes, that solved the problem on FreeBSD 8.1. Previously I wrote, that this problem does not seem to affect Linux. I checked it again, and have some mixed results: I have some logs from yesterday, even from after I installed the git version with NVtable changes, but right now it's also segfaults on openSUSE 12.1. Bye,
-- Peter Czanik (CzP)<czanik@balabit.hu> BalaBit IT Security / syslog-ng upstream http://czanik.blogs.balabit.com/
______________________________________________________________________________ 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
Hello, On 04/04/2012 07:44 PM, Balazs Scheidler wrote:
I have reverted the changes for now.
Tested on openSUSE 12.1 and FreeBSD 8.1, and they work fine now (did only some basic testing). https://build.opensuse.org/package/show?package=syslog-ng&project=home%3Acza... has now latest git sources with the nvtables fix (revert). I have an update for FreeBSD syslog-ng-devel almost ready, hope to publish it in the coming days. Bye, CzP
----- Original message -----
On 04/03/2012 03:53 PM, Gergely Nagy wrote:
Peter Czanik<czanik@balabit.hu <mailto:czanik@balabit.hu>> writes:
Program terminated with signal 11, Segmentation fault. #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 (gdb) thread apply all backtrace
Thread 1 (Thread 8016041c0 (LWP 100064)): #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 #1 0x00000008006884a8 in nv_table_add_value (self=0x803c00000, handle=7, name=0x80161b1c8 "SOURCE", name_len=6, value=0x80161b4c0 "s_local", value_len=23133952, new_entry=0x7fffffffe424) at nvtable.c:464 Interesting. Can you perhaps try with commit bb667115b80b24055dd1245084c7d2e26d01d184 reverted?
Yes, that solved the problem on FreeBSD 8.1. Previously I wrote, that this problem does not seem to affect Linux. I checked it again, and have some mixed results: I have some logs from yesterday, even from after I installed the git version with NVtable changes, but right now it's also segfaults on openSUSE 12.1. Bye,
-- Peter Czanik (CzP)<czanik@balabit.hu <mailto:czanik@balabit.hu>> BalaBit IT Security / syslog-ng upstream http://czanik.blogs.balabit.com/
______________________________________________________________________________
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
-- Peter Czanik (CzP)<czanik@balabit.hu> BalaBit IT Security / syslog-ng upstream http://czanik.blogs.balabit.com/
Hi, I also was able to reproduce the segfault. It always happened when a "mark" was generated. So, in order to reproduce this, set the mark intervall to a low value, i.e. mark(1). I don't think it's a Problem of the 32bit NVTable patch, though. The following changes also made the segfault go away: --- a/lib/driver.c +++ b/lib/driver.c @@ -158,7 +158,7 @@ log_src_driver_queue_method(LogPipe *s, LogMessage *msg, const LogPathOptions *p if (msg->flags & LF_LOCAL) afinter_postpone_mark(cfg->mark_freq); - log_msg_set_value(msg, LM_V_SOURCE, self->super.group, self->group_len); + log_msg_set_value(msg, LM_V_SOURCE, self->super.group, strlen(self->super.group)); stats_counter_inc(self->super.processed_group_messages); stats_counter_inc(self->received_global_messages); log_pipe_forward_msg(s, msg, path_options); It seems that self->group_len is not initialized correctly, resulting in some ridiculous large value_len being passed to nv_table_set value. I just found this, but did not have any further time to investigate. I suspect this has been there before the NVTable patch, but since the value_len exceeded the old NVTable max value size, nothing was inserted. Peter Am 04.04.2012 19:44, schrieb Balazs Scheidler:
I have reverted the changes for now.
----- Original message -----
On 04/03/2012 03:53 PM, Gergely Nagy wrote:
Peter Czanik<czanik@balabit.hu <mailto:czanik@balabit.hu>> writes:
Program terminated with signal 11, Segmentation fault. #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 (gdb) thread apply all backtrace
Thread 1 (Thread 8016041c0 (LWP 100064)): #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 #1 0x00000008006884a8 in nv_table_add_value (self=0x803c00000, handle=7, name=0x80161b1c8 "SOURCE", name_len=6, value=0x80161b4c0 "s_local", value_len=23133952, new_entry=0x7fffffffe424) at nvtable.c:464 Interesting. Can you perhaps try with commit bb667115b80b24055dd1245084c7d2e26d01d184 reverted?
Yes, that solved the problem on FreeBSD 8.1. Previously I wrote, that this problem does not seem to affect Linux. I checked it again, and have some mixed results: I have some logs from yesterday, even from after I installed the git version with NVtable changes, but right now it's also segfaults on openSUSE 12.1. Bye,
Peter Eisenlohr <peter.eisenlohr@inform-software.com> writes:
Hi,
I also was able to reproduce the segfault. It always happened when a "mark" was generated. So, in order to reproduce this, set the mark intervall to a low value, i.e. mark(1).
I don't think it's a Problem of the 32bit NVTable patch, though. The following changes also made the segfault go away:
--- a/lib/driver.c +++ b/lib/driver.c @@ -158,7 +158,7 @@ log_src_driver_queue_method(LogPipe *s, LogMessage *msg, const LogPathOptions *p if (msg->flags & LF_LOCAL) afinter_postpone_mark(cfg->mark_freq);
- log_msg_set_value(msg, LM_V_SOURCE, self->super.group, self->group_len); + log_msg_set_value(msg, LM_V_SOURCE, self->super.group, strlen(self->super.group)); stats_counter_inc(self->super.processed_group_messages); stats_counter_inc(self->received_global_messages); log_pipe_forward_msg(s, msg, path_options);
It seems that self->group_len is not initialized correctly, resulting in some ridiculous large value_len being passed to nv_table_set value. I just found this, but did not have any further time to investigate. I suspect this has been there before the NVTable patch, but since the value_len exceeded the old NVTable max value size, nothing was inserted.
This sounds interesting! Thanks for the investigation, this will help me narrow down the issue tomorrow! -- |8]
Peter Eisenlohr <peter.eisenlohr@inform-software.com> writes:
Hi,
I also was able to reproduce the segfault. It always happened when a "mark" was generated. So, in order to reproduce this, set the mark intervall to a low value, i.e. mark(1).
I don't think it's a Problem of the 32bit NVTable patch, though. The following changes also made the segfault go away:
Thanks again for the debugging! I just sent a patch to the list that fixes the issue properly. The problem was that afinter had LogDriver as its parent, while we were casting it from and to LogSrcDriver, which is a bigger structure. This resulted in the code overwriting parts of the original LogSrcDriver parts (such as group_len) with data from AFInterSourceDirver. I changed the parent to LogSrcDriver and that that fixes the issue properly. Pinning it down to mark messages helped tremendously! Thanks! -- |8]
On 06.04.2012 11:39, Gergely Nagy wrote:
Peter Eisenlohr <peter.eisenlohr@inform-software.com> writes:
I don't think it's a Problem of the 32bit NVTable patch, though. The following changes also made the segfault go away:
Thanks again for the debugging! I just sent a patch to the list that fixes the issue properly. The problem was that afinter had LogDriver as its parent, while we were casting it from and to LogSrcDriver, which is a bigger structure.
I can confirm that your patch fixes the issue. There is no longer a segfault when a 'mark' is generated. I also tested this with the large NVtable patch (commit bb66711) re-applied. Thanks for the quick fix. Peter
hi, thanks for the diagnosis, I'll look into applying the patch again. ----- Original message -----
Hi,
I also was able to reproduce the segfault. It always happened when a "mark" was generated. So, in order to reproduce this, set the mark intervall to a low value, i.e. mark(1).
I don't think it's a Problem of the 32bit NVTable patch, though. The following changes also made the segfault go away:
--- a/lib/driver.c +++ b/lib/driver.c @@ -158,7 +158,7 @@ log_src_driver_queue_method(LogPipe *s, LogMessage *msg, const LogPathOptions *p if (msg->flags & LF_LOCAL) afinter_postpone_mark(cfg->mark_freq);
- log_msg_set_value(msg, LM_V_SOURCE, self->super.group, self->group_len); + log_msg_set_value(msg, LM_V_SOURCE, self->super.group, strlen(self->super.group)); stats_counter_inc(self->super.processed_group_messages); stats_counter_inc(self->received_global_messages); log_pipe_forward_msg(s, msg, path_options);
It seems that self->group_len is not initialized correctly, resulting in some ridiculous large value_len being passed to nv_table_set value. I just found this, but did not have any further time to investigate. I suspect this has been there before the NVTable patch, but since the value_len exceeded the old NVTable max value size, nothing was inserted.
Peter
Am 04.04.2012 19:44, schrieb Balazs Scheidler:
I have reverted the changes for now.
----- Original message -----
On 04/03/2012 03:53 PM, Gergely Nagy wrote:
Peter Czanik<czanik@balabit.hu <mailto:czanik@balabit.hu>> writes:
Program terminated with signal 11, Segmentation fault. #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 (gdb) thread apply all backtrace
Thread 1 (Thread 8016041c0 (LWP 100064)): #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 #1 0x00000008006884a8 in nv_table_add_value (self=0x803c00000, handle=7, name=0x80161b1c8 "SOURCE", name_len=6, value=0x80161b4c0 "s_local", value_len=23133952, new_entry=0x7fffffffe424) at nvtable.c:464 Interesting. Can you perhaps try with commit bb667115b80b24055dd1245084c7d2e26d01d184 reverted?
Yes, that solved the problem on FreeBSD 8.1. Previously I wrote, that this problem does not seem to affect Linux. I checked it again, and have some mixed results: I have some logs from yesterday, even from after I installed the git version with NVtable changes, but right now it's also segfaults on openSUSE 12.1. Bye,
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
I've just merged a branch to add support for huge nvtables. It was resting in a separate branch for a while until the upstream sign-off has arrived. that maybe the culprit. ----- Original message -----
On 04/03/2012 03:38 PM, Peter Czanik wrote:
On 04/03/2012 03:20 PM, Gergely Nagy wrote:
thread apply all backtrace 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 100048] [New Thread 8016041c0 (LWP 100048)] Core was generated by `syslog-ng'. Program terminated with signal 11, Segmentation fault. #0 0x0000000801428b86 in memcpy () from /lib/libc.so.7 (gdb) thread apply all backtrace
Thread 1 (Thread 8016041c0 (LWP 100048)): #0 0x0000000801428b86 in memcpy () from /lib/libc.so.7 #1 0x0000000800687c28 in nv_table_add_value () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #2 0x0000000800676499 in log_msg_set_value () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #3 0x000000080066f6de in log_src_driver_queue_method () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #4 0x000000080067f7dd in log_source_queue () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #5 0x0000000800668fc2 in afinter_source_post () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #6 0x000000080069e167 in iv_event_run_pending_events () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #7 0x000000080069e514 in iv_event_raw_got_event () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #8 0x000000080069fb2a in iv_main () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #9 0x000000080068532e in main_loop_run () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #10 0x00000000004016e2 in main () (gdb) quit
And compiled with --enable-debug: 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 100064] [New Thread 8016041c0 (LWP 100064)] Core was generated by `syslog-ng'. Program terminated with signal 11, Segmentation fault. #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 (gdb) thread apply all backtrace
Thread 1 (Thread 8016041c0 (LWP 100064)): #0 0x000000080142fb86 in memcpy () from /lib/libc.so.7 #1 0x00000008006884a8 in nv_table_add_value (self=0x803c00000, handle=7, name=0x80161b1c8 "SOURCE", name_len=6, value=0x80161b4c0 "s_local", value_len=23133952, new_entry=0x7fffffffe424) at nvtable.c:464 #2 0x0000000800676809 in log_msg_set_value (self=0x801610500, handle=7, value=0x80161b4c0 "s_local", value_len=23133952) at logmsg.c:450 #3 0x000000080066fa4e in log_src_driver_queue_method (s=0x80160b800, msg=0x801610500, path_options=0x7fffffffe4a0, user_data=<optimized out>) at driver.c:161 #4 0x000000080067fedd in log_pipe_queue (path_options=<optimized out>, msg=<optimized out>, s=<optimized out>) at logpipe.h:304 #5 log_pipe_forward_msg (path_options=<optimized out>, msg=<optimized out>, self=<optimized out>) at logpipe.h:290 #6 log_source_queue (s=0x80160ff00, msg=0x801610500, path_options=<optimized out>, user_data=<optimized out>) at logsource.c:290 #7 0x0000000800669332 in log_pipe_queue (path_options=<optimized out>, msg=<optimized out>, s=<optimized out>) at logpipe.h:304 #8 afinter_source_post (s=<optimized out>) at afinter.c:115 #9 0x00000008006a3297 in iv_event_run_pending_events () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #10 0x00000008006a3644 in iv_event_raw_got_event () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #11 0x00000008006a4c5a in iv_main () from /usr/local/lib/libsyslog-ng-3.4.0alpha1.so #12 0x0000000800685bae in main_loop_run () at mainloop.c:731 #13 0x0000000000401722 in main ()
The config is quite simple:
fb81# cat /usr/local/etc/syslog-ng.conf ############################################################################# # Default syslog-ng.conf file which collects all local logs into a # single file called /var/log/messages. #
@version: 3.4 @include "scl.conf"
source s_local { system(); internal(); };
source s_network { udp(); };
destination d_local { file("/var/log/messages"); };
log { source(s_local);
# uncomment this line to open port 514 to receive messages #source(s_network); destination(d_local); };
Bye,
-- Peter Czanik (CzP)<czanik@balabit.hu> BalaBit IT Security / syslog-ng upstream http://czanik.blogs.balabit.com/
______________________________________________________________________________ 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
On 04/03/2012 12:55 PM, Peter Czanik wrote:
Hello,
I tried to compile syslog-ng 3.4 alpha git on FreeBSD 8.1 with smtp support, but it does not start:
fb81# /usr/local/etc/rc.d/syslog-ng start Starting syslog_ng. Error opening plugin module; module='afsmtp', error='/usr/local/lib/syslog-ng/libafsmtp.so: Undefined symbol "_smtp_message_str_cb"' It seems to me (based on objdump), that it's not linked to libesmtp at all. See afsql vs. afsmtp:
fb81# objdump -x libafsql.so | grep NEEDED NEEDED libsyslog-ng-3.4.0alpha1.so NEEDED librt.so.1 NEEDED libgmodule-2.0.so.0 NEEDED libgthread-2.0.so.0 NEEDED libglib-2.0.so.0 NEEDED libintl.so.9 NEEDED libiconv.so.3 NEEDED libevtlog.so.0 NEEDED libpcre.so.1 NEEDED libnet.so.7 NEEDED libdbi.so.1 NEEDED libcrypto.so.7 NEEDED libssl.so.7 NEEDED libthr.so.3 NEEDED libc.so.7 fb81# objdump -x libafsmtp.so | grep NEEDED NEEDED libnet.so.7 NEEDED libthr.so.3 NEEDED libc.so.7 Bye, -- Peter Czanik (CzP)<czanik@balabit.hu> BalaBit IT Security / syslog-ng upstream http://czanik.blogs.balabit.com/
On 04/06/2012 10:36 AM, Peter Czanik wrote:
On 04/03/2012 12:55 PM, Peter Czanik wrote:
Hello,
I tried to compile syslog-ng 3.4 alpha git on FreeBSD 8.1 with smtp support, but it does not start:
fb81# /usr/local/etc/rc.d/syslog-ng start Starting syslog_ng. Error opening plugin module; module='afsmtp', error='/usr/local/lib/syslog-ng/libafsmtp.so: Undefined symbol "_smtp_message_str_cb"' It seems to me (based on objdump), that it's not linked to libesmtp at all. See afsql vs. afsmtp:
fb81# objdump -x libafsql.so | grep NEEDED NEEDED libsyslog-ng-3.4.0alpha1.so NEEDED librt.so.1 NEEDED libgmodule-2.0.so.0 NEEDED libgthread-2.0.so.0 NEEDED libglib-2.0.so.0 NEEDED libintl.so.9 NEEDED libiconv.so.3 NEEDED libevtlog.so.0 NEEDED libpcre.so.1 NEEDED libnet.so.7 NEEDED libdbi.so.1 NEEDED libcrypto.so.7 NEEDED libssl.so.7 NEEDED libthr.so.3 NEEDED libc.so.7 fb81# objdump -x libafsmtp.so | grep NEEDED NEEDED libnet.so.7 NEEDED libthr.so.3 NEEDED libc.so.7 This problems seems to be still present in 3.4 alpha2 on FreeBSD.
And looking at Linux, the problem seems to be present also there, just loading of syslog-ng does not fail as long as there are no smtp related options in syslog-ng.conf: # ldd /usr/lib/syslog-ng/libafsmtp.so linux-gate.so.1 => (0xffffe000) libpthread.so.0 => /lib/libpthread.so.0 (0xb76dd000) libc.so.6 => /lib/libc.so.6 (0xb7570000) /lib/ld-linux.so.2 (0xb771c000) If smtp is configured, syslog-ng gives no error messages, but does not start. Bye, -- Peter Czanik (CzP)<czanik@balabit.hu> BalaBit IT Security / syslog-ng upstream http://czanik.blogs.balabit.com/
Peter Czanik <czanik@balabit.hu> writes:
fb81# objdump -x libafsmtp.so | grep NEEDED NEEDED libnet.so.7 NEEDED libthr.so.3 NEEDED libc.so.7 This problems seems to be still present in 3.4 alpha2 on FreeBSD.
And looking at Linux, the problem seems to be present also there, just loading of syslog-ng does not fail as long as there are no smtp related options in syslog-ng.conf:
# ldd /usr/lib/syslog-ng/libafsmtp.so linux-gate.so.1 => (0xffffe000) libpthread.so.0 => /lib/libpthread.so.0 (0xb76dd000) libc.so.6 => /lib/libc.so.6 (0xb7570000) /lib/ld-linux.so.2 (0xb771c000)
If smtp is configured, syslog-ng gives no error messages, but does not start.
Hngh. I could've sworn this worked at some point. I'll have a look soon. -- |8]
Peter Czanik <czanik@balabit.hu> writes:
# ldd /usr/lib/syslog-ng/libafsmtp.so linux-gate.so.1 => (0xffffe000) libpthread.so.0 => /lib/libpthread.so.0 (0xb76dd000) libc.so.6 => /lib/libc.so.6 (0xb7570000) /lib/ld-linux.so.2 (0xb771c000)
I think I found the issue, can you try the attached patch? -- |8]
participants (4)
-
Balazs Scheidler
-
Gergely Nagy
-
Peter Czanik
-
Peter Eisenlohr