Skip to content

Commit 59c857e

Browse files
committed
Merge branch 'master' of github.com:simdjson/simdjson
2 parents 45c9136 + bc4087a commit 59c857e

File tree

4 files changed

+64
-1
lines changed

4 files changed

+64
-1
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Ubuntu 18.04 CI (GCC 7) with Thread Sanitizer
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
ubuntu-build:
13+
runs-on: ubuntu-18.04
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/cache@v2
17+
with:
18+
path: dependencies/.cache
19+
key: ${{ hashFiles('dependencies/CMakeLists.txt') }}
20+
- name: Use cmake
21+
run: |
22+
mkdir build &&
23+
cd build &&
24+
cmake -DSIMDJSON_SANITIZE_THREADS=ON .. &&
25+
cmake --build . --target document_stream_tests --target parse_many_test &&
26+
ctest --output-on-failure -R parse_many_test &&
27+
ctest --output-on-failure -R document_stream_tests
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Ubuntu 20.04 CI (GCC 9) with Thread Sanitizer
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
ubuntu-build:
13+
runs-on: ubuntu-20.04
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/cache@v2
17+
with:
18+
path: dependencies/.cache
19+
key: ${{ hashFiles('dependencies/CMakeLists.txt') }}
20+
- name: Use cmake
21+
run: |
22+
mkdir build &&
23+
cd build &&
24+
cmake -DSIMDJSON_SANITIZE_THREADS=ON .. &&
25+
cmake --build . --target document_stream_tests --target parse_many_test &&
26+
ctest --output-on-failure -R parse_many_test &&
27+
ctest --output-on-failure -R document_stream_tests

cmake/simdjson-flags.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ if(SIMDJSON_SANITIZE)
2727
endif()
2828
endif()
2929

30+
if(SIMDJSON_SANITIZE_THREADS)
31+
target_compile_options(simdjson-flags INTERFACE -fsanitize=thread -fsanitize=undefined -fno-sanitize-recover=all)
32+
target_link_libraries(simdjson-flags INTERFACE -fsanitize=thread -fsanitize=undefined -fno-sanitize-recover=all)
33+
34+
# Ubuntu bug for GCC 5.0+ (safe for all versions)
35+
if (CMAKE_COMPILER_IS_GNUCC)
36+
target_link_libraries(simdjson-flags INTERFACE -fuse-ld=gold)
37+
endif()
38+
endif()
3039

3140
if (NOT CMAKE_BUILD_TYPE)
3241
message(STATUS "No build type selected, default to Release")

include/simdjson/dom/document_stream-inl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ inline void stage1_worker::start_thread() {
2424
return; // This should never happen but we never want to create more than one thread.
2525
}
2626
thread = std::thread([this]{
27-
while(can_work) {
27+
while(true) {
2828
std::unique_lock<std::mutex> thread_lock(locking_mutex);
2929
cond_var.wait(thread_lock, [this]{return has_work || !can_work;});
3030
if(!can_work) {

0 commit comments

Comments
 (0)