Call for testing: OpenSSH-6.3

Kevin Brott kevin.brott at gmail.com
Sun Aug 4 05:44:30 EST 2013


On 2013-08-03 01:41, Darren Tucker wrote:
> On Sat, Aug 3, 2013 at 5:58 PM, Damien Miller <djm at mindrot.org> wrote:
>>>        Looking at failure logs - this is what's killing it:
>>>        clock_gettime: Invalid argument
> [...]
>> Maybe these platforms lack CLOCK_MONOTONIC? Darren, perhaps we should
>> wrap clock_gettime and have a fallback for platforms that lack this?
> I thought we did.  We check for clock_gettime in configure, and misc.c has:
>
> #if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
>          [...] clock_getttime [...]
> #else
>          return time(NULL);
> #endif
>
> So the fact that it compiled means that CLOCK_MONOTONIC is in the
> headers, but the fact that it failed at runtime indicates that it's
> not actually implemented.
>
> Kevin, could you please try this test program on the problem system?
> You'll probably need to compile it with -lrt.
>
> #include <errno.h>
> #include <stdio.h>
> #include <time.h>
> int main(void)
> {
> 	struct timespec ts;
> 	int r = clock_gettime(CLOCK_MONOTONIC, &ts);
> 	printf("%d %d %ld\n", r, errno, (long)ts.tv_sec);
> }
>
> We could add a runtime fallback in misc.c:monotime() but it'd be kinda ugly.
>

*Similar results on both systems affected ... *

$ cat > test.c
#include <errno.h>
#include <stdio.h>
#include <time.h>
int main(void)
{
         struct timespec ts;
         int r = clock_gettime(CLOCK_MONOTONIC, &ts);
         printf("%d %d %ld\n", r, errno, (long)ts.tv_sec);
}

$ gcc -o test test.c
/tmp/ccoXSQXe.o(.text+0x1a): In function `main':
: undefined reference to `clock_gettime'
collect2: ld returned 1 exit status

$ gcc -lrt -o test test.c

$ file test
test: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped

$ ldd test
         librt.so.1 => /lib/librt.so.1 (0xb7fce000)
         libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
         libpthread.so.0 => /lib/i686/libpthread.so.0 (0xb7f7d000)
         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7fed000)

RHL8$ ./test
-1 22 1108578828

RHEL3$ ./test
-1 22 -1218445280

*For comparison on unaffected Fedora Core 2 system:*
$FC2$ ./test
0 0 2078415

*On the older RHEL 2.1 system - ssh builds and tests fine, yet the test program won't.
*$ gcc -lrt -o test test.c
test.c: In function `main':
test.c:7: `CLOCK_MONOTONIC' undeclared (first use in this function)
test.c:7: (Each undeclared identifier is reported only once
test.c:7: for each function it appears in.)




More information about the openssh-unix-dev mailing list