Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-6667

Adapt etc/gdb-backtrace.sh for lldb

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 5.34/00
    • Fix Version/s: 6.08/00
    • Component/s: None
    • Labels:
      None
    • Environment:

      Mac OS X 10.9

    • Development:

      Description

      The gdb-backtrace.sh script has to be adapted for use with lldb.

      With gdb ROOT produces a nice stack trace that also includes stack elements from used shared libraries and scripts. With lldb this is not the case.

      Reproducible example:

      • compile the attached lib.C (which has an obvious null pointer access) into a shared library via

      $ g++ -g `root-config --cflags` `root-config --libs` --shared -o libtest.dylib lib.C

      • execute the attached test.C macro which uses the library:

      root [0] gSytstem->Load("libtest.dylib");
      root [1] .x test.C+

      With gdb the stack trace shows the segmentation violation in the library:

      *** Break *** segmentation violation
      (..)
      #4  <signal handler called>
      #5  0x0000000107e7bb5b in libtest () at lib.C:6
      #6  0x0000000105ea0bde in G__test_C_ACLiC_dict__0_1298 ()
      #7  0x0000000105070481 in Cint::G__ExceptionWrapper ()
      #8  0x000000010511945b in G__execute_call ()
      #9  0x00000001051198bc in G__call_cppfunc ()
      #10 0x00000001050ed23e in G__interpret_func ()
      #11 0x00000001050db6b4 in G__getfunction ()
      #12 0x00000001050cff2f in G__getitem ()
      #13 0x00000001050cba92 in G__getexpr ()
      #14 0x00000001050c3f23 in G__calc_internal ()
      #15 0x0000000105157e90 in G__process_cmd ()
      #16 0x0000000104918094 in TCint::ProcessLine ()
      (..)

      With lldb, the stack trace is confined to ROOT internal functions:

      *** Break *** segmentation violation
      Generating stack trace...
      0x000000010694b481 in Cint::G__ExceptionWrapper(int (*)(G__value*, char const*, G__param*, int), G__value*, char*, G__param*, int) (in libCint.so) + 49
      0x00000001069f445b in G__execute_call (in libCint.so) + 75
      0x00000001069f48bc in G__call_cppfunc (in libCint.so) + 860
      0x00000001069c823e in G__interpret_func (in libCint.so) + 5198
      0x00000001069b66b4 in G__getfunction (in libCint.so) + 5732
      0x00000001069aaf2f in G__getitem (in libCint.so) + 511
      0x00000001069a6a92 in G__getexpr (in libCint.so) + 31458
      0x000000010699ef23 in G__calc_internal (in libCint.so) + 979
      0x0000000106a32e90 in G__process_cmd (in libCint.so) + 16992
      0x00000001061ef094 in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) (in libCore.so) + 884
      (..)

        Attachments

        1. lib.C
          0.1 kB
        2. lib.h
          0.0 kB
        3. test.C
          0.0 kB

          Activity

            People

            • Assignee:
              axel Axel Naumann
              Reporter:
              jwienken Jens Wienkenhover
            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: