openssl: Test 30-test_evp_extra broken on master and 3.1 on NonStop platforms

This test is broken around commit 57645339ab. This does not impact 3.0.1 or earlier. The reported platforms are NonStop ia64 (J06.22) and x86 (L21.06) built with c99.

The test fails with SIGSEGV during atexit() processing.

   ok 48 - test_ecx_short_keys
../../util/wrap.pl ../../test/evp_extra_test -context => 139
not ok 2 - running evp_extra_test with a non-default library context

#   Failed test 'running evp_extra_test with a non-default library context'
#   at test/recipes/30-test_evp_extra.t line 22.

with a trace:

(xInspect 1,971):bt
#0  0xfffffffff3bad428 in __process_atexit_functions ()
#1  0xfffffffff3c07871 in CRE_TERMINATOR_ ()
#2  0xfffffffff3d6ac54 in exit ()
#3  0x700d41aa in _MAIN () at \BLPROD.$RTAL.T8432ACM.CMAIN64C:52

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 83 (83 by maintainers)

Commits related to this issue

Most upvoted comments

This no longer blocks the 3.1.0 milestone as the workaround was merged. I am keeping this open for further discussion as the real underlying issue was not fixed by the workaround (but it affects all 3.x branches).

Thanks for the clarification, @t8m. Feeling more positive now 😃

#17483 has just been approved. Since that does seem to fix this issue, I suggest it gets closed.

@levitte I am retesting this situation with the new HEAD on #17483.

Tests worked correctly based on commit 118947f6a7. On to PUT.

good luck!

@rsbeckerca since your target’s atexit does not know about the dso lifetime, I wonder if the pthread_key_create has the same issue here.

We use this API to register a callback that is called whenever a thread terminates, but I think it is not always de-registered, so might crash if a thread terminates after a shared object is unloaded, without properly calling pthread_key_delete.

This is harmless on linux, but maybe you want to try this on your target:

diff --git a/test/testutil/main.c b/test/testutil/main.c
index 6716750..d182d09 100644
--- a/test/testutil/main.c
+++ b/test/testutil/main.c
@@ -12,6 +12,11 @@
 #include "tu_local.h"
 
 
+static void* thread(void*arg)
+{
+  return NULL;
+}
+
 int main(int argc, char *argv[])
 {
     int ret = EXIT_FAILURE;
@@ -36,5 +41,10 @@ int main(int argc, char *argv[])
 end:
     ret = pulldown_test_framework(ret);
     test_close_streams();
+    {
+        pthread_t pthread;
+        if (!pthread_create(&pthread, NULL, thread, NULL))
+            pthread_join(pthread, NULL);
+    }
     return ret;
 }

@levitte I am retesting this situation with the new HEAD on #17483.

That is encouraging indeed