home *** CD-ROM | disk | FTP | other *** search
/ ftp.parl.clemson.edu / 2015-02-07.ftp.parl.clemson.edu.tar / ftp.parl.clemson.edu / pub / pvfs2 / orangefs-2.8.3-20110323.tar.gz / orangefs-2.8.3-20110323.tar / orangefs / doc / coding / backtrace_analysis.txt next >
Text File  |  2003-12-19  |  2KB  |  67 lines

  1. # Notes on understanding the backtraces generated by PVFS2
  2. #
  3. # Dec 19, 2003
  4.  
  5. PVFS2 is capable of generating backtrace information at runtime on systems
  6. that use glibc.  This is sometimes useful in tracking down bugs that
  7. are difficult to reproduce in a debugger.  This backtrace information
  8. may appear in a log file or on stderr, depending on what part of the
  9. file system generated the error and how your error logs are configured.
  10.  
  11. The backtraces can be triggered by one of two events:
  12. - the gossip_lerr() error message function in PVFS2 (generally used for
  13.   unexpected internal erorr paths)
  14. - a segmentation fault, if --enable-segv-backtrace was enabled at configure
  15.   time
  16.  
  17. Backtraces take on the following general form:
  18.  
  19.     <error message>
  20.     [bt] <component> (<function name>+<offset>) [<memory address>]
  21.     ...
  22.     [bt] <component> (<function name>+<offset>) [<memory address>]
  23.  
  24. The stack may be up to 8 levels deep, with the most recent level on top.
  25. Here is an example of a backtrace generated by manually sending a segmentation
  26. fault signal to a running server:
  27.  
  28.     PVFS2 server: signal 11, faulty address is 0x42fa, from 0x400c8a46
  29.     [bt] /lib/libpthread.so.0(nanosleep+0x46) [0x400c8a46]
  30.     [bt] /lib/libc.so.6 [0x40148db0]
  31.     [bt] /lib/libpthread.so.0 [0x400c1ec9]
  32.     [bt] ./pvfs2-server(job_testcontext+0x169) [0x8060d73]
  33.     [bt] ./pvfs2-server(main+0x38d) [0x80502de]
  34.     [bt] /lib/libc.so.6(__libc_start_main+0xc7) [0x401357a7]
  35.     [bt] ./pvfs2-server(read+0x65) [0x804fd81]
  36.  
  37. The memory addresses can be translated into more specific code file and line
  38. numbers after the fact using the "addr2line" utility.  For example:
  39.  
  40. addr2line -e pvfs2-server 0x8060d73
  41. src/io/job/job.c:3310
  42.  
  43. This tells us that the server received the segfault signal while executing
  44. line 3310 of job.c, which is a pthread_cond_timedwait() call.  You can do the
  45. same for any address in the dump that corresponds to PVFS2 code.
  46.  
  47. Thats it!
  48.  
  49. -----
  50.  
  51. An alternative approach is to use gdb:
  52.  
  53. 1) load the offending executable into gdb (do not run it)
  54. 2) set listsize 1
  55. 3) list * <memory address>
  56. 4) repeat step 3) for any other addresses you wish to inspect
  57.  
  58. src/server> gdb pvfs2-server
  59. GNU gdb 5.3
  60. ...
  61. (gdb) set listsize 1
  62. (gdb) list * 0x8060d73
  63. 0x8060d73 is in job_testcontext (src/io/job/job.c:3310).
  64. 3310            ret = pthread_cond_timedwait(&completion_cond, 
  65. (gdb)
  66.  
  67.