[Y2038] Question about porting y2038-tests to glibc

Carlos O'Donell carlos@redhat.com
Thu Oct 29 03:05:33 GMT 2020


On 10/28/20 7:29 AM, Lukasz Majewski wrote:
> Hi Florian,
> 
>> * Lukasz Majewski:
>>
>>> Or maybe somebody has better idea how to solve this issue?  
>>
>> Have time namespaces landed in the upstream kernel?
> 
> Yes, they are supported since 5.6 [1].
> 
> However, according to [2] only CLOCK_MONOTONIC and CLOCK_BOOTIME are
> supported.
> 
> For CLOCK_REALTIME ("NOTES" section):
> 
> "Note that time namespaces do not virtualize the CLOCK_REALTIME clock.
> Virtualization of this clock was avoided for reasons of complexity and
> overhead within the kernel."
> 
> 
> As far as I can see - glibc uses syscalls referring to
> CLOCK_REALTIME not adjusted by time namespaces. This would cause errors.

(1) Namespaces.

I think that time namespaces with CLOCK_REALTIME support are going to be
the only ways in which we properly support these tests.

(2) faketime.

I'm not keen to add another bootstrap dependency, particularly one which
will be depended upon for regression testing. While we do rely on python
for building, we don't want to depend upon anything but core modules.

The implementation of faketime is as expected, an LD_PRELOAD that does
what you want with the time values. This could be achieved locally with
less features and tied directly into the support/* infrastructure or
preloaded.

(3) Partial progress.

In the meantime, as Joseph suggests, some things can be tested without
needing to change the system time.

-- 
Cheers,
Carlos.



More information about the Libc-help mailing list