Wrong type for timeval.tv_usec on armhf/Noble (and other failures)
Bug #2055837 reported by
Michael Hudson-Doyle
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GLibC |
New
|
Medium
|
|||
glibc (Ubuntu) |
Triaged
|
Critical
|
Simon Chopin |
Bug Description
I xfailed a whole stack of the "conform" tests on armhf, which presumably fail because of the change in default size of time_t (and off_t). We should work out what is going on here before release -- maybe leaving them xfail is appropriate but I'm not confident to say that at this time.
Changed in glibc (Ubuntu): | |
importance: | Undecided → Critical |
tags: | added: foundations-todo |
Changed in glibc (Ubuntu): | |
assignee: | nobody → Simon Chopin (schopin) |
status: | New → Triaged |
summary: |
- understand conform test failures on armhf + Wrong type for timeval.tv_usec on armhf/Noble |
summary: |
- Wrong type for timeval.tv_usec on armhf/Noble + Wrong type for timeval.tv_usec on armhf/Noble (and other failures) |
Changed in glibc: | |
importance: | Unknown → Medium |
status: | Unknown → New |
To post a comment you must log in.
POSIX documents struct timeval as follows:
struct timeval { 8c0559985c54b5b 6b9c7a4a74 ("y2038: Add __USE_TIME_BITS64 support for struct timeval") tv_usec can have __suseconds64_t when using 64-bit time, however suseconds_t is unconditionally typedefed to __suseconds_t.
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
};
Since bdc4782744df73a
That leads to the following:
ubuntu@ mantic- armhf:~ $ cat test.c
#include <sys/time.h>
#include <stdio.h>
#include <assert.h>
int main(void)
printf( "tv_usec: %d, suseconds_t: %d\n", sizeof(tv.tv_usec), sizeof( suseconds_ t));
assert( sizeof( tv.tv_usec) == sizeof( suseconds_ t)); mantic- armhf:~ $ gcc test.c && ./a.out mantic- armhf:~ $ gcc -D_TIME_BITS=64 -D_FILE_ OFFSET_ BITS=64 test.c && ./a.out suseconds_ t)' failed.
{
struct timeval tv;
return 0;
}
ubuntu@
tv_usec: 4, suseconds_t: 4
ubuntu@
tv_usec: 8, suseconds_t: 4
a.out: test.c:9: main: Assertion `sizeof(tv.tv_usec) == sizeof(
Aborted (core dumped)
We noticed this when running the conformance tests on Ubuntu Noble, where we've set _TIME_BITS=64 in the default GCC flags as part of the ongoing t64 transition.