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

TTree::Draw: Single Integer Branch with options 'para goff' segfaults

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 6.06/04
    • Fix Version/s: None
    • Component/s: Core Libraries
    • Labels:
      None
    • Environment:

      Root Installed using Macports on Mac OSX El Capitan 10.11.4

      Description

      When using TTree::Draw on a single, integer branch with options 'para goff' a segmentation fault occurs.

      The problem occurs in CLING/PyROOT/compiled code.

      I am aware that there is no real need to use 'para' in combination with just a single branch.

      I am fairly certain that the error originates from L 459 in TTreePlayer.cxx, specifically:

      if (fSelector->GetVar1()->IsInteger()) fHistogram->LabelsDeflate("X");

      For an integer branch the condition evaluates to true, however, due to the combination of para and goff the histogram pointer is NULL (see also L 433).

      Inserting

       && !(optpara||optcandle)

      into the condition (as is done for the other dimensions) should fix this, however, note that

      • I have not tested this
      • I'd advise to refactor the whole block L 458-528 instead in order to ensure that para/candle/gl5d are not treated just as another dimension

      Minimal Test Case (PyROOT):

      Create:

      import ROOT
      import array
      import random
       
      f = ROOT.TFile('Test.root', 'RECREATE')
      t = ROOT.TTree('t', '')
      a = array.array('i', [0])
      t.Branch('a', a, 'a/I')
       
      for i in xrange(999999):
          a[0] = random.randint(0, 42)
          t.Fill()
       
      t.Write()
      f.Close()

      Test:

      f = ROOT.TFile('Test.root', 'READ')
      t = f.Get('t')
      t.Draw('a', '', 'goff para')

        Attachments

          Activity

            People

            • Assignee:
              couet Olivier Couet
              Reporter:
              fawilk Fabian Wilk (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Actual End: