Skip to content

Commit d7a02c1

Browse files
authored
GH-49651: [C++][FlightRPC] Fix ODBC Linux test segmentation fault (#49688)
### Rationale for this change GH-49651 ### What changes are included in this PR? - On Linux, change to use static test linking for ODBC only Note: enabling Linux test build will be in a separate PR ### Are these changes tested? Tested on local machine and in our local repository ### Are there any user-facing changes? N/A * GitHub Issue: #49651 Lead-authored-by: Alina (Xi) Li <alinal@bitquilltech.com> Co-authored-by: Alina (Xi) Li <96995091+alinaliBQ@users.noreply.github.com> Signed-off-by: David Li <li.davidm96@gmail.com>
1 parent c7cb411 commit d7a02c1

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/cpp_extra.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ jobs:
413413
needs.check-labels.outputs.force == 'true' ||
414414
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
415415
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')
416-
timeout-minutes: 75
416+
timeout-minutes: 120
417417
strategy:
418418
fail-fast: false
419419
matrix:

cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ set(ARROW_FLIGHT_SQL_ODBC_TEST_SRCS
4242
# GH-46889: move protobuf_test_util to a more common location
4343
../../../../engine/substrait/protobuf_test_util.cc)
4444

45-
if(ARROW_TEST_LINKAGE STREQUAL "static")
46-
set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_static
47-
${ARROW_TEST_STATIC_LINK_LIBS})
48-
else()
45+
# GH-49651 Link ODBC tests statically on Linux and dynamically on macOS/Windows
46+
if(WIN32 OR APPLE)
4947
set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_shared
5048
${ARROW_TEST_SHARED_LINK_LIBS})
49+
else()
50+
# GH-49651 Link ODBC tests statically on Linux to fix segfault
51+
set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_static
52+
${ARROW_TEST_STATIC_LINK_LIBS})
5153
endif()
5254

5355
# On macOS, link `ODBCINST` first to ensure iodbc take precedence over unixodbc
@@ -65,6 +67,13 @@ else()
6567
# Unix
6668
list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS
6769
${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS} ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS})
70+
71+
if(NOT APPLE)
72+
# Links static dependencies on Linux to support ARROW_TEST_LINKAGE=static
73+
list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS arrow_odbc_spi_impl
74+
${ARROW_PROTOBUF_LIBPROTOBUF})
75+
endif()
76+
6877
endif()
6978

7079
add_arrow_test(flight_sql_odbc_test

0 commit comments

Comments
 (0)