Subject: bug#68399: GnuTLS fails to build for aarch64 in QEMU

From: Maxim Cournoyer <[email-masked]>
Date: Thu, 18 Jan 2024 22:28:53 -0500

Hi,

Lars Rustand <[email-masked]> writes:

[...]

> --- ./src/gl/tests/test-suite.log -------------------------------------------
>
> ===============================================
>    GnuTLS 3.8.2: src/gl/tests/test-suite.log
> ===============================================
>
> # TOTAL: 167
> # PASS:  166
> # SKIP:  0
> # XFAIL: 0
> # FAIL:  1
> # XPASS: 0
> # ERROR: 0
>
> .. contents:: :depth: 2
>
> FAIL: test-free
> ===============
>
> qemu-aarch64: ../../linux-user/mmap.c:801: mmap_reserve_or_unmap: Assertion `ret == 0' failed.
> **
> ERROR:../../accel/tcg/cpu-exec.c:532:cpu_exec_longjmp_cleanup: assertion failed: (cpu == current_cpu)
> Bail out! ERROR:../../accel/tcg/cpu-exec.c:532:cpu_exec_longjmp_cleanup: assertion failed: (cpu == current_cpu)
> FAIL test-free (exit status: 127)

That one looks like a probable discrepancy due to QEMU emulation more
than a bug in GnuTLS.

On the other hand, we can see from our CI that an aarch64-linux (actual
hardware) build also failed with:

--8<---------------cut here---------------start------------->8---
FAIL: tls13-resume-x509
=======================

client:668: *** Previous session was NOT resumed
try to resume from session ticket (different cipher order)
server:911: server: session_is_resumed error (1)
try to resume from session ticket (different cipher order)
FAIL tls13-resume-x509 (exit status: 1)

FAIL: tls13-early-data
======================

client:472: client: max_early_data_size mismatch -1 != 1024
server:692: server: Handshake has failed (The TLS connection was non-properly terminated.)

FAIL tls13-early-data (exit status: 1)

[...]

FAIL: dtls-repro-20170915
=========================

negotiating DTLS 1.2 with cli-cert
client: Resource temporarily unavailable, try again.
server: The operation timed out
dtls_try_with_key_mtu:578: Handshake failed
FAIL dtls-repro-20170915 (exit status: 1)

FAIL: resume-with-stek-expiration
=================================

testing tls1.2 resumption

STEK was rotated!
client: Handshake was completed
client: Success: Session was NOT resumed
server: Handshake was completed
server: Success: Session was NOT resumed
STEK was rotated!
client: Handshake was completed
client: Success: Session was resumed
server: Handshake was completed
server: Success: Session was resumed
STEK was rotated!
client: Handshake was completed
client: Success: Session was resumed
server: Handshake was completed
server: Success: Session was resumed
STEK was rotated!
client: Handshake was completed
client: Success: Session was NOT resumed
server: Handshake was completed
server: Success: Session was NOT resumed

testing tls1.3 resumption

client: Handshake was completed
client: Success: Session was NOT resumed
STEK was rotated!
server: Handshake was completed
server: Success: Session was NOT resumed
client: Handshake was completed
resume_and_close:140: client: Session was not resumed (but should)
STEK was rotated!
server:253: server: Handshake failed: Error in the push function.
FAIL resume-with-stek-expiration (exit status: 1)
--8<---------------cut here---------------end--------------->8---

See: https://ci.guix.gnu.org/build/3170604/details

We should check whether upstream is already tracking these failures and
disable the tests in the meantime in our package of QEMU for this
architecture.

-- 
Thanks,
Maxim