Skip to content

Commit

Permalink
ARROW-2561: [C++] Fix double free in cuda-test under code coverage
Browse files Browse the repository at this point in the history
As far as I can understand, the problem is due to both shared and static linking with libarrow.  Some static std::string in libarrow.so would be destroyed twice at shutdown.  Linking entirely statically seems to fix the issue.

Author: Antoine Pitrou <[email protected]>

Closes #2048 from pitrou/ARROW-2561 and squashes the following commits:

7a9d1b5 <Antoine Pitrou> Add comment and do not mention arrow_shared in static link libs
0b40b80 <Antoine Pitrou> ARROW-2561:  Fix double free in cuda-test under code coverage
  • Loading branch information
pitrou authored and xhochy committed May 16, 2018
1 parent 5bb3d85 commit e237918
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cpp/src/arrow/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ set(ARROW_GPU_SRCS
)

set(ARROW_GPU_SHARED_LINK_LIBS
arrow_shared
${CUDA_LIBRARIES}
${CUDA_CUDA_LIBRARY}
)
Expand All @@ -42,8 +41,9 @@ ADD_ARROW_LIB(arrow_gpu
SOURCES ${ARROW_GPU_SRCS}
DEPENDENCIES metadata_fbs
SHARED_LINK_FLAGS ""
SHARED_LINK_LIBS ${ARROW_GPU_SHARED_LINK_LIBS}
STATIC_LINK_LIBS ""
SHARED_LINK_LIBS arrow_shared ${ARROW_GPU_SHARED_LINK_LIBS}
# Static arrow_gpu must also link against CUDA shared libs
STATIC_LINK_LIBS ${ARROW_GPU_SHARED_LINK_LIBS}
)

# CUDA build version
Expand Down Expand Up @@ -72,7 +72,8 @@ install(
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")

set(ARROW_GPU_TEST_LINK_LIBS
arrow_gpu_shared
# ARROW-2561: Must link statically against arrow and arrow_gpu to avoid double free
arrow_gpu_static
${ARROW_TEST_LINK_LIBS})

if (ARROW_BUILD_TESTS)
Expand Down

0 comments on commit e237918

Please sign in to comment.