#1065906 termrec: FTBFS on arm{el,hf}: 5: loading and saving asciicasts to/from memory FAILED (testsuite.at:21)

Package:
src:termrec
Source:
src:termrec
Submitter:
Sebastian Ramacher
Date:
2025-09-01 21:59:01 UTC
Severity:
normal
Tags:
#1065906#5
Date:
2024-03-10 18:14:37 UTC
From:
To:
Source: termrec
Version: 0.19-2.1
Severity: serious
Tags: ftbfs
Justification: fails to build from source (but built successfully in the past)
X-Debbugs-Cc: sramacher@debian.org

https://buildd.debian.org/status/fetch.php?pkg=termrec&arch=armhf&ver=0.19-2.1&stamp=1709537467&raw=0

libtool: link: gcc -I.. -I../libtty/ -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -Wall -std=gnu11 -Wall -Wwrite-strings -Wstrict-prototypes -Wshadow -Wmissing-prototypes -Wno-unused-parameter -Wno-bitwise-op-parentheses -Wno-logical-op-parentheses -Wno-dangling-else -Wl,-z -Wl,relro -Wl,-z -Wl,now -o .libs/vtgen vtgen.o  -L.. /<<PKGBUILDDIR>>/.libs/libtty.so ../.libs/libutils.a -lcurl
make[4]: Leaving directory '/<<PKGBUILDDIR>>/tests'
/usr/bin/make  check-local
make[4]: Entering directory '/<<PKGBUILDDIR>>/tests'
{				      \
  echo '# Signature of the current package.'; \
  echo 'm4_define([AT_PACKAGE_NAME],      [termrec])'; \
  echo 'm4_define([AT_PACKAGE_TARNAME],   [termrec])'; \
  echo 'm4_define([AT_PACKAGE_VERSION],   [0.19])'; \
  echo 'm4_define([AT_PACKAGE_STRING],    [termrec 0.19])'; \
  echo 'm4_define([AT_PACKAGE_BUGREPORT], [kilobyte@angband.pl])'; \
  echo 'm4_define([AT_TESTS], [])'; \
} >./package.m4
/bin/bash '/<<PKGBUILDDIR>>/missing' autom4te --language=autotest -I . testsuite.at -o testsuite.tmp
mv testsuite.tmp testsuite
/bin/bash ./testsuite
## ------------------------ ##
## termrec 0.19 test suite. ##
## ------------------------ ##
  1: seeks                                           ok
  2: timeval arithmetics                             ok
  3: recording                                       ok
  4: loading and saving ttyrecs to/from memory       ok
  5: loading and saving asciicasts to/from memory    FAILED (testsuite.at:21)
  6: loading and saving v1 asciicasts to/from memory FAILED (testsuite.at:24)
  7: loading and saving ttyrecs to memory (.gz)      ok
  8: loading and saving ttyrecs to memory (.bz2)     ok
  9: loading and saving ttyrecs to memory (.xz)      ok
 10: loading and saving ttyrecs to memory (.zst)     ok
 11: split UTF-8 for asciicast                       ok
 12: vt100 sequences                                 ok
 13: long vt100 writes                               ok
 14: vt-on-vt                                        ok
 15: replayed onto vt                                ok
 16: fuzzing vt                                      ok


...

   5: testsuite.at:20    loading and saving asciicasts to/from memory
   6: testsuite.at:23    loading and saving v1 asciicasts to/from memory

## ---------------------- ##
## Detailed failed tests. ##
## ---------------------- ##

#                             -*- compilation -*-
5. testsuite.at:20: testing loading and saving asciicasts to/from memory ...
./testsuite.at:21: rec test.cast && loadsave test.cast out.cast && cmp test.cast out.cast
--- /dev/null	2024-02-28 22:20:30.000000000 +0000
+++ /<<PKGBUILDDIR>>/tests/testsuite.dir/at-groups/5/stdout	2024-03-04 07:30:59.654414192 +0000
@@ -0,0 +1 @@
+test.cast out.cast differ: char 38, line 1
./testsuite.at:21: exit code was 1, expected 0
5. testsuite.at:20: 5. loading and saving asciicasts to/from memory (testsuite.at:20): FAILED (testsuite.at:21)

#                             -*- compilation -*-
6. testsuite.at:23: testing loading and saving v1 asciicasts to/from memory ...
./testsuite.at:24: rec test.cast-v1 && loadsave test.cast-v1 out.cast-v1 && cmp test.cast-v1 out.cast-v1
--- /dev/null	2024-02-28 22:20:30.000000000 +0000
+++ /<<PKGBUILDDIR>>/tests/testsuite.dir/at-groups/6/stdout	2024-03-04 07:30:59.730414550 +0000
@@ -0,0 +1 @@
+test.cast-v1 out.cast-v1 differ: char 41, line 1
./testsuite.at:24: exit code was 1, expected 0
6. testsuite.at:23: 6. loading and saving v1 asciicasts to/from memory (testsuite.at:23): FAILED (testsuite.at:24)


 Cheers

#1065906#10
Date:
2025-09-01 21:24:51 UTC
From:
To:
Control: severity -1 important
Control: tags -1 fixed-upstream

Caused by the 32->64 bit time_t transition.  Alas, there's no portable way
to print time_t.

Fixed in upstream git.

As for the package, I followed a cunning plan to downgrade this bug: it's
no longer a regression (cuz no prev version in testing, or stable for that
matter), and a missing arch is allowed.  Downgrading, thus.

The real fix is:
--- a/libtty/asciicast.c
+++ b/libtty/asciicast.c
@@ -487,7 +487,7 @@ void record_asciicast(FILE *f, void* state, const struct timeval *tm, const char
        fprintf(f, "{\"version\":%d, \"width\":%d, \"height\":%d",
            as->version, vt->sx, vt->sy);
        if (as->ts.tv_sec)
            fprintf(f, ", \"timestamp\":%ld", as->ts.tv_sec);
            fprintf(f, ", \"timestamp\":%lld", (long long int)as->ts.tv_sec);
        if (as->version == 1)
            fprintf(f, ", \"stdout\":[\n");
        else


Meow!