wiki:trunk/troubleshooting/StackTrace

How to create a stacktrace/backtrace if a core was seen

Run GDB approach

Run your synchronization commandline (e.g. osynctool --sync testgroup) with gdb like this:

$ gdb --args osynctool --sync testgroup

In gdb you have to start the process by issuing the command run:

(gdb) run
....

Once you hit the segfault/abort you can list the stacktrace/backtrace by running:

(gdb) where
....

Corefile approach

This is an example which was seen while with searching around with ticket 926/927

In some distributions you need to set ulimit -c unlimited to get a core file. On Solaris 10 and up please refer to man coreadm.

$ osynctool --sync e71-file
ERROR: Unable to open module /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: undefined symbol: osync_xml_node_get_content
EXIT_ERROR: osync_module_load: Unable to open module /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: undefined symbol: osync_xml_node_get_content
EXIT_ERROR: osync_module_load: Unable to open module /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: undefined symbol: osync_xml_node_get_content
EXIT_ERROR: osync_module_get_conversion_info: Unable to open module /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: undefined symbol: osync_xml_node_get_content
ERROR: Unable to find xmlformat-contact format
EXIT_ERROR: osync_module_get_conversion_info: Unable to find xmlformat-contact format
ERROR: Unable to find object format xmlformat-contact
EXIT_ERROR: osync_module_get_conversion_info: (null)
Synchronizing group "e71-file"
The previous synchronization was unclean. Slow-syncing
ERROR: Unable to open module /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: undefined symbol: osync_xml_node_get_content
EXIT_ERROR: osync_module_load: Unable to open module /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: undefined symbol: osync_xml_node_get_content
EXIT_ERROR: osync_module_load: Unable to open module /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: undefined symbol: osync_xml_node_get_content
EXIT_ERROR: osync_module_get_conversion_info: Unable to open module /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: /opt/opensync/build/lib/libopensync1/formats/xmlformat.so: undefined symbol: osync_xml_node_get_content
ERROR: Unable to find xmlformat-contact format
EXIT_ERROR: osync_module_get_conversion_info: Unable to find xmlformat-contact format
ERROR: Unable to find object format xmlformat-contact
EXIT_ERROR: osync_module_get_conversion_info: (null)
/opt/opensync/opensync/opensync/format/opensync_objformat.c:100:E:osync_objformat_get_name: Assertion "format" failed
Aborted (core dumped)

$file core
core: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style, from 'osynctool --sync e71-file'

Now, how to get the stacktrace out of the core and the application.

$ gdb build/bin/osynctool core
GNU gdb 6.7.1-debian
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
Using host libthread_db library "/lib/i686/cmov/libthread_db.so.1".

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /opt/opensync/build/lib/libopensync.so.1...done.
Loaded symbols for /opt/opensync/build/lib/libopensync.so.1
Reading symbols from /usr/lib/libglib-2.0.so.0...done.
Loaded symbols for /usr/lib/libglib-2.0.so.0
Reading symbols from /lib/i686/cmov/libc.so.6...done.
Loaded symbols for /lib/i686/cmov/libc.so.6
Reading symbols from /usr/lib/libgthread-2.0.so.0...done.
Loaded symbols for /usr/lib/libgthread-2.0.so.0
Reading symbols from /lib/i686/cmov/librt.so.1...done.
Loaded symbols for /lib/i686/cmov/librt.so.1
Reading symbols from /usr/lib/libgmodule-2.0.so.0...done.
Loaded symbols for /usr/lib/libgmodule-2.0.so.0
Reading symbols from /lib/i686/cmov/libdl.so.2...done.
Loaded symbols for /lib/i686/cmov/libdl.so.2
Reading symbols from /usr/lib/libxml2.so.2...done.
Loaded symbols for /usr/lib/libxml2.so.2
Reading symbols from /usr/lib/libxslt.so.1...done.
Loaded symbols for /usr/lib/libxslt.so.1
Reading symbols from /usr/lib/libexslt.so.0...done.
Loaded symbols for /usr/lib/libexslt.so.0
Reading symbols from /usr/lib/libsqlite3.so.0...done.
Loaded symbols for /usr/lib/libsqlite3.so.0
Reading symbols from /usr/lib/libpcre.so.3...done.
Loaded symbols for /usr/lib/libpcre.so.3
Reading symbols from /lib/libselinux.so.1...done.
Loaded symbols for /lib/libselinux.so.1
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/i686/cmov/libpthread.so.0...done.
Loaded symbols for /lib/i686/cmov/libpthread.so.0
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /lib/i686/cmov/libm.so.6...done.
Loaded symbols for /lib/i686/cmov/libm.so.6
Reading symbols from /usr/lib/libgcrypt.so.11...done.
Loaded symbols for /usr/lib/libgcrypt.so.11
Reading symbols from /usr/lib/libgpg-error.so.0...done.
Loaded symbols for /usr/lib/libgpg-error.so.0
Reading symbols from /opt/opensync/build/lib/libopensync1/formats/file.so...done.
Loaded symbols for /opt/opensync/build/lib/libopensync1/formats/file.so
Reading symbols from /opt/opensync/build/lib/libopensync1/formats/plain.so...done.
Loaded symbols for /opt/opensync/build/lib/libopensync1/formats/plain.so
Reading symbols from /opt/opensync/build/lib/libopensync1/formats/format_plugin.so...done.
Loaded symbols for /opt/opensync/build/lib/libopensync1/formats/format_plugin.so
Reading symbols from /opt/opensync/build/lib/libopensync1/formats/vformat-xmlformat.so...done.
Loaded symbols for /opt/opensync/build/lib/libopensync1/formats/vformat-xmlformat.so
Reading symbols from /opt/opensync/build/lib/libopensync1/formats/vcard.so...done.
Loaded symbols for /opt/opensync/build/lib/libopensync1/formats/vcard.so
Reading symbols from /opt/opensync/build/lib/libopensync1/formats/vevent.so...done.
Loaded symbols for /opt/opensync/build/lib/libopensync1/formats/vevent.so
Reading symbols from /opt/opensync/build/lib/libopensync1/formats/vtodo.so...done.
Loaded symbols for /opt/opensync/build/lib/libopensync1/formats/vtodo.so
Reading symbols from /opt/opensync/build/lib/libopensync1/formats/vjournal.so...done.
Loaded symbols for /opt/opensync/build/lib/libopensync1/formats/vjournal.so
Reading symbols from /opt/opensync/build/lib/libopensync1/formats/vnote.so...done.
Loaded symbols for /opt/opensync/build/lib/libopensync1/formats/vnote.so
Reading symbols from /opt/opensync/build/lib/libopensync1/plugins/example_plugin.so...done.
Loaded symbols for /opt/opensync/build/lib/libopensync1/plugins/example_plugin.so
Reading symbols from /opt/opensync/build/lib/libopensync1/plugins/file-sync.so...done.
Loaded symbols for /opt/opensync/build/lib/libopensync1/plugins/file-sync.so
Reading symbols from /opt/opensync/build/lib/libopensync1/plugins/syncml-plugin.so...done.
Loaded symbols for /opt/opensync/build/lib/libopensync1/plugins/syncml-plugin.so
Reading symbols from /opt/opensync/build/lib/libsyncml.so.2...done.
Loaded symbols for /opt/opensync/build/lib/libsyncml.so.2
Reading symbols from /usr/lib/libgobject-2.0.so.0...done.
Loaded symbols for /usr/lib/libgobject-2.0.so.0
Reading symbols from /usr/lib/libbluetooth.so.1...done.
Loaded symbols for /usr/lib/libbluetooth.so.1
Reading symbols from /usr/lib/libwbxml2.so.0...done.
Loaded symbols for /usr/lib/libwbxml2.so.0
Reading symbols from /usr/local/lib/libsoup-2.4.so.1...done.
Loaded symbols for /usr/local/lib/libsoup-2.4.so.1
Reading symbols from /usr/lib/libgio-2.0.so.0...done.
Loaded symbols for /usr/lib/libgio-2.0.so.0
Reading symbols from /usr/lib/libopenobex.so.1...done.
Loaded symbols for /usr/lib/libopenobex.so.1
Reading symbols from /usr/lib/libexpat.so.1...done.
Loaded symbols for /usr/lib/libexpat.so.1
Reading symbols from /lib/libpopt.so.0...done.
Loaded symbols for /lib/libpopt.so.0
Reading symbols from /lib/i686/cmov/libnsl.so.1...done.
Loaded symbols for /lib/i686/cmov/libnsl.so.1
Reading symbols from /usr/lib/libusb-0.1.so.4...done.
Loaded symbols for /usr/lib/libusb-0.1.so.4
Core was generated by `osynctool --sync e71-file'.
Program terminated with signal 6, Aborted.
#0  0xb7f1c424 in __kernel_vsyscall ()
(gdb) where
#0  0xb7f1c424 in __kernel_vsyscall ()
#1  0xb7cbcef5 in raise () from /lib/i686/cmov/libc.so.6
#2  0xb7cbe871 in abort () from /lib/i686/cmov/libc.so.6
#3  0xb7ee371d in osync_objformat_get_name (format=0x0) at /opt/opensync/opensync/opensync/format/opensync_objformat.c:100
#4  0xb7ed5cc9 in _osync_engine_set_internal_format (engine=0x0, objtype=0x6 <Address 0x6 out of bounds>, format=0x239d)
    at /opt/opensync/opensync/opensync/engine/opensync_engine.c:163
#5  0xb7ed82fa in osync_engine_initialize (engine=0x9b5ed50, error=0xbf835884) at /opt/opensync/opensync/opensync/engine/opensync_engine.c:1152
#6  0x0804c98a in main (argc=3, argv=0xbf835934) at /opt/opensync/msynctool/tools/osynctool.c:473

Information you should provide with openeing a bug, sending a mail to opensync-devel or using  http://pastebin.com:

  • osynctool --version
  • the output from gdb, at least the part after the where
  • please install -debuginfo packages of OpenSync? for this. If you build OpenSync? from source - please buid with CMAKE_BUILD_TYPE=Debug or some other buildtype which enables debuginfo generation. (Traces should have filenames and linenumbers and parameter list)