Commit 2aaac07
authored
### Rationale for this change
See issue #50210. Two JNI CI jobs fail in `gandiva-projector-test` and `gandiva-projector-test-static` with
```bash
[ RUN ] TestProjector.TestCastBitFunction
JIT session error: Symbols not found: [ _Unwind_Resume ]
/arrow/cpp/src/gandiva/tests/projector_test.cc:1978: Failure
```
then a _Segmentation fault_.
Recent commit 4b64398 introduced a few `std::string` error messages into Gandiva precompiled functions. These are JIT-compiled to LLVM bitcode, and `std::string` pulls in `_Unwind_Resume` into bitcode even on error branches never taken.
The JNI build uses [ARROW_GANDIVA_STATIC_LIBSTDCPP="ON"](https://github.com/apache/arrow/actions/runs/27745137529/job/82081554816?pr=50214#step:7:644) (_Include `-static-libstdc++ -static-libgcc...` when linking with Gandiva libraries._), so `_Unwind_Resume` is not exposed for the JIT to resolve.
### 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.
* GitHub Issue: #50210
Authored-by: Tadeja Kadunc <tadeja.kadunc@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 924ee2f commit 2aaac07
2 files changed
Lines changed: 27 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
579 | 581 | | |
580 | 582 | | |
581 | 583 | | |
| |||
2410 | 2412 | | |
2411 | 2413 | | |
2412 | 2414 | | |
2413 | | - | |
2414 | | - | |
2415 | | - | |
2416 | | - | |
2417 | | - | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
2418 | 2421 | | |
2419 | 2422 | | |
2420 | 2423 | | |
2421 | 2424 | | |
2422 | 2425 | | |
2423 | | - | |
2424 | | - | |
2425 | | - | |
2426 | | - | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
2427 | 2431 | | |
2428 | 2432 | | |
2429 | 2433 | | |
2430 | 2434 | | |
2431 | 2435 | | |
2432 | 2436 | | |
2433 | 2437 | | |
2434 | | - | |
2435 | | - | |
2436 | | - | |
2437 | | - | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
2438 | 2444 | | |
2439 | 2445 | | |
2440 | 2446 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
274 | | - | |
275 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
| |||
0 commit comments