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

Warning and segfault when writing custom class into TTree (with dictionary)

    XMLWordPrintable

    Details

      Description

      Dear experts,

      I'm trying to write a custom class into a tree branch. A dictionary for the class is generated using the cmake macro `ROOT_GENERATE_DICTIONARY`. The compilation goes on fine, but the call to ┬┤TTree::Branch` causes a warning followed by a segfault. Removing the call to `TTree::Branch` I still get a warning but no segfault.

      I've included a small example isolating the bug (to be built with cmake).

      Yours,
      S├ębastien

      This is the warning followed by the stacktrace:

      Warning in <TClassTable::Add>: class hit already in TClassTable
      Warning in <TClassTable::Add>: class event already in TClassTable
       
       *** Break *** segmentation violation
       
       
       
      ===========================================================
      There was a crash.
      This is the entire stack trace of all threads:
      ===========================================================
      #0  0x00007fd3f666448a in __GI___waitpid (pid=15576, stat_loc=stat_loc
      entry=0x7ffd9cf06dc0, options=options
      entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
      #1  0x00007fd3f65dd2fb in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:148
      #2  0x00007fd3f79e10a9 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x55c8a6c934f0) at /home/swertz/.local/soft/root/core/unix/src/TUnixSystem.cxx:2116
      #3  TUnixSystem::StackTrace (this=0x55c8a6c934f0) at /home/swertz/.local/soft/root/core/unix/src/TUnixSystem.cxx:2403
      #4  0x00007fd3f79e3a5c in TUnixSystem::DispatchSignals (this=0x55c8a6c934f0, sig=kSigSegmentationViolation) at /home/swertz/.local/soft/root/core/unix/src/TUnixSystem.cxx:3661
      #5  <signal handler called>
      #6  strlen () at ../sysdeps/x86_64/strlen.S:106
      #7  0x00007fd3f208f20c in std::char_traits<char>::length (__s=0x7fd3eb5bf370 <error: Cannot access memory at address 0x7fd3eb5bf370>) at /usr/include/c++/6/bits/char_traits.h:267
      #8  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append (__s=0x7fd3eb5bf370 <error: Cannot access memory at address 0x7fd3eb5bf370>, this=0x7ffd9cf096d0) at /usr/include/c++/6/bits/basic_string.h:1113
      #9  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+= (__s=0x7fd3eb5bf370 <error: Cannot access memory at address 0x7fd3eb5bf370>, this=0x7ffd9cf096d0) at /usr/include/c++/6/bits/basic_string.h:1037
      #10 ExecAutoParse (what=0x7fd3eb5bf370 <error: Cannot access memory at address 0x7fd3eb5bf370>, header=header
      entry=false, interpreter=0x55c8a6cfa0a0) at /home/swertz/.local/soft/root/core/meta/src/TCling.cxx:5324
      #11 0x00007fd3f20937ab in TCling::AutoParseImplRecurse (this=this
      entry=0x55c8a6cf32f0, cls=<optimized out>, cls
      entry=0x7ffd9cf09a40 "event", topLevel=topLevel
      entry=true) at /home/swertz/.local/soft/root/core/meta/src/TCling.cxx:5445
      #12 0x00007fd3f2093e82 in TCling::AutoParse (this=0x55c8a6cf32f0, cls=0x7ffd9cf09a40 "event") at /home/swertz/.local/soft/root/core/meta/src/TCling.cxx:5523
      #13 0x00007fd3f207fe3a in TClingLookupHelper__AutoParse (cname=<optimized out>) at /home/swertz/.local/soft/root/core/meta/src/TCling.cxx:909
      #14 0x00007fd3f2073f87 in ROOT::TMetaUtils::TClingLookupHelper::GetPartiallyDesugaredNameWithScopeHandling (this=0x55c8a6df4fd0, tname="event", result="") at /home/swertz/.local/soft/root/core/metautils/src/TMetaUtils.cxx:552
      #15 0x00007fd3f79813b3 in ResolveTypedefProcessType (tname=tname
      entry=0x55c8a790df10 "event", cursor=5, constprefix=constprefix
      entry=false, start_of_type=start_of_type
      entry=0, end_of_type=end_of_type
      entry=0, mod_start_of_type=mod_start_of_type
      entry=0, modified=
      0x7ffd9cf09e4b: false, result="", this=<optimized out>, this=<optimized out>, this=<optimized out>) at /home/swertz/.local/soft/root/core/metautils/src/TClassEdit.cxx:1366
      #16 0x00007fd3f7982a2b in ResolveTypedefImpl (tname=tname
      entry=0x55c8a790df10 "event", len=<optimized out>, cursor=
      0x7ffd9cf09e4c: 5, cursor
      entry=
      0x7ffd9cf09e4c: 0, modified=modified
      entry=
      0x7ffd9cf09e4b: false, result="") at /home/swertz/.local/soft/root/core/metautils/src/TClassEdit.cxx:1641
      #17 0x00007fd3f7983744 in TClassEdit::ResolveTypedef[abi:cxx11](char const*, bool) (tname=0x55c8a790df10 "event") at /home/swertz/.local/soft/root/core/metautils/src/TClassEdit.cxx:1671
      #18 0x00007fd3f7986dbd in TClassEdit::TSplitType::ShortType (this=this
      entry=0x7ffd9cf09f70, answ="", mode=3618, mode
      entry=3616) at /home/swertz/.local/soft/root/core/metautils/src/TClassEdit.cxx:390
      #19 0x00007fd3f7985bb0 in TClassEdit::GetNormalizedName (norm_name="", name=...) at /home/swertz/.local/soft/root/core/metautils/src/TClassEdit.cxx:794
      #20 0x00007fd3f7998413 in TClass::GetClass (name=name
      entry=0x55c8a78b63d0 "event", load=load
      entry=true, silent=silent
      entry=true) at /home/swertz/.local/soft/root/core/meta/src/TClass.cxx:2944
      #21 0x00007fd3f208165c in TCling::GetClass (this=<optimized out>, typeinfo=..., load=<optimized out>) at /home/swertz/.local/soft/root/core/meta/src/TCling.cxx:5169
      #22 0x00007fd3f7990259 in TClass::GetClass (typeinfo=..., load=<optimized out>) at /home/swertz/.local/soft/root/core/meta/src/TClass.cxx:3127
      #23 0x000055c8a4bf5257 in TBranch* TTree::Branch<event>(char const*, event*, int, int) ()
      #24 0x000055c8a4bf4faf in main ()
      ===========================================================

        Attachments

          Activity

            People

            • Assignee:
              axel Axel Naumann
              Reporter:
              swertz Sebastien Wertz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: