3.2 alpha 2 build error
When building using debian/rules binary on 3.2 alpha 2 my build fails here. Any advice on this one? Thanks, Matthew. /bin/bash ../../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c -o libafsql_la-afsql.lo `test -f 'afsql.c' || echo './'`afsql.c libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c afsql.c -fPIC -DPIC -o .libs/libafsql_la-afsql.o afsql.c:120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dbi_instance’ afsql.c: In function ‘afsql_dd_insert_db’: afsql.c:583: warning: implicit declaration of function ‘dbi_conn_new_r’ afsql.c:583: error: ‘dbi_instance’ undeclared (first use in this function) afsql.c:583: error: (Each undeclared identifier is reported only once afsql.c:583: error: for each function it appears in.) afsql.c: In function ‘afsql_dd_init’: afsql.c:1007: warning: implicit declaration of function ‘dbi_initialize_r’ afsql.c:1007: error: ‘dbi_instance’ undeclared (first use in this function)
More information. Host OS is Kubuntu 10.04 LTS. Version of libdbi0 is 0.8.2-3. Builds successfully with --disable-sql added to configure in debian/rules. However packaging will fail with the following: dpkg-shlibdeps: error: couldn't find library libsyslog-ng.so.0 needed by debian/syslog-ng/bin/pdbtool (ELF format: 'elf64-x86-64'; RPATH: '//lib://lib/syslog-ng'). Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file. To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH. dh_shlibdeps: dpkg-shlibdeps -Tdebian/syslog-ng.substvars debian/syslog-ng/sbin/syslog-ng debian/syslog-ng/bin/loggen debian/syslog-ng/bin/pdbtool returned exit code 2 make: *** [binary-arch] Error 9 Matthew. On Thu, Aug 19, 2010 at 06:16:39PM -0700, Matthew Hall wrote:
When building using debian/rules binary on 3.2 alpha 2 my build fails here. Any advice on this one?
Thanks, Matthew.
/bin/bash ../../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c -o libafsql_la-afsql.lo `test -f 'afsql.c' || echo './'`afsql.c libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c afsql.c -fPIC -DPIC -o .libs/libafsql_la-afsql.o afsql.c:120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dbi_instance’ afsql.c: In function ‘afsql_dd_insert_db’: afsql.c:583: warning: implicit declaration of function ‘dbi_conn_new_r’ afsql.c:583: error: ‘dbi_instance’ undeclared (first use in this function) afsql.c:583: error: (Each undeclared identifier is reported only once afsql.c:583: error: for each function it appears in.) afsql.c: In function ‘afsql_dd_init’: afsql.c:1007: warning: implicit declaration of function ‘dbi_initialize_r’ afsql.c:1007: error: ‘dbi_instance’ undeclared (first use in this function)
______________________________________________________________________________ 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. When I compiled it by hand, it cannot find its libraries. I checked /etc/ld.so.conf.d/ and /usr/local/lib is included as expected for Debian and Ubuntu, and the library exists also. megahall@ubuntu:~/syslog-ng-3.2alpha2$ sudo find / -iname libsyslog-ng.so.0 -print /home/megahall/syslog-ng-3.2alpha2/src/.libs/libsyslog-ng.so.0 /usr/local/lib/libsyslog-ng.so.0 megahall@ubuntu:~/syslog-ng-3.2alpha2$ pdbtool pdbtool: error while loading shared libraries: libsyslog-ng.so.0: cannot open shared object file: No such file or directory megahall@ubuntu:~/syslog-ng-3.2alpha2$ Enabling these options made no difference: --enable-shared --enable-dynamic-linking nm indicates that the library has symbols so it's not corrupt. file indicates that the arch is valid so it wasn't misbuilt for 32 bit. /usr/local/lib/libsyslog-ng.so.0.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped Not sure what to try next on this one. Matthew. On Thu, Aug 19, 2010 at 06:25:55PM -0700, Matthew Hall wrote:
More information.
Host OS is Kubuntu 10.04 LTS.
Version of libdbi0 is 0.8.2-3.
Builds successfully with --disable-sql added to configure in debian/rules.
However packaging will fail with the following:
dpkg-shlibdeps: error: couldn't find library libsyslog-ng.so.0 needed by debian/syslog-ng/bin/pdbtool (ELF format: 'elf64-x86-64'; RPATH: '//lib://lib/syslog-ng'). Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file. To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH. dh_shlibdeps: dpkg-shlibdeps -Tdebian/syslog-ng.substvars debian/syslog-ng/sbin/syslog-ng debian/syslog-ng/bin/loggen debian/syslog-ng/bin/pdbtool returned exit code 2 make: *** [binary-arch] Error 9
Matthew.
On Thu, Aug 19, 2010 at 06:16:39PM -0700, Matthew Hall wrote:
When building using debian/rules binary on 3.2 alpha 2 my build fails here. Any advice on this one?
Thanks, Matthew.
/bin/bash ../../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c -o libafsql_la-afsql.lo `test -f 'afsql.c' || echo './'`afsql.c libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c afsql.c -fPIC -DPIC -o .libs/libafsql_la-afsql.o afsql.c:120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dbi_instance’ afsql.c: In function ‘afsql_dd_insert_db’: afsql.c:583: warning: implicit declaration of function ‘dbi_conn_new_r’ afsql.c:583: error: ‘dbi_instance’ undeclared (first use in this function) afsql.c:583: error: (Each undeclared identifier is reported only once afsql.c:583: error: for each function it appears in.) afsql.c: In function ‘afsql_dd_init’: afsql.c:1007: warning: implicit declaration of function ‘dbi_initialize_r’ afsql.c:1007: error: ‘dbi_instance’ undeclared (first use in this function)
______________________________________________________________________________ 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
______________________________________________________________________________ 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
Output of ldd pdbtool and ldconfig -v | grep libsyslog-ng ? On Thu, Aug 19, 2010 at 8:44 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
More information. When I compiled it by hand, it cannot find its libraries.
I checked /etc/ld.so.conf.d/ and /usr/local/lib is included as expected for Debian and Ubuntu, and the library exists also.
megahall@ubuntu:~/syslog-ng-3.2alpha2$ sudo find / -iname libsyslog-ng.so.0 -print /home/megahall/syslog-ng-3.2alpha2/src/.libs/libsyslog-ng.so.0 /usr/local/lib/libsyslog-ng.so.0 megahall@ubuntu:~/syslog-ng-3.2alpha2$ pdbtool pdbtool: error while loading shared libraries: libsyslog-ng.so.0: cannot open shared object file: No such file or directory megahall@ubuntu:~/syslog-ng-3.2alpha2$
Enabling these options made no difference:
--enable-shared --enable-dynamic-linking
nm indicates that the library has symbols so it's not corrupt.
file indicates that the arch is valid so it wasn't misbuilt for 32 bit.
/usr/local/lib/libsyslog-ng.so.0.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
Not sure what to try next on this one.
Matthew.
On Thu, Aug 19, 2010 at 06:25:55PM -0700, Matthew Hall wrote:
More information.
Host OS is Kubuntu 10.04 LTS.
Version of libdbi0 is 0.8.2-3.
Builds successfully with --disable-sql added to configure in debian/rules.
However packaging will fail with the following:
dpkg-shlibdeps: error: couldn't find library libsyslog-ng.so.0 needed by debian/syslog-ng/bin/pdbtool (ELF format: 'elf64-x86-64'; RPATH: '//lib://lib/syslog-ng'). Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file. To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH. dh_shlibdeps: dpkg-shlibdeps -Tdebian/syslog-ng.substvars debian/syslog-ng/sbin/syslog-ng debian/syslog-ng/bin/loggen debian/syslog-ng/bin/pdbtool returned exit code 2 make: *** [binary-arch] Error 9
Matthew.
On Thu, Aug 19, 2010 at 06:16:39PM -0700, Matthew Hall wrote:
When building using debian/rules binary on 3.2 alpha 2 my build fails here. Any advice on this one?
Thanks, Matthew.
/bin/bash ../../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c -o libafsql_la-afsql.lo `test -f 'afsql.c' || echo './'`afsql.c libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c afsql.c -fPIC -DPIC -o .libs/libafsql_la-afsql.o afsql.c:120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dbi_instance’ afsql.c: In function ‘afsql_dd_insert_db’: afsql.c:583: warning: implicit declaration of function ‘dbi_conn_new_r’ afsql.c:583: error: ‘dbi_instance’ undeclared (first use in this function) afsql.c:583: error: (Each undeclared identifier is reported only once afsql.c:583: error: for each function it appears in.) afsql.c: In function ‘afsql_dd_init’: afsql.c:1007: warning: implicit declaration of function ‘dbi_initialize_r’ afsql.c:1007: error: ‘dbi_instance’ undeclared (first use in this function)
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
On Thu, Aug 19, 2010 at 08:53:28PM -0500, Martin Holste wrote:
Output of ldd pdbtool and ldconfig -v | grep libsyslog-ng ?
Thanks for offering to help again Martin. Sorry for the delayed reply. I had to leave work before I got your response. ldd is showing it cannot find the library. Rerunning ldconfig as you suggested appears to fix the library problem, although it does not explain the Debian-style build failure from before. Now that the library links OK, I am seeing a segmentation fault. I recompiled with export CFLAGS='-g' but still not getting much of a backtrace. valgrind output looks better. I am suspecting the --enable-memtrace build option is responsible based on what I see in the valgrind output. I just recompiled without that option and pdbtool works fine now. Therefore I suspect there is a problem with this option or perhaps I do not understand what it's supposed to do. Cheers, Matthew. Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) bt #0 0x0000000000000000 in ?? () #1 0x00007ffff5852573 in z_malloc (size=100, backtrace=0x7fffffffdb80) at memtrace.c:451 #2 0x00007ffff5852eb1 in malloc (size=100) at memtrace.c:565 #3 0x00007ffff41802f9 in _IO_vasprintf (result_ptr=0x7fffffffdfc8, format=0x7fffffffdb80 "\200\335\377\377\377\177", args=0x0) at vasprintf.c:52 #4 0x00007ffff41646f8 in ___asprintf (string_ptr=0x84, format=0x7fffffffdb80 "\200\335\377\377\377\177") at asprintf.c:37 #5 0x00007ffff4140903 in *__GI___assert_fail ( assertion=0x7ffff589311a "temp_brk < 32768", file=<value optimized out>, line=542, function=0x7ffff589312b "z_calloc") at assert.c:63 #6 0x00007ffff5852d79 in z_calloc (nmemb=35340, size=1, backtrace=0x7fffffffe060) at memtrace.c:542 #7 0x00007ffff5853035 in calloc (nmemb=35340, size=1) at memtrace.c:593 #8 0x00007ffff41fd463 in __monstartup (lowpc=<value optimized out>, highpc=<value optimized out>) at gmon.c:136 #9 0x0000000000403121 in __gmon_start__ () #10 0x00007ffff3d0c232 in ?? () from /lib/libattr.so.1 #11 0x00007fffffffe318 in ?? () #12 0x00007ffff3d0c099 in _init () from /lib/libattr.so.1 #13 0x00007ffff7fe7988 in ?? () #14 0x00007ffff7dead65 in call_init (main_map=0x7ffff7ffe128, argc=1, argv=0x7fffffffe318, env=0x7fffffffe328) at dl-init.c:70 #15 _dl_init (main_map=0x7ffff7ffe128, argc=1, argv=0x7fffffffe318, env=0x7fffffffe328) at dl-init.c:134 #16 0x00007ffff7ddcb2a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2 #17 0x0000000000000001 in ?? () #18 0x00007fffffffe5d5 in ?? () #19 0x0000000000000000 in ?? () valgrind output ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7497D: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76E85: malloc (memtrace.c:564) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7495F: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76E85: malloc (memtrace.c:564) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== ==26840== Jump to the invalid address stated on the next line ==26840== at 0x0: ??? ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==26840== ==26840== ==26840== Process terminating with default action of signal 11 (SIGSEGV) ==26840== Bad permissions for mapped region at address 0x0 ==26840== at 0x0: ??? ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7497D: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76EFD: free (memtrace.c:573) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7495F: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76EFD: free (memtrace.c:573) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== ==26840== Jump to the invalid address stated on the next line ==26840== at 0x0: ??? ==26840== by 0x4E76F28: free (memtrace.c:574) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==26840== ==26840== ==26840== Process terminating with default action of signal 11 (SIGSEGV) ==26840== Bad permissions for mapped region at address 0x0 ==26840== at 0x0: ??? ==26840== by 0x4E76F28: free (memtrace.c:574) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) megahall@ubuntu:~$ sudo ldconfig -v | egrep '(:$|libsyslog-ng)' ... /usr/local/lib: libsyslog-ng.so.0 -> libsyslog-ng.so.0.0.0 ... megahall@ubuntu:~$ ldd $(which pdbtool) linux-vdso.so.1 => (0x00007fff087ff000) libsyslog-ng.so.0 => not found libdbparser.so.0 => /usr/local/lib/syslog-ng/libdbparser.so.0 (0x00007fa72604e000) libnsl.so.1 => /lib/libnsl.so.1 (0x00007fa725e33000) libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007fa725c2f000) librt.so.1 => /lib/librt.so.1 (0x00007fa725a27000) libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0x00007fa725748000) libevtlog.so.0 => /usr/lib/libevtlog.so.0 (0x00007fa725543000) libcap.so.2 => /lib/libcap.so.2 (0x00007fa72533e000) libpcre.so.3 => /lib/libpcre.so.3 (0x00007fa72510f000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007fa724ef2000) libc.so.6 => /lib/libc.so.6 (0x00007fa724b6f000) *** libsyslog-ng.so.0 => not found libdl.so.2 => /lib/libdl.so.2 (0x00007fa72496a000) /lib64/ld-linux-x86-64.so.2 (0x00007fa726279000) libattr.so.1 => /lib/libattr.so.1 (0x00007fa724764000) megahall@ubuntu:~$
On Thu, Aug 19, 2010 at 8:44 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
More information. When I compiled it by hand, it cannot find its libraries.
I checked /etc/ld.so.conf.d/ and /usr/local/lib is included as expected for Debian and Ubuntu, and the library exists also.
megahall@ubuntu:~/syslog-ng-3.2alpha2$ sudo find / -iname libsyslog-ng.so.0 -print /home/megahall/syslog-ng-3.2alpha2/src/.libs/libsyslog-ng.so.0 /usr/local/lib/libsyslog-ng.so.0 megahall@ubuntu:~/syslog-ng-3.2alpha2$ pdbtool pdbtool: error while loading shared libraries: libsyslog-ng.so.0: cannot open shared object file: No such file or directory megahall@ubuntu:~/syslog-ng-3.2alpha2$
Enabling these options made no difference:
--enable-shared --enable-dynamic-linking
nm indicates that the library has symbols so it's not corrupt.
file indicates that the arch is valid so it wasn't misbuilt for 32 bit.
/usr/local/lib/libsyslog-ng.so.0.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
Not sure what to try next on this one.
Matthew.
On Thu, Aug 19, 2010 at 06:25:55PM -0700, Matthew Hall wrote:
More information.
Host OS is Kubuntu 10.04 LTS.
Version of libdbi0 is 0.8.2-3.
Builds successfully with --disable-sql added to configure in debian/rules.
However packaging will fail with the following:
dpkg-shlibdeps: error: couldn't find library libsyslog-ng.so.0 needed by debian/syslog-ng/bin/pdbtool (ELF format: 'elf64-x86-64'; RPATH: '//lib://lib/syslog-ng'). Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file. To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH. dh_shlibdeps: dpkg-shlibdeps -Tdebian/syslog-ng.substvars debian/syslog-ng/sbin/syslog-ng debian/syslog-ng/bin/loggen debian/syslog-ng/bin/pdbtool returned exit code 2 make: *** [binary-arch] Error 9
Matthew.
On Thu, Aug 19, 2010 at 06:16:39PM -0700, Matthew Hall wrote:
When building using debian/rules binary on 3.2 alpha 2 my build fails here. Any advice on this one?
Thanks, Matthew.
/bin/bash ../../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c -o libafsql_la-afsql.lo `test -f 'afsql.c' || echo './'`afsql.c libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c afsql.c -fPIC -DPIC -o .libs/libafsql_la-afsql.o afsql.c:120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dbi_instance’ afsql.c: In function ‘afsql_dd_insert_db’: afsql.c:583: warning: implicit declaration of function ‘dbi_conn_new_r’ afsql.c:583: error: ‘dbi_instance’ undeclared (first use in this function) afsql.c:583: error: (Each undeclared identifier is reported only once afsql.c:583: error: for each function it appears in.) afsql.c: In function ‘afsql_dd_init’: afsql.c:1007: warning: implicit declaration of function ‘dbi_initialize_r’ afsql.c:1007: error: ‘dbi_instance’ undeclared (first use in this function)
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
Glad to hear it's mostly working. In a pinch, you can always run the program under gdb (remember to use "set args" on any params after the program name) and then use "bt" to get a somewhat helpful backtrace. It usually is enough to nail down the general area of code that is having an issue. So if your command normally looks like this: "bin/pdbtool test -p var/patterndb.xml" you would run "gdb bin/pdbtool" then "set args test -p var/patterndb.xml" inside gdb and finally "bt" (or whatever) when it segfaults. On Fri, Aug 20, 2010 at 1:21 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
On Thu, Aug 19, 2010 at 08:53:28PM -0500, Martin Holste wrote:
Output of ldd pdbtool and ldconfig -v | grep libsyslog-ng ?
Thanks for offering to help again Martin. Sorry for the delayed reply. I had to leave work before I got your response.
ldd is showing it cannot find the library. Rerunning ldconfig as you suggested appears to fix the library problem, although it does not explain the Debian-style build failure from before. Now that the library links OK, I am seeing a segmentation fault. I recompiled with export CFLAGS='-g' but still not getting much of a backtrace. valgrind output looks better.
I am suspecting the --enable-memtrace build option is responsible based on what I see in the valgrind output. I just recompiled without that option and pdbtool works fine now. Therefore I suspect there is a problem with this option or perhaps I do not understand what it's supposed to do.
Cheers, Matthew.
Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) bt #0 0x0000000000000000 in ?? () #1 0x00007ffff5852573 in z_malloc (size=100, backtrace=0x7fffffffdb80) at memtrace.c:451 #2 0x00007ffff5852eb1 in malloc (size=100) at memtrace.c:565 #3 0x00007ffff41802f9 in _IO_vasprintf (result_ptr=0x7fffffffdfc8, format=0x7fffffffdb80 "\200\335\377\377\377\177", args=0x0) at vasprintf.c:52 #4 0x00007ffff41646f8 in ___asprintf (string_ptr=0x84, format=0x7fffffffdb80 "\200\335\377\377\377\177") at asprintf.c:37 #5 0x00007ffff4140903 in *__GI___assert_fail ( assertion=0x7ffff589311a "temp_brk < 32768", file=<value optimized out>, line=542, function=0x7ffff589312b "z_calloc") at assert.c:63 #6 0x00007ffff5852d79 in z_calloc (nmemb=35340, size=1, backtrace=0x7fffffffe060) at memtrace.c:542 #7 0x00007ffff5853035 in calloc (nmemb=35340, size=1) at memtrace.c:593 #8 0x00007ffff41fd463 in __monstartup (lowpc=<value optimized out>, highpc=<value optimized out>) at gmon.c:136 #9 0x0000000000403121 in __gmon_start__ () #10 0x00007ffff3d0c232 in ?? () from /lib/libattr.so.1 #11 0x00007fffffffe318 in ?? () #12 0x00007ffff3d0c099 in _init () from /lib/libattr.so.1 #13 0x00007ffff7fe7988 in ?? () #14 0x00007ffff7dead65 in call_init (main_map=0x7ffff7ffe128, argc=1, argv=0x7fffffffe318, env=0x7fffffffe328) at dl-init.c:70 #15 _dl_init (main_map=0x7ffff7ffe128, argc=1, argv=0x7fffffffe318, env=0x7fffffffe328) at dl-init.c:134 #16 0x00007ffff7ddcb2a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2 #17 0x0000000000000001 in ?? () #18 0x00007fffffffe5d5 in ?? () #19 0x0000000000000000 in ?? ()
valgrind output
==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7497D: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76E85: malloc (memtrace.c:564) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7495F: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76E85: malloc (memtrace.c:564) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== ==26840== Jump to the invalid address stated on the next line ==26840== at 0x0: ??? ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==26840== ==26840== ==26840== Process terminating with default action of signal 11 (SIGSEGV) ==26840== Bad permissions for mapped region at address 0x0 ==26840== at 0x0: ??? ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7497D: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76EFD: free (memtrace.c:573) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7495F: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76EFD: free (memtrace.c:573) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== ==26840== Jump to the invalid address stated on the next line ==26840== at 0x0: ??? ==26840== by 0x4E76F28: free (memtrace.c:574) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==26840== ==26840== ==26840== Process terminating with default action of signal 11 (SIGSEGV) ==26840== Bad permissions for mapped region at address 0x0 ==26840== at 0x0: ??? ==26840== by 0x4E76F28: free (memtrace.c:574) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136)
megahall@ubuntu:~$ sudo ldconfig -v | egrep '(:$|libsyslog-ng)' ... /usr/local/lib: libsyslog-ng.so.0 -> libsyslog-ng.so.0.0.0 ... megahall@ubuntu:~$ ldd $(which pdbtool) linux-vdso.so.1 => (0x00007fff087ff000) libsyslog-ng.so.0 => not found libdbparser.so.0 => /usr/local/lib/syslog-ng/libdbparser.so.0 (0x00007fa72604e000) libnsl.so.1 => /lib/libnsl.so.1 (0x00007fa725e33000) libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007fa725c2f000) librt.so.1 => /lib/librt.so.1 (0x00007fa725a27000) libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0x00007fa725748000) libevtlog.so.0 => /usr/lib/libevtlog.so.0 (0x00007fa725543000) libcap.so.2 => /lib/libcap.so.2 (0x00007fa72533e000) libpcre.so.3 => /lib/libpcre.so.3 (0x00007fa72510f000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007fa724ef2000) libc.so.6 => /lib/libc.so.6 (0x00007fa724b6f000) *** libsyslog-ng.so.0 => not found libdl.so.2 => /lib/libdl.so.2 (0x00007fa72496a000) /lib64/ld-linux-x86-64.so.2 (0x00007fa726279000) libattr.so.1 => /lib/libattr.so.1 (0x00007fa724764000) megahall@ubuntu:~$
On Thu, Aug 19, 2010 at 8:44 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
More information. When I compiled it by hand, it cannot find its libraries.
I checked /etc/ld.so.conf.d/ and /usr/local/lib is included as expected for Debian and Ubuntu, and the library exists also.
megahall@ubuntu:~/syslog-ng-3.2alpha2$ sudo find / -iname libsyslog-ng.so.0 -print /home/megahall/syslog-ng-3.2alpha2/src/.libs/libsyslog-ng.so.0 /usr/local/lib/libsyslog-ng.so.0 megahall@ubuntu:~/syslog-ng-3.2alpha2$ pdbtool pdbtool: error while loading shared libraries: libsyslog-ng.so.0: cannot open shared object file: No such file or directory megahall@ubuntu:~/syslog-ng-3.2alpha2$
Enabling these options made no difference:
--enable-shared --enable-dynamic-linking
nm indicates that the library has symbols so it's not corrupt.
file indicates that the arch is valid so it wasn't misbuilt for 32 bit.
/usr/local/lib/libsyslog-ng.so.0.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
Not sure what to try next on this one.
Matthew.
On Thu, Aug 19, 2010 at 06:25:55PM -0700, Matthew Hall wrote:
More information.
Host OS is Kubuntu 10.04 LTS.
Version of libdbi0 is 0.8.2-3.
Builds successfully with --disable-sql added to configure in debian/rules.
However packaging will fail with the following:
dpkg-shlibdeps: error: couldn't find library libsyslog-ng.so.0 needed by debian/syslog-ng/bin/pdbtool (ELF format: 'elf64-x86-64'; RPATH: '//lib://lib/syslog-ng'). Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file. To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH. dh_shlibdeps: dpkg-shlibdeps -Tdebian/syslog-ng.substvars debian/syslog-ng/sbin/syslog-ng debian/syslog-ng/bin/loggen debian/syslog-ng/bin/pdbtool returned exit code 2 make: *** [binary-arch] Error 9
Matthew.
On Thu, Aug 19, 2010 at 06:16:39PM -0700, Matthew Hall wrote:
When building using debian/rules binary on 3.2 alpha 2 my build fails here. Any advice on this one?
Thanks, Matthew.
/bin/bash ../../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c -o libafsql_la-afsql.lo `test -f 'afsql.c' || echo './'`afsql.c libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c afsql.c -fPIC -DPIC -o .libs/libafsql_la-afsql.o afsql.c:120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dbi_instance’ afsql.c: In function ‘afsql_dd_insert_db’: afsql.c:583: warning: implicit declaration of function ‘dbi_conn_new_r’ afsql.c:583: error: ‘dbi_instance’ undeclared (first use in this function) afsql.c:583: error: (Each undeclared identifier is reported only once afsql.c:583: error: for each function it appears in.) afsql.c: In function ‘afsql_dd_init’: afsql.c:1007: warning: implicit declaration of function ‘dbi_initialize_r’ afsql.c:1007: error: ‘dbi_instance’ undeclared (first use in this function)
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
Hello Martin, Below I did already attach the GDB backtrace. It just did not contain very much info, either due to memory corruption or a lack of debug symbols in the part of the code with the fault. Therefore I also attached the valgrind backtrace. Hopefully somebody who knows how the --enable-memtrace option works could have a look. Matthew. On Fri, Aug 20, 2010 at 03:26:43PM -0500, Martin Holste wrote:
Glad to hear it's mostly working. In a pinch, you can always run the program under gdb (remember to use "set args" on any params after the program name) and then use "bt" to get a somewhat helpful backtrace. It usually is enough to nail down the general area of code that is having an issue. So if your command normally looks like this: "bin/pdbtool test -p var/patterndb.xml" you would run "gdb bin/pdbtool" then "set args test -p var/patterndb.xml" inside gdb and finally "bt" (or whatever) when it segfaults.
On Fri, Aug 20, 2010 at 1:21 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
On Thu, Aug 19, 2010 at 08:53:28PM -0500, Martin Holste wrote:
Output of ldd pdbtool and ldconfig -v | grep libsyslog-ng ?
Thanks for offering to help again Martin. Sorry for the delayed reply. I had to leave work before I got your response.
ldd is showing it cannot find the library. Rerunning ldconfig as you suggested appears to fix the library problem, although it does not explain the Debian-style build failure from before. Now that the library links OK, I am seeing a segmentation fault. I recompiled with export CFLAGS='-g' but still not getting much of a backtrace. valgrind output looks better.
I am suspecting the --enable-memtrace build option is responsible based on what I see in the valgrind output. I just recompiled without that option and pdbtool works fine now. Therefore I suspect there is a problem with this option or perhaps I do not understand what it's supposed to do.
Cheers, Matthew.
Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) bt #0 0x0000000000000000 in ?? () #1 0x00007ffff5852573 in z_malloc (size=100, backtrace=0x7fffffffdb80) at memtrace.c:451 #2 0x00007ffff5852eb1 in malloc (size=100) at memtrace.c:565 #3 0x00007ffff41802f9 in _IO_vasprintf (result_ptr=0x7fffffffdfc8, format=0x7fffffffdb80 "\200\335\377\377\377\177", args=0x0) at vasprintf.c:52 #4 0x00007ffff41646f8 in ___asprintf (string_ptr=0x84, format=0x7fffffffdb80 "\200\335\377\377\377\177") at asprintf.c:37 #5 0x00007ffff4140903 in *__GI___assert_fail ( assertion=0x7ffff589311a "temp_brk < 32768", file=<value optimized out>, line=542, function=0x7ffff589312b "z_calloc") at assert.c:63 #6 0x00007ffff5852d79 in z_calloc (nmemb=35340, size=1, backtrace=0x7fffffffe060) at memtrace.c:542 #7 0x00007ffff5853035 in calloc (nmemb=35340, size=1) at memtrace.c:593 #8 0x00007ffff41fd463 in __monstartup (lowpc=<value optimized out>, highpc=<value optimized out>) at gmon.c:136 #9 0x0000000000403121 in __gmon_start__ () #10 0x00007ffff3d0c232 in ?? () from /lib/libattr.so.1 #11 0x00007fffffffe318 in ?? () #12 0x00007ffff3d0c099 in _init () from /lib/libattr.so.1 #13 0x00007ffff7fe7988 in ?? () #14 0x00007ffff7dead65 in call_init (main_map=0x7ffff7ffe128, argc=1, argv=0x7fffffffe318, env=0x7fffffffe328) at dl-init.c:70 #15 _dl_init (main_map=0x7ffff7ffe128, argc=1, argv=0x7fffffffe318, env=0x7fffffffe328) at dl-init.c:134 #16 0x00007ffff7ddcb2a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2 #17 0x0000000000000001 in ?? () #18 0x00007fffffffe5d5 in ?? () #19 0x0000000000000000 in ?? ()
valgrind output
==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7497D: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76E85: malloc (memtrace.c:564) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7495F: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76E85: malloc (memtrace.c:564) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== ==26840== Jump to the invalid address stated on the next line ==26840== at 0x0: ??? ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==26840== ==26840== ==26840== Process terminating with default action of signal 11 (SIGSEGV) ==26840== Bad permissions for mapped region at address 0x0 ==26840== at 0x0: ??? ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7497D: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76EFD: free (memtrace.c:573) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7495F: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76EFD: free (memtrace.c:573) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== ==26840== Jump to the invalid address stated on the next line ==26840== at 0x0: ??? ==26840== by 0x4E76F28: free (memtrace.c:574) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==26840== ==26840== ==26840== Process terminating with default action of signal 11 (SIGSEGV) ==26840== Bad permissions for mapped region at address 0x0 ==26840== at 0x0: ??? ==26840== by 0x4E76F28: free (memtrace.c:574) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136)
megahall@ubuntu:~$ sudo ldconfig -v | egrep '(:$|libsyslog-ng)' ... /usr/local/lib: libsyslog-ng.so.0 -> libsyslog-ng.so.0.0.0 ... megahall@ubuntu:~$ ldd $(which pdbtool) linux-vdso.so.1 => (0x00007fff087ff000) libsyslog-ng.so.0 => not found libdbparser.so.0 => /usr/local/lib/syslog-ng/libdbparser.so.0 (0x00007fa72604e000) libnsl.so.1 => /lib/libnsl.so.1 (0x00007fa725e33000) libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007fa725c2f000) librt.so.1 => /lib/librt.so.1 (0x00007fa725a27000) libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0x00007fa725748000) libevtlog.so.0 => /usr/lib/libevtlog.so.0 (0x00007fa725543000) libcap.so.2 => /lib/libcap.so.2 (0x00007fa72533e000) libpcre.so.3 => /lib/libpcre.so.3 (0x00007fa72510f000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007fa724ef2000) libc.so.6 => /lib/libc.so.6 (0x00007fa724b6f000) *** libsyslog-ng.so.0 => not found libdl.so.2 => /lib/libdl.so.2 (0x00007fa72496a000) /lib64/ld-linux-x86-64.so.2 (0x00007fa726279000) libattr.so.1 => /lib/libattr.so.1 (0x00007fa724764000) megahall@ubuntu:~$
On Thu, Aug 19, 2010 at 8:44 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
More information. When I compiled it by hand, it cannot find its libraries.
I checked /etc/ld.so.conf.d/ and /usr/local/lib is included as expected for Debian and Ubuntu, and the library exists also.
megahall@ubuntu:~/syslog-ng-3.2alpha2$ sudo find / -iname libsyslog-ng.so.0 -print /home/megahall/syslog-ng-3.2alpha2/src/.libs/libsyslog-ng.so.0 /usr/local/lib/libsyslog-ng.so.0 megahall@ubuntu:~/syslog-ng-3.2alpha2$ pdbtool pdbtool: error while loading shared libraries: libsyslog-ng.so.0: cannot open shared object file: No such file or directory megahall@ubuntu:~/syslog-ng-3.2alpha2$
Enabling these options made no difference:
--enable-shared --enable-dynamic-linking
nm indicates that the library has symbols so it's not corrupt.
file indicates that the arch is valid so it wasn't misbuilt for 32 bit.
/usr/local/lib/libsyslog-ng.so.0.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
Not sure what to try next on this one.
Matthew.
On Thu, Aug 19, 2010 at 06:25:55PM -0700, Matthew Hall wrote:
More information.
Host OS is Kubuntu 10.04 LTS.
Version of libdbi0 is 0.8.2-3.
Builds successfully with --disable-sql added to configure in debian/rules.
However packaging will fail with the following:
dpkg-shlibdeps: error: couldn't find library libsyslog-ng.so.0 needed by debian/syslog-ng/bin/pdbtool (ELF format: 'elf64-x86-64'; RPATH: '//lib://lib/syslog-ng'). Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file. To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH. dh_shlibdeps: dpkg-shlibdeps -Tdebian/syslog-ng.substvars debian/syslog-ng/sbin/syslog-ng debian/syslog-ng/bin/loggen debian/syslog-ng/bin/pdbtool returned exit code 2 make: *** [binary-arch] Error 9
Matthew.
On Thu, Aug 19, 2010 at 06:16:39PM -0700, Matthew Hall wrote:
When building using debian/rules binary on 3.2 alpha 2 my build fails here. Any advice on this one?
Thanks, Matthew.
/bin/bash ../../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c -o libafsql_la-afsql.lo `test -f 'afsql.c' || echo './'`afsql.c libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c afsql.c -fPIC -DPIC -o .libs/libafsql_la-afsql.o afsql.c:120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dbi_instance’ afsql.c: In function ‘afsql_dd_insert_db’: afsql.c:583: warning: implicit declaration of function ‘dbi_conn_new_r’ afsql.c:583: error: ‘dbi_instance’ undeclared (first use in this function) afsql.c:583: error: (Each undeclared identifier is reported only once afsql.c:583: error: for each function it appears in.) afsql.c: In function ‘afsql_dd_init’: afsql.c:1007: warning: implicit declaration of function ‘dbi_initialize_r’ afsql.c:1007: error: ‘dbi_instance’ undeclared (first use in this function)
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
Ah, oops, guess I didn't read too far! Anyway, hopefully my short gdb explanation helps someone else out. Yes, the problem is definitely in the memtrace functions, as laid out by the valgrind output. There aren't too many calls inside that faulting code block, so it must be a problem as the stack is walked back until backtrace[i] is invalid. It looks to me like you wouldn't want memtrace enabled by default as it would be unnecessary overhead, so if you can get it work without, I'd stick with that. On Fri, Aug 20, 2010 at 4:11 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
Hello Martin,
Below I did already attach the GDB backtrace. It just did not contain very much info, either due to memory corruption or a lack of debug symbols in the part of the code with the fault. Therefore I also attached the valgrind backtrace. Hopefully somebody who knows how the --enable-memtrace option works could have a look.
Matthew.
On Fri, Aug 20, 2010 at 03:26:43PM -0500, Martin Holste wrote:
Glad to hear it's mostly working. In a pinch, you can always run the program under gdb (remember to use "set args" on any params after the program name) and then use "bt" to get a somewhat helpful backtrace. It usually is enough to nail down the general area of code that is having an issue. So if your command normally looks like this: "bin/pdbtool test -p var/patterndb.xml" you would run "gdb bin/pdbtool" then "set args test -p var/patterndb.xml" inside gdb and finally "bt" (or whatever) when it segfaults.
On Fri, Aug 20, 2010 at 1:21 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
On Thu, Aug 19, 2010 at 08:53:28PM -0500, Martin Holste wrote:
Output of ldd pdbtool and ldconfig -v | grep libsyslog-ng ?
Thanks for offering to help again Martin. Sorry for the delayed reply. I had to leave work before I got your response.
ldd is showing it cannot find the library. Rerunning ldconfig as you suggested appears to fix the library problem, although it does not explain the Debian-style build failure from before. Now that the library links OK, I am seeing a segmentation fault. I recompiled with export CFLAGS='-g' but still not getting much of a backtrace. valgrind output looks better.
I am suspecting the --enable-memtrace build option is responsible based on what I see in the valgrind output. I just recompiled without that option and pdbtool works fine now. Therefore I suspect there is a problem with this option or perhaps I do not understand what it's supposed to do.
Cheers, Matthew.
Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) bt #0 0x0000000000000000 in ?? () #1 0x00007ffff5852573 in z_malloc (size=100, backtrace=0x7fffffffdb80) at memtrace.c:451 #2 0x00007ffff5852eb1 in malloc (size=100) at memtrace.c:565 #3 0x00007ffff41802f9 in _IO_vasprintf (result_ptr=0x7fffffffdfc8, format=0x7fffffffdb80 "\200\335\377\377\377\177", args=0x0) at vasprintf.c:52 #4 0x00007ffff41646f8 in ___asprintf (string_ptr=0x84, format=0x7fffffffdb80 "\200\335\377\377\377\177") at asprintf.c:37 #5 0x00007ffff4140903 in *__GI___assert_fail ( assertion=0x7ffff589311a "temp_brk < 32768", file=<value optimized out>, line=542, function=0x7ffff589312b "z_calloc") at assert.c:63 #6 0x00007ffff5852d79 in z_calloc (nmemb=35340, size=1, backtrace=0x7fffffffe060) at memtrace.c:542 #7 0x00007ffff5853035 in calloc (nmemb=35340, size=1) at memtrace.c:593 #8 0x00007ffff41fd463 in __monstartup (lowpc=<value optimized out>, highpc=<value optimized out>) at gmon.c:136 #9 0x0000000000403121 in __gmon_start__ () #10 0x00007ffff3d0c232 in ?? () from /lib/libattr.so.1 #11 0x00007fffffffe318 in ?? () #12 0x00007ffff3d0c099 in _init () from /lib/libattr.so.1 #13 0x00007ffff7fe7988 in ?? () #14 0x00007ffff7dead65 in call_init (main_map=0x7ffff7ffe128, argc=1, argv=0x7fffffffe318, env=0x7fffffffe328) at dl-init.c:70 #15 _dl_init (main_map=0x7ffff7ffe128, argc=1, argv=0x7fffffffe318, env=0x7fffffffe328) at dl-init.c:134 #16 0x00007ffff7ddcb2a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2 #17 0x0000000000000001 in ?? () #18 0x00007fffffffe5d5 in ?? () #19 0x0000000000000000 in ?? ()
valgrind output
==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7497D: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76E85: malloc (memtrace.c:564) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7495F: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76E85: malloc (memtrace.c:564) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== ==26840== Jump to the invalid address stated on the next line ==26840== at 0x0: ??? ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==26840== ==26840== ==26840== Process terminating with default action of signal 11 (SIGSEGV) ==26840== Bad permissions for mapped region at address 0x0 ==26840== at 0x0: ??? ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7497D: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76EFD: free (memtrace.c:573) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7495F: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76EFD: free (memtrace.c:573) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== ==26840== Jump to the invalid address stated on the next line ==26840== at 0x0: ??? ==26840== by 0x4E76F28: free (memtrace.c:574) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==26840== ==26840== ==26840== Process terminating with default action of signal 11 (SIGSEGV) ==26840== Bad permissions for mapped region at address 0x0 ==26840== at 0x0: ??? ==26840== by 0x4E76F28: free (memtrace.c:574) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136)
megahall@ubuntu:~$ sudo ldconfig -v | egrep '(:$|libsyslog-ng)' ... /usr/local/lib: libsyslog-ng.so.0 -> libsyslog-ng.so.0.0.0 ... megahall@ubuntu:~$ ldd $(which pdbtool) linux-vdso.so.1 => (0x00007fff087ff000) libsyslog-ng.so.0 => not found libdbparser.so.0 => /usr/local/lib/syslog-ng/libdbparser.so.0 (0x00007fa72604e000) libnsl.so.1 => /lib/libnsl.so.1 (0x00007fa725e33000) libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007fa725c2f000) librt.so.1 => /lib/librt.so.1 (0x00007fa725a27000) libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0x00007fa725748000) libevtlog.so.0 => /usr/lib/libevtlog.so.0 (0x00007fa725543000) libcap.so.2 => /lib/libcap.so.2 (0x00007fa72533e000) libpcre.so.3 => /lib/libpcre.so.3 (0x00007fa72510f000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007fa724ef2000) libc.so.6 => /lib/libc.so.6 (0x00007fa724b6f000) *** libsyslog-ng.so.0 => not found libdl.so.2 => /lib/libdl.so.2 (0x00007fa72496a000) /lib64/ld-linux-x86-64.so.2 (0x00007fa726279000) libattr.so.1 => /lib/libattr.so.1 (0x00007fa724764000) megahall@ubuntu:~$
On Thu, Aug 19, 2010 at 8:44 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
More information. When I compiled it by hand, it cannot find its libraries.
I checked /etc/ld.so.conf.d/ and /usr/local/lib is included as expected for Debian and Ubuntu, and the library exists also.
megahall@ubuntu:~/syslog-ng-3.2alpha2$ sudo find / -iname libsyslog-ng.so.0 -print /home/megahall/syslog-ng-3.2alpha2/src/.libs/libsyslog-ng.so.0 /usr/local/lib/libsyslog-ng.so.0 megahall@ubuntu:~/syslog-ng-3.2alpha2$ pdbtool pdbtool: error while loading shared libraries: libsyslog-ng.so.0: cannot open shared object file: No such file or directory megahall@ubuntu:~/syslog-ng-3.2alpha2$
Enabling these options made no difference:
--enable-shared --enable-dynamic-linking
nm indicates that the library has symbols so it's not corrupt.
file indicates that the arch is valid so it wasn't misbuilt for 32 bit.
/usr/local/lib/libsyslog-ng.so.0.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
Not sure what to try next on this one.
Matthew.
On Thu, Aug 19, 2010 at 06:25:55PM -0700, Matthew Hall wrote:
More information.
Host OS is Kubuntu 10.04 LTS.
Version of libdbi0 is 0.8.2-3.
Builds successfully with --disable-sql added to configure in debian/rules.
However packaging will fail with the following:
dpkg-shlibdeps: error: couldn't find library libsyslog-ng.so.0 needed by debian/syslog-ng/bin/pdbtool (ELF format: 'elf64-x86-64'; RPATH: '//lib://lib/syslog-ng'). Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file. To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH. dh_shlibdeps: dpkg-shlibdeps -Tdebian/syslog-ng.substvars debian/syslog-ng/sbin/syslog-ng debian/syslog-ng/bin/loggen debian/syslog-ng/bin/pdbtool returned exit code 2 make: *** [binary-arch] Error 9
Matthew.
On Thu, Aug 19, 2010 at 06:16:39PM -0700, Matthew Hall wrote: > When building using debian/rules binary on 3.2 alpha 2 my build fails > here. Any advice on this one? > > Thanks, > Matthew. > > /bin/bash ../../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c -o libafsql_la-afsql.lo `test -f 'afsql.c' || echo './'`afsql.c > libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c afsql.c -fPIC -DPIC -o .libs/libafsql_la-afsql.o > afsql.c:120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dbi_instance’ > afsql.c: In function ‘afsql_dd_insert_db’: > afsql.c:583: warning: implicit declaration of function ‘dbi_conn_new_r’ > afsql.c:583: error: ‘dbi_instance’ undeclared (first use in this function) > afsql.c:583: error: (Each undeclared identifier is reported only once > afsql.c:583: error: for each function it appears in.) > afsql.c: In function ‘afsql_dd_init’: > afsql.c:1007: warning: implicit declaration of function ‘dbi_initialize_r’ > afsql.c:1007: error: ‘dbi_instance’ undeclared (first use in this function) > > ______________________________________________________________________________ > 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 > ______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
On Fri, Aug 20, 2010 at 05:15:05PM -0500, Martin Holste wrote:
Ah, oops, guess I didn't read too far! Anyway, hopefully my short gdb explanation helps someone else out.
Yes, the problem is definitely in the memtrace functions, as laid out by the valgrind output. There aren't too many calls inside that faulting code block, so it must be a problem as the stack is walked back until backtrace[i] is invalid.
Good to know. Hopefully someone can figure it out so the feature won't be broken when it's really needed someday.
It looks to me like you wouldn't want memtrace enabled by default as it would be unnecessary overhead, so if you can get it work without, I'd stick with that.
This build was intentionally non-production to be used to gain the detailed familiarity with the code that I always try to have before I begin deploying something widely. I wanted to enable as much tracing and debugging as I could on it so I could learn how it worked. I have a rule that I never deploy open source code I can't properly understand how to troubleshoot and/or debug if needed. Otherwise I'm flying blind if anything goes wrong. I also believe I have a personal responsibility to properly report problems if I am not capable of fixing them myself. Matthew.
On Fri, Aug 20, 2010 at 4:11 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
Hello Martin,
Below I did already attach the GDB backtrace. It just did not contain very much info, either due to memory corruption or a lack of debug symbols in the part of the code with the fault. Therefore I also attached the valgrind backtrace. Hopefully somebody who knows how the --enable-memtrace option works could have a look.
Matthew.
On Fri, Aug 20, 2010 at 03:26:43PM -0500, Martin Holste wrote:
Glad to hear it's mostly working. In a pinch, you can always run the program under gdb (remember to use "set args" on any params after the program name) and then use "bt" to get a somewhat helpful backtrace. It usually is enough to nail down the general area of code that is having an issue. So if your command normally looks like this: "bin/pdbtool test -p var/patterndb.xml" you would run "gdb bin/pdbtool" then "set args test -p var/patterndb.xml" inside gdb and finally "bt" (or whatever) when it segfaults.
On Fri, Aug 20, 2010 at 1:21 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
On Thu, Aug 19, 2010 at 08:53:28PM -0500, Martin Holste wrote:
Output of ldd pdbtool and ldconfig -v | grep libsyslog-ng ?
Thanks for offering to help again Martin. Sorry for the delayed reply. I had to leave work before I got your response.
ldd is showing it cannot find the library. Rerunning ldconfig as you suggested appears to fix the library problem, although it does not explain the Debian-style build failure from before. Now that the library links OK, I am seeing a segmentation fault. I recompiled with export CFLAGS='-g' but still not getting much of a backtrace. valgrind output looks better.
I am suspecting the --enable-memtrace build option is responsible based on what I see in the valgrind output. I just recompiled without that option and pdbtool works fine now. Therefore I suspect there is a problem with this option or perhaps I do not understand what it's supposed to do.
Cheers, Matthew.
Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) bt #0 0x0000000000000000 in ?? () #1 0x00007ffff5852573 in z_malloc (size=100, backtrace=0x7fffffffdb80) at memtrace.c:451 #2 0x00007ffff5852eb1 in malloc (size=100) at memtrace.c:565 #3 0x00007ffff41802f9 in _IO_vasprintf (result_ptr=0x7fffffffdfc8, format=0x7fffffffdb80 "\200\335\377\377\377\177", args=0x0) at vasprintf.c:52 #4 0x00007ffff41646f8 in ___asprintf (string_ptr=0x84, format=0x7fffffffdb80 "\200\335\377\377\377\177") at asprintf.c:37 #5 0x00007ffff4140903 in *__GI___assert_fail ( assertion=0x7ffff589311a "temp_brk < 32768", file=<value optimized out>, line=542, function=0x7ffff589312b "z_calloc") at assert.c:63 #6 0x00007ffff5852d79 in z_calloc (nmemb=35340, size=1, backtrace=0x7fffffffe060) at memtrace.c:542 #7 0x00007ffff5853035 in calloc (nmemb=35340, size=1) at memtrace.c:593 #8 0x00007ffff41fd463 in __monstartup (lowpc=<value optimized out>, highpc=<value optimized out>) at gmon.c:136 #9 0x0000000000403121 in __gmon_start__ () #10 0x00007ffff3d0c232 in ?? () from /lib/libattr.so.1 #11 0x00007fffffffe318 in ?? () #12 0x00007ffff3d0c099 in _init () from /lib/libattr.so.1 #13 0x00007ffff7fe7988 in ?? () #14 0x00007ffff7dead65 in call_init (main_map=0x7ffff7ffe128, argc=1, argv=0x7fffffffe318, env=0x7fffffffe328) at dl-init.c:70 #15 _dl_init (main_map=0x7ffff7ffe128, argc=1, argv=0x7fffffffe318, env=0x7fffffffe328) at dl-init.c:134 #16 0x00007ffff7ddcb2a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2 #17 0x0000000000000001 in ?? () #18 0x00007fffffffe5d5 in ?? () #19 0x0000000000000000 in ?? ()
valgrind output
==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7497D: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76E85: malloc (memtrace.c:564) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7495F: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76E85: malloc (memtrace.c:564) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== ==26840== Jump to the invalid address stated on the next line ==26840== at 0x0: ??? ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==26840== ==26840== ==26840== Process terminating with default action of signal 11 (SIGSEGV) ==26840== Bad permissions for mapped region at address 0x0 ==26840== at 0x0: ??? ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== by 0x403120: __gmon_start__ (in /usr/local/bin/pdbtool) ==26840== by 0x8CFB231: ??? (in /lib/libattr.so.1.1.0) ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7497D: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76EFD: free (memtrace.c:573) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== ==26840== Conditional jump or move depends on uninitialised value(s) ==26840== at 0x4E7495F: z_mem_trace_bt (memtrace.c:157) ==26840== by 0x4E76EFD: free (memtrace.c:573) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== ==26840== Jump to the invalid address stated on the next line ==26840== at 0x0: ??? ==26840== by 0x4E76F28: free (memtrace.c:574) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136) ==26840== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==26840== ==26840== ==26840== Process terminating with default action of signal 11 (SIGSEGV) ==26840== Bad permissions for mapped region at address 0x0 ==26840== at 0x0: ??? ==26840== by 0x4E76F28: free (memtrace.c:574) ==26840== by 0x88A5241: ??? (in /lib/libc-2.11.1.so) ==26840== by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62) ==26840== by 0x4E76572: z_malloc (memtrace.c:451) ==26840== by 0x4E76EB0: malloc (memtrace.c:565) ==26840== by 0x87DF2F8: vasprintf (vasprintf.c:52) ==26840== by 0x87C36F7: asprintf (asprintf.c:37) ==26840== by 0x879F902: __assert_fail (assert.c:63) ==26840== by 0x4E76D78: z_calloc (memtrace.c:542) ==26840== by 0x4E77034: calloc (memtrace.c:593) ==26840== by 0x885C462: monstartup (gmon.c:136)
megahall@ubuntu:~$ sudo ldconfig -v | egrep '(:$|libsyslog-ng)' ... /usr/local/lib: libsyslog-ng.so.0 -> libsyslog-ng.so.0.0.0 ... megahall@ubuntu:~$ ldd $(which pdbtool) linux-vdso.so.1 => (0x00007fff087ff000) libsyslog-ng.so.0 => not found libdbparser.so.0 => /usr/local/lib/syslog-ng/libdbparser.so.0 (0x00007fa72604e000) libnsl.so.1 => /lib/libnsl.so.1 (0x00007fa725e33000) libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007fa725c2f000) librt.so.1 => /lib/librt.so.1 (0x00007fa725a27000) libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0x00007fa725748000) libevtlog.so.0 => /usr/lib/libevtlog.so.0 (0x00007fa725543000) libcap.so.2 => /lib/libcap.so.2 (0x00007fa72533e000) libpcre.so.3 => /lib/libpcre.so.3 (0x00007fa72510f000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007fa724ef2000) libc.so.6 => /lib/libc.so.6 (0x00007fa724b6f000) *** libsyslog-ng.so.0 => not found libdl.so.2 => /lib/libdl.so.2 (0x00007fa72496a000) /lib64/ld-linux-x86-64.so.2 (0x00007fa726279000) libattr.so.1 => /lib/libattr.so.1 (0x00007fa724764000) megahall@ubuntu:~$
On Thu, Aug 19, 2010 at 8:44 PM, Matthew Hall <mhall@mhcomputing.net> wrote:
More information. When I compiled it by hand, it cannot find its libraries.
I checked /etc/ld.so.conf.d/ and /usr/local/lib is included as expected for Debian and Ubuntu, and the library exists also.
megahall@ubuntu:~/syslog-ng-3.2alpha2$ sudo find / -iname libsyslog-ng.so.0 -print /home/megahall/syslog-ng-3.2alpha2/src/.libs/libsyslog-ng.so.0 /usr/local/lib/libsyslog-ng.so.0 megahall@ubuntu:~/syslog-ng-3.2alpha2$ pdbtool pdbtool: error while loading shared libraries: libsyslog-ng.so.0: cannot open shared object file: No such file or directory megahall@ubuntu:~/syslog-ng-3.2alpha2$
Enabling these options made no difference:
--enable-shared --enable-dynamic-linking
nm indicates that the library has symbols so it's not corrupt.
file indicates that the arch is valid so it wasn't misbuilt for 32 bit.
/usr/local/lib/libsyslog-ng.so.0.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
Not sure what to try next on this one.
Matthew.
On Thu, Aug 19, 2010 at 06:25:55PM -0700, Matthew Hall wrote: > More information. > > Host OS is Kubuntu 10.04 LTS. > > Version of libdbi0 is 0.8.2-3. > > Builds successfully with --disable-sql added to configure in debian/rules. > > However packaging will fail with the following: > > dpkg-shlibdeps: error: couldn't find library libsyslog-ng.so.0 needed by debian/syslog-ng/bin/pdbtool (ELF format: 'elf64-x86-64'; RPATH: '//lib://lib/syslog-ng'). > Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file. > To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH. > dh_shlibdeps: dpkg-shlibdeps -Tdebian/syslog-ng.substvars debian/syslog-ng/sbin/syslog-ng debian/syslog-ng/bin/loggen debian/syslog-ng/bin/pdbtool returned exit code 2 > make: *** [binary-arch] Error 9 > > Matthew. > > On Thu, Aug 19, 2010 at 06:16:39PM -0700, Matthew Hall wrote: > > When building using debian/rules binary on 3.2 alpha 2 my build fails > > here. Any advice on this one? > > > > Thanks, > > Matthew. > > > > /bin/bash ../../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c -o libafsql_la-afsql.lo `test -f 'afsql.c' || echo './'`afsql.c > > libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c afsql.c -fPIC -DPIC -o .libs/libafsql_la-afsql.o > > afsql.c:120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dbi_instance’ > > afsql.c: In function ‘afsql_dd_insert_db’: > > afsql.c:583: warning: implicit declaration of function ‘dbi_conn_new_r’ > > afsql.c:583: error: ‘dbi_instance’ undeclared (first use in this function) > > afsql.c:583: error: (Each undeclared identifier is reported only once > > afsql.c:583: error: for each function it appears in.) > > afsql.c: In function ‘afsql_dd_init’: > > afsql.c:1007: warning: implicit declaration of function ‘dbi_initialize_r’ > > afsql.c:1007: error: ‘dbi_instance’ undeclared (first use in this function) > > > > ______________________________________________________________________________ > > 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 > > > ______________________________________________________________________________ > 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 > ______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
______________________________________________________________________________ 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
On Fri, 2010-08-20 at 15:32 -0700, Matthew Hall wrote:
On Fri, Aug 20, 2010 at 05:15:05PM -0500, Martin Holste wrote:
Ah, oops, guess I didn't read too far! Anyway, hopefully my short gdb explanation helps someone else out.
Yes, the problem is definitely in the memtrace functions, as laid out by the valgrind output. There aren't too many calls inside that faulting code block, so it must be a problem as the stack is walked back until backtrace[i] is invalid.
Good to know. Hopefully someone can figure it out so the feature won't be broken when it's really needed someday.
memtrace is a developer's function. I use it rarely and noone except developers would need it. since I rarely use it, it sometimes bitrots and doesn't work. I know this could be better, but it is not enabled by default :)
It looks to me like you wouldn't want memtrace enabled by default as it would be unnecessary overhead, so if you can get it work without, I'd stick with that.
This build was intentionally non-production to be used to gain the detailed familiarity with the code that I always try to have before I begin deploying something widely. I wanted to enable as much tracing and debugging as I could on it so I could learn how it worked.
I have a rule that I never deploy open source code I can't properly understand how to troubleshoot and/or debug if needed. Otherwise I'm flying blind if anything goes wrong. I also believe I have a personal responsibility to properly report problems if I am not capable of fixing them myself.
--enable-debug should be what you are looking for. -- Bazsi
On Fri, 2010-08-20 at 15:26 -0500, Martin Holste wrote:
Glad to hear it's mostly working. In a pinch, you can always run the program under gdb (remember to use "set args" on any params after the program name) and then use "bt" to get a somewhat helpful backtrace. It usually is enough to nail down the general area of code that is having an issue. So if your command normally looks like this: "bin/pdbtool test -p var/patterndb.xml" you would run "gdb bin/pdbtool" then "set args test -p var/patterndb.xml" inside gdb and finally "bt" (or whatever) when it segfaults.
you can always use gdb --args pdbtool test -p var/patterndb.xml this is the same as using an explicit set args command. -- Bazsi
On Thu, 2010-08-19 at 18:16 -0700, Matthew Hall wrote:
When building using debian/rules binary on 3.2 alpha 2 my build fails here. Any advice on this one?
Thanks, Matthew.
/bin/bash ../../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c -o libafsql_la-afsql.lo `test -f 'afsql.c' || echo './'`afsql.c libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c afsql.c -fPIC -DPIC -o .libs/libafsql_la-afsql.o afsql.c:120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dbi_instance’ afsql.c: In function ‘afsql_dd_insert_db’: afsql.c:583: warning: implicit declaration of function ‘dbi_conn_new_r’ afsql.c:583: error: ‘dbi_instance’ undeclared (first use in this function) afsql.c:583: error: (Each undeclared identifier is reported only once afsql.c:583: error: for each function it appears in.) afsql.c: In function ‘afsql_dd_init’: afsql.c:1007: warning: implicit declaration of function ‘dbi_initialize_r’ afsql.c:1007: error: ‘dbi_instance’ undeclared (first use in this function)
This is caused by a too old libdbi. Either disable sql support, or upgrade libdbi. -- Bazsi
Bazsi, what version of libdbi should work? I just downloaded the very latest version (0.8.4) and I get the same errors Matthew does. -Patrick Sent: Giovedì 2 Settembre 2010 9.28.43 From: Balazs Scheidler <bazsi@balabit.hu> To: Syslog-ng users' and developers' mailing list <syslog-ng@lists.balabit.hu> Subject: Re: [syslog-ng] 3.2 alpha 2 build error
On Thu, 2010-08-19 at 18:16 -0700, Matthew Hall wrote:
When building using debian/rules binary on 3.2 alpha 2 my build fails here. Any advice on this one?
Thanks, Matthew.
/bin/bash ../../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c -o libafsql_la-afsql.lo `test -f 'afsql.c' || echo './'`afsql.c libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c afsql.c -fPIC -DPIC -o .libs/libafsql_la-afsql.o afsql.c:120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dbi_instance’ afsql.c: In function ‘afsql_dd_insert_db’: afsql.c:583: warning: implicit declaration of function ‘dbi_conn_new_r’ afsql.c:583: error: ‘dbi_instance’ undeclared (first use in this function) afsql.c:583: error: (Each undeclared identifier is reported only once afsql.c:583: error: for each function it appears in.) afsql.c: In function ‘afsql_dd_init’: afsql.c:1007: warning: implicit declaration of function ‘dbi_initialize_r’ afsql.c:1007: error: ‘dbi_instance’ undeclared (first use in this function)
This is caused by a too old libdbi. Either disable sql support, or upgrade libdbi.
Nevermind, kinda. It looks like balabit keeps its own modified version of the libdbi code. In this case, I think that code should be packaged with syslog-ng as its really not libdbi anymore, but a fork. At the least it should have its own name and release package (the only place I could find it was git). Also I have a problem with the balabit libdbi-drivers as well. There was a patch floating around the internet for the oracle drivers which performs a commit on every insert, and it appears the balabit code has this patch applied (OCI_COMMIT_ON_SUCCESS, line 306 of dbd_oracle.c). Forcing users of the to commit on every insert is a really bad practice as it seriously degrades database performance. -Patrick Sent: Martedì 7 Settembre 2010 11.29.40 From: syslogng@feystorm.net To: Syslog-ng users' and developers' mailing list <syslog-ng@lists.balabit.hu> Subject: Re: [syslog-ng] 3.2 alpha 2 build error
Bazsi, what version of libdbi should work? I just downloaded the very latest version (0.8.4) and I get the same errors Matthew does.
-Patrick
Sent: Giovedì 2 Settembre 2010 9.28.43 From: Balazs Scheidler <bazsi@balabit.hu> To: Syslog-ng users' and developers' mailing list <syslog-ng@lists.balabit.hu> Subject: Re: [syslog-ng] 3.2 alpha 2 build error
On Thu, 2010-08-19 at 18:16 -0700, Matthew Hall wrote:
When building using debian/rules binary on 3.2 alpha 2 my build fails here. Any advice on this one?
Thanks, Matthew.
/bin/bash ../../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c -o libafsql_la-afsql.lo `test -f 'afsql.c' || echo './'`afsql.c libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src -I.. -DENABLE_SQL=1 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/eventlog -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -MT libafsql_la-afsql.lo -MD -MP -MF .deps/libafsql_la-afsql.Tpo -c afsql.c -fPIC -DPIC -o .libs/libafsql_la-afsql.o afsql.c:120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dbi_instance’ afsql.c: In function ‘afsql_dd_insert_db’: afsql.c:583: warning: implicit declaration of function ‘dbi_conn_new_r’ afsql.c:583: error: ‘dbi_instance’ undeclared (first use in this function) afsql.c:583: error: (Each undeclared identifier is reported only once afsql.c:583: error: for each function it appears in.) afsql.c: In function ‘afsql_dd_init’: afsql.c:1007: warning: implicit declaration of function ‘dbi_initialize_r’ afsql.c:1007: error: ‘dbi_instance’ undeclared (first use in this function)
This is caused by a too old libdbi. Either disable sql support, or upgrade libdbi.
------------------------------------------------------------------------
______________________________________________________________________________ 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
On Tue, 2010-09-07 at 12:53 -0600, syslogng@feystorm.net wrote:
Nevermind, kinda. It looks like balabit keeps its own modified version of the libdbi code. In this case, I think that code should be packaged with syslog-ng as its really not libdbi anymore, but a fork. At the least it should have its own name and release package (the only place I could find it was git).
well, that was the case earlier, but I worked quite hard to integrate those patches into libdbi upstream. The patches are already in their CVS repo, but there's no released version as of yet. We've published our internal git tree just for a reference and because of our obligations to the GPL. We don't want to maintain a fork.
Also I have a problem with the balabit libdbi-drivers as well. There was a patch floating around the internet for the oracle drivers which performs a commit on every insert, and it appears the balabit code has this patch applied (OCI_COMMIT_ON_SUCCESS, line 306 of dbd_oracle.c). Forcing users of the to commit on every insert is a really bad practice as it seriously degrades database performance.
It used to be needed before 3.2 (and is default behaviour for all other databases if you don't emit a begin transaction command). So for 3.1 and earlier (and 3.2 if explicit-commits is not enabled) the OCI_COMMIT_ON_SUCCESS seemed to be needed. -- Bazsi
participants (4)
-
Balazs Scheidler
-
Martin Holste
-
Matthew Hall
-
syslogng@feystorm.net