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

TDF: rare crash in TRootDS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: master
    • Fix Version/s: 6.12/00, 6.14/00
    • Component/s: Other
    • Labels:
      None
    • Environment:

      any

    • Development:

      Description

      Reproducer (crashes about 1/200 times for me):

      #include "ROOT/TDataSource.hxx"
      #include "ROOT/TDataFrame.hxx"
      #include "ROOT/TRootDS.hxx"
      #include <vector>
      using namespace ROOT::Experimental;
      using namespace ROOT::Experimental::TDF;
       
      void GenerateData()
      {
         const auto fileName0 = "TRootTDS_input_0.root";
         const auto fileName1 = "TRootTDS_input_1.root";
         const auto fileName2 = "TRootTDS_input_2.root";
         int i = 0;
         for (auto &&fileName : {fileName0, fileName1, fileName2}) {
            TDataFrame tdf(10);
            tdf.Define("i", [&i]() { return i++; }).Snapshot<int>("t", fileName, {"i"});
         }
      }
       
      int main() {
         // EXECUTE ONCE TO GENERATE THE INPUT DATASET!
         // GenerateData(); 
         ROOT::EnableImplicitMT(4);
         std::unique_ptr<TDataSource> tds(new TRootDS("t", "TRootTDS_input_*.root"));
         TDataFrame d(std::move(tds));
         auto m = d.Max<int>("i");
         assert(29 == *m);
       
         return 0;
      }

      Stacktrace:

      #0  0x00007ffff541a428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
      #1  0x00007ffff541c02a in __GI_abort () at abort.c:89
      #2  0x00007ffff545c7ea in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7ffff5575e98 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
      #3  0x00007ffff546537a in malloc_printerr (ar_ptr=<optimized out>, ptr=<optimized out>, str=0x7ffff5575fc8 "double free or corruption (!prev)", action=3) at malloc.c:5006
      #4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3867
      #5  0x00007ffff546953c in __GI___libc_free (mem=<optimized out>) at malloc.c:2968
      #6  0x00007ffff7ab45e7 in ROOT::Experimental::TDF::TRootDS::~TRootDS (this=0x15e4e80, __in_chrg=<optimized out>) at /home/blue/ROOT/root/tree/treeplayer/src/TRootDS.cxx:40
      #7  0x00007ffff7ab46ba in ROOT::Experimental::TDF::TRootDS::~TRootDS (this=0x15e4e80, __in_chrg=<optimized out>) at /home/blue/ROOT/root/tree/treeplayer/src/TRootDS.cxx:42
      #8  0x00000000004d72b0 in std::default_delete<ROOT::Experimental::TDF::TDataSource>::operator() (this=0x193deb0, __ptr=0x15e4e80) at /usr/include/c++/6/bits/unique_ptr.h:76
      #9  0x00000000004d3d9d in std::unique_ptr<ROOT::Experimental::TDF::TDataSource, std::default_delete<ROOT::Experimental::TDF::TDataSource> >::~unique_ptr (this=0x193deb0, __in_chrg=<optimized out>) at /usr/include/c++/6/bits/unique_ptr.h:239
      #10 0x00000000004f4c36 in ROOT::Detail::TDF::TLoopManager::~TLoopManager (this=0x193dd70, __in_chrg=<optimized out>) at /home/blue/ROOT/dbg/include/ROOT/TDFNodes.hxx:84
      #11 0x00000000004f4d0e in __gnu_cxx::new_allocator<ROOT::Detail::TDF::TLoopManager>::destroy<ROOT::Detail::TDF::TLoopManager> (this=0x193dd70, __p=0x193dd70) at /usr/include/c++/6/ext/new_allocator.h:124
      #12 0x00000000004f368b in std::allocator_traits<std::allocator<ROOT::Detail::TDF::TLoopManager> >::destroy<ROOT::Detail::TDF::TLoopManager> (__a=..., __p=0x193dd70) at /usr/include/c++/6/bits/alloc_traits.h:487
      #13 0x00000000004f1879 in std::_Sp_counted_ptr_inplace<ROOT::Detail::TDF::TLoopManager, std::allocator<ROOT::Detail::TDF::TLoopManager>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x193dd60) at /usr/include/c++/6/bits/shared_ptr_base.h:529
      #14 0x00000000004d5514 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x193dd60) at /usr/include/c++/6/bits/shared_ptr_base.h:150
      #15 0x00000000004d2683 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x7fffffffdda8, __in_chrg=<optimized out>) at /usr/include/c++/6/bits/shared_ptr_base.h:662
      #16 0x00000000004d15de in std::__shared_ptr<ROOT::Detail::TDF::TLoopManager, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x7fffffffdda0, __in_chrg=<optimized out>) at /usr/include/c++/6/bits/shared_ptr_base.h:928
      #17 0x00000000004d15fa in std::shared_ptr<ROOT::Detail::TDF::TLoopManager>::~shared_ptr (this=0x7fffffffdda0, __in_chrg=<optimized out>) at /usr/include/c++/6/bits/shared_ptr.h:93
      #18 0x00000000004d1d0c in ROOT::Experimental::TDF::TInterface<ROOT::Detail::TDF::TLoopManager>::~TInterface (this=0x7fffffffdda0, __in_chrg=<optimized out>) at /home/blue/ROOT/dbg/include/ROOT/TDFInterface.hxx:333
      #19 0x00000000004d1d28 in ROOT::Experimental::TDataFrame::~TDataFrame (this=0x7fffffffdda0, __in_chrg=<optimized out>) at /home/blue/ROOT/dbg/include/ROOT/TDataFrame.hxx:39
      #20 0x00000000004cb105 in TRootTDS_DefineSlotMT_Test::TestBody (this=0x810620) at /home/blue/ROOT/root/tree/treeplayer/test/dataframe/datasource_root.cxx:139
      #21 0x0000000000525bd4 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> (object=0x810620, method=&virtual testing::Test::TestBody(), location=0x536ab3 "the test body") at /home/blue/ROOT/dbg/googletest-prefix/src/googletest/googletest/src/gtest.cc:2402
      #22 0x00000000005202ef in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> (object=0x810620, method=&virtual testing::Test::TestBody(), location=0x536ab3 "the test body") at /home/blue/ROOT/dbg/googletest-prefix/src/googletest/googletest/src/gtest.cc:2438
      #23 0x000000000050438a in testing::Test::Run (this=0x810620) at /home/blue/ROOT/dbg/googletest-prefix/src/googletest/googletest/src/gtest.cc:2475
      #24 0x0000000000504cb0 in testing::TestInfo::Run (this=0x810340) at /home/blue/ROOT/dbg/googletest-prefix/src/googletest/googletest/src/gtest.cc:2656
      #25 0x0000000000505339 in testing::TestCase::Run (this=0x80fb60) at /home/blue/ROOT/dbg/googletest-prefix/src/googletest/googletest/src/gtest.cc:2774
      #26 0x000000000050c4c4 in testing::internal::UnitTestImpl::RunAllTests (this=0x80ef70) at /home/blue/ROOT/dbg/googletest-prefix/src/googletest/googletest/src/gtest.cc:4649
      #27 0x0000000000526a73 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x80ef70, method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x50c1f2 <testing::internal::UnitTestImpl::RunAllTests()>, location=0x5372f0 "auxiliary test code (environments or event listeners)") at /home/blue/ROOT/dbg/googletest-prefix/src/googletest/googletest/src/gtest.cc:2402
      #28 0x0000000000521093 in testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x80ef70, method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x50c1f2 <testing::internal::UnitTestImpl::RunAllTests()>, location=0x5372f0 "auxiliary test code (environments or event listeners)") at /home/blue/ROOT/dbg/googletest-prefix/src/googletest/googletest/src/gtest.cc:2438
      #29 0x000000000050b094 in testing::UnitTest::Run (this=0x774bc0 <testing::UnitTest::GetInstance()::instance>) at /home/blue/ROOT/dbg/googletest-prefix/src/googletest/googletest/src/gtest.cc:4257
      #30 0x0000000000533aaa in RUN_ALL_TESTS () at /home/blue/ROOT/dbg/googletest-prefix/src/googletest/googletest/include/gtest/gtest.h:2233
      #31 0x0000000000533a39 in main (argc=1, argv=0x7fffffffe318) at /home/blue/ROOT/dbg/googletest-prefix/src/googletest/googletest/src/gtest_main.cc:37

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              eguiraud Enrico Guiraud
              Reporter:
              eguiraud Enrico Guiraud
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Actual End: