Commit 3f5e937
committed
Handle failure in
`ffi_closure_alloc` may fail and return `NULL` if, for instance, we're
running in a locked-down operating system that forbids FFI from
allocating executable pages of memory in any of the ways that it tries.
Today we pass this `NULL` on to `ffi_prep_closure_loc` which triggers a
segmentation fault that takes down the whole JVM. With this change we
check for a failure in this call and turn it into an
`UnsupportedOperationException` so that the caller can handle it more
gracefully.
Relates elastic/elasticsearch#73309
Relates elastic/elasticsearch#18272ffi_closure_alloc
1 parent 030411b commit 3f5e937
2 files changed
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3466 | 3466 | | |
3467 | 3467 | | |
3468 | 3468 | | |
| 3469 | + | |
| 3470 | + | |
| 3471 | + | |
| 3472 | + | |
| 3473 | + | |
3469 | 3474 | | |
3470 | 3475 | | |
3471 | 3476 | | |
| |||
3514 | 3519 | | |
3515 | 3520 | | |
3516 | 3521 | | |
| 3522 | + | |
3517 | 3523 | | |
3518 | 3524 | | |
3519 | 3525 | | |
3520 | 3526 | | |
3521 | 3527 | | |
| 3528 | + | |
| 3529 | + | |
| 3530 | + | |
| 3531 | + | |
| 3532 | + | |
3522 | 3533 | | |
| 3534 | + | |
| 3535 | + | |
| 3536 | + | |
| 3537 | + | |
| 3538 | + | |
| 3539 | + | |
3523 | 3540 | | |
3524 | 3541 | | |
3525 | 3542 | | |
3526 | 3543 | | |
| 3544 | + | |
| 3545 | + | |
| 3546 | + | |
3527 | 3547 | | |
3528 | 3548 | | |
3529 | 3549 | | |
| |||
0 commit comments