You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tadeja (via GitHub)" <gi...@apache.org> on 2026/06/18 07:52:38 UTC

[PR] GH-50210: [CI][C++][Gandiva] Replace precompiled std::string to fix _Unwind_Resume JIT failure on JNI builds [arrow]

tadeja opened a new pull request, #50214:
URL: https://github.com/apache/arrow/pull/50214

   ### Rationale for this change
   
   Fix #50210
   ```bash
   JIT session error: Symbols not found: [ _Unwind_Resume ]
   /arrow/cpp/src/gandiva/tests/projector_test.cc:1978: Failure
   ```
   Recent commit 4b64398 introduced a few `std::string` error messages into Gandiva precompiled functions.
   
   ### What changes are included in this PR?
   Replace `std::string` in precompiled functions with `snprintf` (bounded by buffer size, cannot overflow regardless of input length).
   
   ### Are these changes tested?
   Yes, pass on fork CI:
   [JNI ubuntu-latest amd64](https://github.com/tadeja/arrow/actions/runs/27724218930/job/82018788632#step:7:14558)
   [JNI ubuntu-24.04-arm arm64/v8](https://github.com/tadeja/arrow/actions/runs/27724218930/job/82018788669#step:7:14868)
   
   ### Are there any user-facing changes?
   No.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-50210: [C++][Gandiva] Replace precompiled std::string to fix _Unwind_Resume JIT failure on JNI builds [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou merged PR #50214:
URL: https://github.com/apache/arrow/pull/50214


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-50210: [C++][Gandiva] Replace precompiled std::string to fix _Unwind_Resume JIT failure on JNI builds [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #50214:
URL: https://github.com/apache/arrow/pull/50214#discussion_r3439988423


##########
cpp/src/gandiva/precompiled/time.cc:
##########
@@ -270,9 +270,10 @@ static const int WEEK_LEN[] = {6, 6, 7, 9, 8, 6, 8};
       }                                                                                  \
     }                                                                                    \
     if (dateSearch == 0) {                                                               \
-      std::string err_msg = "NEXT_DAY: '" + std::string(in, in_len) +                    \
-                            "' is not a recognized day of the week";                     \
-      gdv_fn_context_set_error_msg(context, err_msg.c_str());                            \
+      char err_msg[128];                                                                 \
+      snprintf(err_msg, sizeof(err_msg),                                                 \
+               "NEXT_DAY: '%.*s' is not a recognized day of the week", in_len, in);      \

Review Comment:
   Hmm. Can we assume that `in_len` is enough small? For example, can we assume that `next_day(date, "lo...ong string")` never happen?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-50210: [C++][Gandiva] Replace precompiled std::string to fix _Unwind_Resume JIT failure on JNI builds [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #50214:
URL: https://github.com/apache/arrow/pull/50214#discussion_r3439991437


##########
cpp/src/gandiva/precompiled/time.cc:
##########
@@ -270,9 +270,10 @@ static const int WEEK_LEN[] = {6, 6, 7, 9, 8, 6, 8};
       }                                                                                  \
     }                                                                                    \
     if (dateSearch == 0) {                                                               \
-      std::string err_msg = "NEXT_DAY: '" + std::string(in, in_len) +                    \
-                            "' is not a recognized day of the week";                     \
-      gdv_fn_context_set_error_msg(context, err_msg.c_str());                            \
+      char err_msg[128];                                                                 \
+      snprintf(err_msg, sizeof(err_msg),                                                 \
+               "NEXT_DAY: '%.*s' is not a recognized day of the week", in_len, in);      \

Review Comment:
   Ah, long message will be just truncated.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-50210: [C++][Gandiva] Replace precompiled std::string to fix _Unwind_Resume JIT failure on JNI builds [arrow]

Posted by "lriggs (via GitHub)" <gi...@apache.org>.
lriggs commented on PR #50214:
URL: https://github.com/apache/arrow/pull/50214#issuecomment-4748463747

   Thanks for fixing this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-50210: [CI][C++][Gandiva] Replace precompiled std::string to fix _Unwind_Resume JIT failure on JNI builds [arrow]

Posted by "tadeja (via GitHub)" <gi...@apache.org>.
tadeja commented on PR #50214:
URL: https://github.com/apache/arrow/pull/50214#issuecomment-4740336001

   @lriggs @kou welcome to already review this fix or re-do it differently.
   
   I saw the pr  https://github.com/apache/arrow/pull/50112#discussion_r3384017956 regarding `160` for `char err_msg[160]` and I consulted šŸ¤– Claude Opus regarding this: 
   '_Buffer safety is independent of in_len_original and of the buffer size. snprintf(err_msg, sizeof(err_msg), 
   "…%.*s…", in_len_original, in_original) can never overflow err_msg. The sizeof bound caps the total bytes
   written; the %.*s precision only caps how many source bytes are read, and if that exceeds the remaining space
   the result is simply truncated, not overflowed. So 256, 160, 128, even 96 are all equally safe — the only thing
   that changes is how much of the offending value the message shows before truncation._'
   
   Currently I set it to `128`, should be enough for the valuable beginning of the message printed.
   
   Jobs [C++ Extra / JNI ubuntu-latest amd64](https://github.com/apache/arrow/actions/runs/27745137529/job/82081554816?pr=50214) and [C++ Extra / JNI ubuntu-24.04-arm arm64/v8](https://github.com/apache/arrow/actions/runs/27745137529/job/82081554821?pr=50214) now pass with success.
   
   The CI job failures for ODBC, Python and R seem unrelated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-50210: [CI][C++][Gandiva] Replace precompiled std::string to fix _Unwind_Resume JIT failure on JNI builds [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #50214:
URL: https://github.com/apache/arrow/pull/50214#issuecomment-4739410291

   :warning: GitHub issue #50210 **has been automatically assigned in GitHub** to PR creator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-50210: [C++][Gandiva] Replace precompiled std::string to fix _Unwind_Resume JIT failure on JNI builds [arrow]

Posted by "tadeja (via GitHub)" <gi...@apache.org>.
tadeja commented on PR #50214:
URL: https://github.com/apache/arrow/pull/50214#issuecomment-4742153191

   cc @dmitry-chirkov-dremio 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-50210: [C++][Gandiva] Replace precompiled std::string to fix _Unwind_Resume JIT failure on JNI builds [arrow]

Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #50214:
URL: https://github.com/apache/arrow/pull/50214#issuecomment-4750480859

   After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 2aaac072d521feef8fa424a483917b5709c2eb2a.
   
   There was 1 benchmark result indicating a performance regression:
   
   - Commit Run on `test-mac-arm` at [2026-06-19 05:07:57Z](https://conbench.arrow-dev.org/compare/runs/bc4ef07ffd314bf382a09c47cebbeef6...d8a4ecfd51dd41a09e02ed3ac5bea152/)
     - [`tpch` (R) with engine=arrow, format=native, language=R, memory_map=False, query_id=TPCH-09, scale_factor=1](https://conbench.arrow-dev.org/compare/benchmarks/06a3472664fd7fb58000e923d9030376...06a34d01efa873048000ae8985b128f1)
   
   The [full Conbench report](https://github.com/apache/arrow/runs/82326150995) has more details. It also includes information about 141 possible false positives for unstable benchmarks that are known to sometimes produce them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org