Details

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

      OSX El Capitan

      Description

      Creating an array of TCanvas gives a crash both in compiled and interpreted mode.
      Deleting[] by hand succeeds in compiled mode.

      #if !defined __CINT__ || defined __MAKECINT__
      #include "TCanvas.h"
      #endif
       
      void rootBug(){
       
        TCanvas *cCanArray = new TCanvas[2]{{"fooName","fooTitle"},{"barName","barTitle"}};
      //  delete [] cCanArray; // <-- This line to make it work in compiled mode, will still crash in interpreted mode 
      }

      === Interpreted mode ==
      hbeck-macbook:plt hbeck$ root -b rootBug.C
      *******************************************

      • *
      • W E L C O M E to R O O T *
      • *
      • Version 5.34/30 23 April 2015 *
      • *
      • You are welcome to visit our Web site *
      • http://root.cern.ch *
      • *
        *******************************************

      ROOT 5.34/30 (heads/alice/v5-34-30@v5-34-30-17-g89a1ac5, Nov 25 2015, 07:37:57 on macosx64)

      CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
      Type ? for help. Commands must be C++ statements.
      Enclose multiple statements between { }.
      Setting include paths for $ALICE_ROOT/include and $ALICE_PHYSICS/include
      include path: -I$ROOTSYS/include -I/opt/alice/aliroot/v5-07-15/inst/include -I/opt/alice/aliphysics/vAN-20151130/inst/include -I"/opt/alice/root/alice_v5-34-30/inst/include"
      Setting gStyle..
      root [0]
      Processing rootBug.C...

          • Break *** floating point exception
            Generating stack trace...
            0x000000010fe60083 in G__interpret_func (in libCint.5.so) + 15187
            0x000000010fe4be2c in G__getfunction (in libCint.5.so) + 5836
            0x000000010fe409a3 in G__getitem (in libCint.5.so) + 595
            0x000000010fe3c1d9 in G__getexpr (in libCint.5.so) + 31049
            0x000000010fe347b8 in G__calc_internal (in libCint.5.so) + 1032
            0x000000010fec3741 in G__process_cmd (in libCint.5.so) + 15041
            0x000000010f6931cd in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) (in libCore.5.so) + 893
            0x000000010f693529 in TCint::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (in libCore.5.so) + 121
            0x000000010f5e9d7a in TApplication::ExecuteFile(char const*, int*, bool) (in libCore.5.so) + 2314
            0x00000001104f2dce in TRint::Run(bool) (in libRint.5.so) + 1102
            0x000000010f5dfe1f in main (in root.exe) + 79
            0x00007fff991ff5ad in start (in libdyld.dylib) + 1
            Root > Function rootBug() busy flag cleared
            root [1] .q
            root.exe(11557,0x7fff7ab69000) malloc: *** error for object 0x7fb484043208: pointer being freed was not allocated
          • set a breakpoint in malloc_error_break to debug

      == compiled mode ==
      hbeck-macbook:plt hbeck$ root -b -q rootBug.C++
      *******************************************

      • *
      • W E L C O M E to R O O T *
      • *
      • Version 5.34/30 23 April 2015 *
      • *
      • You are welcome to visit our Web site *
      • http://root.cern.ch *
      • *
        *******************************************

      ROOT 5.34/30 (heads/alice/v5-34-30@v5-34-30-17-g89a1ac5, Nov 25 2015, 07:37:57 on macosx64)

      CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
      Type ? for help. Commands must be C++ statements.
      Enclose multiple statements between { }.
      Setting include paths for $ALICE_ROOT/include and $ALICE_PHYSICS/include
      include path: -I$ROOTSYS/include -I/opt/alice/aliroot/v5-07-15/inst/include -I/opt/alice/aliphysics/vAN-20151130/inst/include -I"/opt/alice/root/alice_v5-34-30/inst/include"
      Setting gStyle..
      root [0]
      Processing rootBug.C++...
      Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/hbeck/alice/H2L/plt/./rootBug_C.so
      root.exe(11622,0x7fff7ab69000) malloc: *** error for object 0x7fcec307a808: pointer being freed was not allocated

          • set a breakpoint in malloc_error_break to debug

      == with delete[] compiled works ==
      hbeck-macbook:plt hbeck$ root -b -q rootBug.C++
      *******************************************

      • *
      • W E L C O M E to R O O T *
      • *
      • Version 5.34/30 23 April 2015 *
      • *
      • You are welcome to visit our Web site *
      • http://root.cern.ch *
      • *
        *******************************************

      ROOT 5.34/30 (heads/alice/v5-34-30@v5-34-30-17-g89a1ac5, Nov 25 2015, 07:37:57 on macosx64)

      CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
      Type ? for help. Commands must be C++ statements.
      Enclose multiple statements between { }.
      Setting include paths for $ALICE_ROOT/include and $ALICE_PHYSICS/include
      include path: -I$ROOTSYS/include -I/opt/alice/aliroot/v5-07-15/inst/include -I/opt/alice/aliphysics/vAN-20151130/inst/include -I"/opt/alice/root/alice_v5-34-30/inst/include"
      Setting gStyle..
      root [0]
      Processing rootBug.C++...
      Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/hbeck/alice/H2L/plt/./rootBug_C.so
      hbeck-macbook:plt hbeck$

      == with delete[] in interpreted ==
      hbeck-macbook:plt hbeck$ root -b -q rootBug.C
      *******************************************

      • *
      • W E L C O M E to R O O T *
      • *
      • Version 5.34/30 23 April 2015 *
      • *
      • You are welcome to visit our Web site *
      • http://root.cern.ch *
      • *
        *******************************************

      ROOT 5.34/30 (heads/alice/v5-34-30@v5-34-30-17-g89a1ac5, Nov 25 2015, 07:37:57 on macosx64)

      CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
      Type ? for help. Commands must be C++ statements.
      Enclose multiple statements between { }.
      Setting include paths for $ALICE_ROOT/include and $ALICE_PHYSICS/include
      include path: -I$ROOTSYS/include -I/opt/alice/aliroot/v5-07-15/inst/include -I/opt/alice/aliphysics/vAN-20151130/inst/include -I"/opt/alice/root/alice_v5-34-30/inst/include"
      Setting gStyle..
      root [0]
      Processing rootBug.C...

          • Break *** floating point exception
            Generating stack trace...
            0x00000001028e7083 in G__interpret_func (in libCint.5.so) + 15187
            0x00000001028d2e2c in G__getfunction (in libCint.5.so) + 5836
            0x00000001028c79a3 in G__getitem (in libCint.5.so) + 595
            0x00000001028c31d9 in G__getexpr (in libCint.5.so) + 31049
            0x00000001028bb7b8 in G__calc_internal (in libCint.5.so) + 1032
            0x000000010294a741 in G__process_cmd (in libCint.5.so) + 15041
            0x00000001021141cd in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) (in libCore.5.so) + 893
            0x0000000102114529 in TCint::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (in libCore.5.so) + 121
            0x000000010206ad7a in TApplication::ExecuteFile(char const*, int*, bool) (in libCore.5.so) + 2314
            0x0000000102f7bdce in TRint::Run(bool) (in libRint.5.so) + 1102
            0x000000010205ae1f in main (in root.exe) + 79
            0x00007fff991ff5ad in start (in libdyld.dylib) + 1
            Root > Function rootBug() busy flag cleared
            root.exe(11713,0x7fff7ab69000) malloc: *** error for object 0x7f91cc056208: pointer being freed was not allocated
          • set a breakpoint in malloc_error_break to debug
            hbeck-macbook:plt hbeck$

      hbeck-macbook:~ hbeck$ root-config --features
      alien asimage astiff builtin_afterimage builtin_ftgl builtin_freetype builtin_glew builtin_pcre builtin_lzma libcxx cintex cocoa explicitlink genvector krb5 ldap memstat minuit2 opengl pythia6 python reflex roofit shared soversion sqlite ssl tmva vdt xml xrootd thread

      hbeck-macbook:~ hbeck$ clang --version
      Apple LLVM version 7.0.0 (clang-700.1.76)
      Target: x86_64-apple-darwin15.0.0
      Thread model: posix

        Attachments

          Activity

            People

            • Assignee:
              pcanal Philippe Canal
              Reporter:
              hbeck Hans Beck (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: