Changes between Version 11 and Version 12 of AndreesStuff


Ignore:
Timestamp:
Sep 26, 2006, 2:21:06 PM (13 years ago)
Author:
andree
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AndreesStuff

    v11 v12  
    164164== General ==
    165165
    166 Backtraces can be very useful to trouble-shoot issues like segmentation faults. To create a useful backtrace, you need gdb (the GNU Debugger) installed and an application (and possibly libraries) with debugging symbols built in. The following will explain how to do this.
     166Backtraces can be very helpful when trouble-shooting issues like segmentation faults. To create a useful backtrace, you need gdb (the GNU Debugger) installed and an application (and possibly libraries) with debugging symbols built in. The following will explain how to do this.
    167167
    168168== gdb ==
     
    171171
    172172{{{
    173 apt-get gdb
     173apt-get install gdb
    174174}}}
    175175
     
    185185== mondoarchive/mondorescue with debugging symbols ==
    186186
    187 To get mondoarchive and mondorescue with debugging symbols built in, you need to build from the source.
    188 
    189 Get the latest stable mondo source package from ftp://ftp.mondorescue.org/src/, e.g. mondo-2.0.9.tar.gz, unpack:
     187To get '''mondoarchive''' and '''mondorescue''' with debugging symbols built in, you need to build from the source.
     188
     189Get the latest stable mondo source package from '''ftp://ftp.mondorescue.org/src/''', e.g. '''mondo-2.0.9.tar.gz''', unpack:
    190190
    191191{{{
     
    197197{{{
    198198cd mondo-2.0.9
     199./configure --prefix=/usr
    199200make
    200201}}}
     
    202203You will end up with binary in the following locations which are non-stripped, i.e. they contain debugging symbols:
    203204{{{
    204 file
     205file mondo/mondoarchive/mondoarchive
     206mondo/mondoarchive/mondoarchive: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped
    205207}}}
    206208
     
    208210
    209211{{{
    210 file
    211 }}}
    212 
    213 Make backups of the original mondoarchive and mondorestore binaries and copy they newly created over the original ones.
    214 
    215 == mondoarchive ==
    216 
    217 == mondorestore ==
    218 
     212file mondo/mondorestore/mondorestore
     213mondo/mondorestore/mondorestore: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped
     214}}}
     215
     216Make backups of the original '''mondoarchive''' and '''mondorestore''' binaries and copy they newly created over the original ones.
     217
     218== Trouble-Shooting mondoarchive ==
     219
     220The best approach is to run the '''mondoarchive''' binary you just created with debugging symbols built in from its location in the built directory under gdb. So:
     221
     222{{{
     223cd mondo/mondoarchive
     224gdb ./mondoarchive
     225run <usual arguments you use>
     226}}}
     227
     228When the segmentation fault happens, enter:
     229
     230{{{
     231bt
     232}}}
     233
     234and send the output to the list.
     235
     236== Trouble-Shooting mondorestore ==
     237
     238If you do partial restore onto a live system, the same approach as described for '''mondoarchive''' can be used.
     239
     240However, more likely you will experience a segmentation fault during restore. To run a backtrace in that situation proceeed as follows:
     241
     242First, you need a '''mondorestore''' binary with debugging symbols. This should already been taken care of if you copied the newly compiled binaries as described above. Next, you need to make sure that gdb is available on your restore media. To achieve this, add gdb to '''/etc/mindi/deplist.txt''' before doing a mondoarchive run.
     243
     244Boot the restore media into '''expert''' mode. Then start '''mondoarchive''' like this:
     245
     246{{{
     247gdb /usr/sbin/mondorestore
     248run
     249}}}
     250
     251As described previously, once the segmentation fault happens, do:
     252
     253{{{
     254bt
     255}}}
     256
     257and send the output to the list. (If you can't get the backtrace copied as text, you can use a photo of the screen as the last resort.
     258
     259== Advanced Topics ==
     260
     261= Attaching to Running Processes =
     262
     263You can attach to a running process using:
     264
     265{{{
     266attach <pid>
     267}}}
     268
     269where <pid> is the process ID.
     270
     271This can be particulary useful when running '''mondoarchive''' with the '-g' or when running '''mondorestore'''.
     272
     273= Using libraries with debugging symbols =
     274
     275The libraries used by a binary can be determined using the ldd command, e.g.:
     276
     277{{{
     278ldd /usr/sbin/mondoarchive
     279                libmondo.so.2 => /usr/lib/libmondo.so.2 (0xb7f8d000)
     280        libmondo-newt.so.1 => /usr/lib/libmondo-newt.so.1 (0xb7f82000)
     281        libnewt.so.0.51 => /usr/lib/libnewt.so.0.51 (0xb7f71000)
     282        libdl.so.2 => /lib/tls/libdl.so.2 (0xb7f6e000)
     283        libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7f5f000)
     284        libc.so.6 => /lib/tls/libc.so.6 (0xb7e2a000)
     285        libslang.so.1-UTF8 => /lib/libslang.so.1-UTF8 (0xb7db7000)
     286        libm.so.6 => /lib/tls/libm.so.6 (0xb7d94000)
     287        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7fea000)
     288}}}
     289
     290some of those libraries may come with debugging symbols built in as an alternative package, others can be buiolt from scratch and installed with debugging sysmbols installed. Using your distribtuion's standard built process is probably a good idea for this.