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

Streaming/Loading of TRandom with a TBufferFile fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 6.08/04
    • Fix Version/s: 6.10/00, 6.08/08
    • Component/s: I/O
    • Labels:
      None
    • Environment:

      Ubuntu Linux, GCC 6.3 (GCC 4 abi as default)

    • Development:

      Description

      We used to stream objects using TBufferFile but with version 6.08/04 this produces segmentation violations when we try to stream a class inheriting from TRandom

      The reading/writing of the object from the buffer does not return any error message but the object seems to be corrupted: IsA() returns a memory address which seems to be on the stack. I wrote a small example which for me works fine with 6.06/08 and produces an output similar to

      instance at: 0x978c70, TClass* from IsA(): 0x1a1d6e0
      instance at: 0x1290d00, TClass* from IsA(): 0x1a1d6e0

      (notice that the two TClass pointers are identical as they should) but with 6.08/04 I get something like

      instance at: 0x1e8a2c0, TClass* from IsA(): 0x2d5ad20
      instance at: 0x2f732a0, TClass* from IsA(): 0x7f7f9df89445

      (with the second TClass pointer being suspiciously high).

      Any attempt to access this object in a meaningful way produces segmentation violations. This breaks our multiprocessing completely as transmitting the random state immediately crashes.

      I tried to follow this down and the ReadObjectAny() seems to have the correct class pointer till it calls the streamer in TBufferFile.cxx:2539:

      // let the object read itself
      clRef->Streamer( obj, *this, clOnfile );

        Attachments

          Activity

            People

            • Assignee:
              pcanal Philippe Canal
              Reporter:
              d0efd835d09c19439b33 Martin Ritter
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Actual End: