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

TGaxis::PaintAxis() may cause a correctness problem in multithreaded context when handling optionTime with %F

    XMLWordPrintable

    Details

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

      The issues may be platform independent.

      Description

      Handling of time formatted axis that uses %F in the format is implemented through a temporary change of environment variable 'TZ'. This has global side effects and if another thread is using anything that is affected by TZ-environment variable, it may sporadically receive wrong values as the query may happen while TGaxis::PaintAxis() has temporarily changed the value.

      Related code is in TGaxis::PaintAxis() on lines:

      TString tz   = (TString)gSystem->Getenv("TZ"); //save timezone
      Bool_t isUTC = kFALSE;
      if (gSystem->Getenv("TZ") && tz.Length()==0) isUTC=kTRUE;
      gSystem->Setenv("TZ", "UTC"); //sets timezone to UTC
      tzset();
      timeoffset  = mktime(&tp);
      //restore TZ
      if (tz.Length()) {
          gSystem->Setenv("TZ", tz.Data());
      } else {
          if (isUTC) gSystem->Setenv("TZ", "");
          else       gSystem->Unsetenv("TZ");
      }
      tzset();

        Attachments

          Activity

            People

            • Assignee:
              couet Olivier Couet
              Reporter:
              395b0cae518753e2a98d tc3t (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Actual End: