oath-toolkit-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug#1070056: oath-toolkit FTBFS on 32-bit big-endian hppa platform


From: Helge Deller
Subject: Bug#1070056: oath-toolkit FTBFS on 32-bit big-endian hppa platform
Date: Mon, 29 Apr 2024 14:32:31 +0200
User-agent: Mozilla Thunderbird

Source: oath-toolkit
Version: 2.6.11
Tags: ftbfs, patch
X-Debbugs-Cc: deller@debian.org
User: debian-arm@lists.debian.org
Usertags: time-t

As can be seen here:
https://buildd.debian.org/status/fetch.php?pkg=oath-toolkit&arch=hppa&ver=2.6.11-2.1&stamp=1713624192&raw=0
oath-toolkit testsuite fails on hppa like this:

FAIL: oathtool --verbose --totp --now @0 00
expected:
Start time: 1970-01-01 00:00:00 UTC (0)
Current time: 1970-01-01 00:00:00 UTC (0)
got:
Start time: 1970-01-01 00:00:00 UTC (2130640639)
Current time: 1970-01-01 00:00:00 UTC (35)

The failure stems from the fact that hppa is a 32-bit big-endian platform,
and which is the reason as well, why it does not fail on 32-bit little endian 
platforms.
(Although this is not an issue on arm, I nevertheless added the usertag since 
this bug in timet related)

The C-code is similar to this:
printf ("Current time: %ld\n", tim);
where tim is of type "time_t".

time_t can be 32- or 64-bit, depending on compile flags.
On Debian we now did for 32-bit platforms the time64 transition, which
made that value become a 64-bit entity.
So, the "%ld" printf format which defines 32-bit values on hppa does not
fit to the 64-bit tim value stored on the stack. Additionally hppa has
alignment requirements for 64-bit values which are put on the stack, which
is why a wrong value is printed in the testcase.

Solution is either to apply the attached patch, or to make printf
use "%ld" for 32-bit time_t and "%lld" for 64-bit time_t, which needs
to be checked at compile-time.

Attachment: oathtool.c.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]