You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The snappy native library terminates with abort signal during initialization with the following error:
terminate called after throwing an instance of '__gnu_cxx::recursive_init_error'
what(): std::exception
The problem occurs on Alpine Linux 3.20.3 with openjdk17 package installed. I have also verified that it does not happen with the openjdk8 with the same Alpine Linux image. On Ubuntu 20 and 22 the problem does not occur in both jdk8 and jdk17.
What I have noted is that Alpine package openjdk17 does not depend on the libstdc++.so and the JVM process does not load it. This means that the call to __cxa_guard_acquire is dynamically resolved to statically linked version of this function in libsnappyjava.so, which does not appear to be thread-safe.
In all other cases I have tried (jdk8 and jdk17 on Ubuntu) the libstdc++.so is loaded by the JVM, and the __cxa_guard_acquire is resolved to the version in libstdc++.so, which seems to be thread-safe.
To reproduce the issue run bellow java program with snappy-java-1.1.10.7.jar and openjdk17 on Alpine Linux 3.20.3. The problem occurs in about 1 of 10 runs.
The snappy native library terminates with abort signal during initialization with the following error:
The problem occurs on Alpine Linux 3.20.3 with openjdk17 package installed. I have also verified that it does not happen with the openjdk8 with the same Alpine Linux image. On Ubuntu 20 and 22 the problem does not occur in both jdk8 and jdk17.
The abort seems to be triggered from initialization of static local variable here https://github.com/google/snappy/blob/main/snappy.cc#L401.
What I have noted is that Alpine package openjdk17 does not depend on the
libstdc++.so
and the JVM process does not load it. This means that the call to__cxa_guard_acquire
is dynamically resolved to statically linked version of this function inlibsnappyjava.so
, which does not appear to be thread-safe.In all other cases I have tried (jdk8 and jdk17 on Ubuntu) the
libstdc++.so
is loaded by the JVM, and the__cxa_guard_acquire
is resolved to the version inlibstdc++.so
, which seems to be thread-safe.To reproduce the issue run bellow java program with snappy-java-1.1.10.7.jar and openjdk17 on Alpine Linux 3.20.3. The problem occurs in about 1 of 10 runs.
The text was updated successfully, but these errors were encountered: