Intermittent segfault / SIGSEGV in gcr:gck / object test
Spotted this when enabling tests on the gcr4
package on Alpine Linux, see aports!63893. The CI seems to have an intermittent failure in the gcr:gck / object
test, always crashing after the # Gck-DEBUG: matching: (1) [ { CKA_LABEL = (9) "blah blah" } ]
line, but before the ok 8 /gck/object/find_objects
message is printed. (edit: also got this to happen after the # Gck-DEBUG: matching: (1) [ { CKA_LABEL = (12) "UNIQUE LABEL" } ]
line once)
While I'd like to provide a backtrace, I haven't been able to reproduce this locally yet; if I manage to get this to happen, I'll update this issue. I'm hoping that just vaguely knowing where this test fails might be enough to figure it out. (I tried adding some debug messages in the test but I failed to reproduce the issue with them on as well...)
Full log
1/43 gcr:egg / asn1 OK 0.40s
2/43 gcr:egg / asn1x OK 0.39s
3/43 gcr:egg / dn OK 0.39s
4/43 gcr:egg / decimal OK 0.38s
5/43 gcr:egg / hex OK 0.38s
6/43 gcr:egg / hkdf OK 0.37s
7/43 gcr:egg / oid OK 0.37s
8/43 gcr:egg / padding OK 0.36s
9/43 gcr:egg / symkey OK 0.35s
10/43 gcr:egg / armor OK 0.35s
11/43 gcr:egg / openssl OK 0.34s
12/43 gcr:egg / dh OK 0.33s
13/43 gcr:gck / attributes OK 0.33s
14/43 gcr:gck / module OK 0.32s
15/43 gcr:gck / slot OK 0.31s
16/43 gcr:gck / session OK 0.31s
17/43 gcr:gck / object FAIL 0.30s killed by signal 11 SIGSEGV
>>> MALLOC_PERTURB_=218 LD_LIBRARY_PATH=/builds/knuxify/aports/community/gcr4/src/gcr-4.2.1/output/gck ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 /builds/knuxify/aports/community/gcr4/src/gcr-4.2.1/output/gck/test-gck-object
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
TAP version 13
# random seed: R02S69e909dc5528aba1196d3c011ea152d7
1..8
# Start of gck tests
# Start of object tests
ok 1 /gck/object/object_props
ok 2 /gck/object/object_equals_hash
# Gck-DEBUG: created object: (4) [ { CKA_CLASS = CKO_DATA }, { CKA_LABEL = (10) "TEST LABEL" }, { CKA_TOKEN = (1) "\x00" }, { CKA_VALUE = (4) NOT-PRINTED } ]
# Gck-DEBUG: created object: (4) [ { CKA_CLASS = CKO_DATA }, { CKA_LABEL = (10) "TEST LABEL" }, { CKA_TOKEN = (1) "\x00" }, { CKA_VALUE = (4) NOT-PRINTED } ]
ok 3 /gck/object/create_object
# Gck-DEBUG: created object: (3) [ { CKA_CLASS = CKO_DATA }, { CKA_LABEL = (11) "TEST OBJECT" }, { CKA_TOKEN = (1) "\x01" } ]
# Gck-DEBUG: created object: (3) [ { CKA_CLASS = CKO_DATA }, { CKA_LABEL = (11) "TEST OBJECT" }, { CKA_TOKEN = (1) "\x01" } ]
ok 4 /gck/object/destroy_object
ok 5 /gck/object/get_attributes
ok 6 /gck/object/get_data_attribute
ok 7 /gck/object/set_attributes
# Gck-DEBUG: created object: (2) [ { CKA_CLASS = CKO_DATA }, { CKA_LABEL = (12) "UNIQUE LABEL" } ]
# Gck-DEBUG: created object: (2) [ { CKA_CLASS = CKO_DATA }, { CKA_LABEL = (11) "OTHER LABEL" } ]
# Gck-DEBUG: matching: (1) [ { CKA_LABEL = (12) "UNIQUE LABEL" } ]
# Gck-DEBUG: matching: (0) [ ]
# Gck-DEBUG: matching: (1) [ { CKA_LABEL = (9) "blah blah" } ]
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
18/43 gcr:gck / crypto OK 0.30s
19/43 gcr:gck / uri OK 0.29s
20/43 gcr:gck / enumerator OK 0.28s
21/43 gcr:gck / modules OK 0.28s
22/43 gcr:gcr-ssh-agent / util OK 0.25s
23/43 gcr:gcr / util OK 0.23s
24/43 gcr:gcr / secret-exchange OK 0.23s
25/43 gcr:gcr / simple-certificate OK 0.22s
26/43 gcr:gcr / certificate OK 0.21s
27/43 gcr:gcr / certificate-chain OK 0.20s
28/43 gcr:gcr / fingerprint OK 0.19s
29/43 gcr:gcr / pkcs11-certificate OK 0.19s
30/43 gcr:gcr / openpgp OK 0.18s
31/43 gcr:gcr / openssh OK 0.17s
32/43 gcr:gcr / trust OK 0.15s
33/43 gcr:gcr / record OK 0.14s
34/43 gcr:gcr / secure-memory OK 0.17s
35/43 gcr:gcr-ssh-agent / process OK 0.30s
36/43 gcr:gcr / subject-public-key OK 0.22s
37/43 gcr:gcr / gnupg-process OK 0.14s
38/43 gcr:gcr / ssh-askpass OK 0.13s
39/43 gcr:gcr / parser OK 0.48s
40/43 gcr:gcr-ssh-agent / service OK 0.77s
41/43 gcr:egg / secmem OK 1.10s
42/43 gcr:gcr-ssh-agent / preload OK 3.03s
43/43 gcr:gcr / system-prompt OK 4.56s
Summary of Failures:
17/43 gcr:gck / object FAIL 0.30s killed by signal 11 SIGSEGV
Ok: 42
Expected Fail: 0
Fail: 1
Unexpected Pass: 0
Skipped: 0
Timeout: 0
Full log written to /builds/knuxify/aports/community/gcr4/src/gcr-4.2.1/output/meson-logs/testlog.txt
I also got it to fail earlier, right after # Gck-DEBUG: matching: (1) [ { CKA_LABEL = (12) "UNIQUE LABEL" } ]
.