Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2722

impl/DataFile.cc use of boost::mt19937 for DataFileWriteBase::makeSync is not thread safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.9.1
    • 1.11.1, 1.12.0
    • c++
    • Issue can be reproduced in Linux with clang and on Android arm64 and armeabi with android NDK r19c.

    Description

      The single instance of random is not thread safe, and can seg fault.

      It can be fixed with a global std::mutex next to the global boost::mt19937 generator and a std::unique_lock in the method, or by creating the mersenne_twister_engine as a local variable in the function.

      Attachments

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              DanS006 Dan Schmitt
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m