-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Threaded CSV Parser is not thread-safe #505
Comments
TODO: add a sanitizer test to the continuous integration pipeline. |
This was referenced Feb 21, 2019
Update: replacing std::unique_ptr<dmlc::Parser<uint32_t, float>> parser(
dmlc::Parser<uint32_t, float>::Create("data.txt", 0, 1, "csv")); with dmlc::Parser<uint32_t, float>* parser =
dmlc::Parser<uint32_t, float>::Create("data.txt", 0, 1, "csv"); eliminates the data race (i.e. the example no longer crashes with Thread Sanitizer). Note that adding Two possibilities:
|
I got much better diagnostics from Thread Sanitizer, after compiling
|
hcho3
added a commit
to hcho3/dmlc-core
that referenced
this issue
Mar 7, 2019
eric-haibin-lin
pushed a commit
to eric-haibin-lin/dmlc-core
that referenced
this issue
Mar 24, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minimal example:
Content of
data.txt
: data.txtCompile the example with
g++ -g -O0 -fsanitize=thread -o example example.cc ./dmlc-core/lib/libdmlc.a -I./dmlc-core/include -lpthread -lgomp
. The Thread Sanitizer detects data races whenOMP_NUM_THREADS
is set to 2 or higher:The text was updated successfully, but these errors were encountered: