Skip to content

Commit cd7c7b3

Browse files
authored
Note libffi error message in tmpdir docs (#83662) (#83671)
In #80617 we upgraded to a version of JNA which would report the message `Failed to allocate closure` if the temp dir for `libffi` did not permit executables (rather than crashing with a segfault). This commit extends the docs to mention this message.
1 parent 82dee7f commit cd7c7b3

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

docs/reference/setup/sysconfig/executable-jna-tmpdir.asciidoc

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[executable-jna-tmpdir]]
2-
=== JNA temporary directory not mounted with `noexec`
2+
=== Ensure JNA temporary directory permits executables
33

44
[NOTE]
55
This is only relevant for Linux.
@@ -16,8 +16,9 @@ some hardened Linux installations mount `/tmp` with the `noexec` option by
1616
default. This prevents JNA and `libffi` from working correctly. For instance,
1717
at startup JNA may fail to load with an `java.lang.UnsatisfiedLinkerError`
1818
exception or with a message that says something similar to
19-
`failed to map segment from shared object`. Note that the exception message can
20-
differ amongst JVM versions. Additionally, the components of {es} that rely on
19+
`failed to map segment from shared object`, or `libffi` may report a message
20+
such as `failed to allocate closure`. Note that the exception messages can
21+
differ between JVM versions. Additionally, the components of {es} that rely on
2122
execution of native code via JNA may fail with messages indicating that it is
2223
`because JNA is not available`.
2324

@@ -31,7 +32,9 @@ instance:
3132
export ES_TMPDIR=/usr/share/elasticsearch/tmp
3233
--------------------------------------------
3334

34-
Alternatively, you can configure the path that JNA uses for its temporary files
35-
with the <<set-jvm-options,JVM flag>> `-Djna.tmpdir=<path>` and you can
36-
configure the path that `libffi` uses for its temporary files with the
37-
`LIBFFI_TMPDIR` environment variable.
35+
If you need finer control over the location of these temporary files, you can
36+
also configure the path that JNA uses with the <<set-jvm-options,JVM flag>>
37+
`-Djna.tmpdir=<path>` and you can configure the path that `libffi` uses for its
38+
temporary files by setting the `LIBFFI_TMPDIR` environment variable. Future
39+
versions of {es} may need additional configuration, so you should prefer to set
40+
`ES_TMPDIR` wherever possible.

0 commit comments

Comments
 (0)