[ 
https://issues.apache.org/jira/browse/AVRO-2722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17469268#comment-17469268
 ] 

ASF subversion and git services commented on AVRO-2722:
-------------------------------------------------------

Commit 980046077dda2d0192d101178af87ca510578b2a in avro's branch 
refs/heads/branch-1.11 from Martin Tzvetanov Grigorov
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=9800460 ]

AVRO-2722 Move the 'random' variable to be local to the method where it is 
being used

This avoids thread-safety issues.

(cherry picked from commit a906d79b5bd15d7a773b54b06bdc0ffb308cca6b)


> impl/DataFile.cc use of boost::mt19937 for DataFileWriteBase::makeSync is not 
> thread safe
> -----------------------------------------------------------------------------------------
>
>                 Key: AVRO-2722
>                 URL: https://issues.apache.org/jira/browse/AVRO-2722
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: c++
>    Affects Versions: 1.9.1
>         Environment: Issue can be reproduced in Linux with clang and on 
> Android arm64 and armeabi with android NDK r19c.
>            Reporter: Dan Schmitt
>            Assignee: Martin Tzvetanov Grigorov
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 1.11.1
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> 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.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to