[OE-core] eglibc: powerpc time related syscall malfunction - solved

Mats Kärrman Mats.Karrman at tritech.se
Fri Mar 28 12:08:28 UTC 2014


On Wednesday, March 26, 2014 5:10 PM, Mats Kärrman wrote:
> Hi,
>
> The system is an OE-Core Dora "distro-less" build for a 32-bit PowerPC MPC5125.
> Tune file used is tune-ppce300c3.inc.
> eglibc version 2.18, gcc 4.8.1, binutils 2.23.2 (Dora defaults).
> 
> The symptom that made me discover the problem was that some programs could not
> get the correct system time while others could. The failing ones often got the same
> "insane" time value every time a specific printout was triggered but different printouts
> got different time values (i.e. probably uninitialized stack variables). E.g.:
> 
> "date" (busybox) works.
> "logger" (same busybox binary) does not.
> Neither does the pppd (syslog too).
> File access dates are OK.
> A proprietary program using ftime() is not working.
> A little test program (see below) gets the correct time when using time() but not
> when using ftime().
> 
> The same HW with SW built on OE-classic 2011.03 does not have this error.
> Dora on i.MX6 also works OK.
> 
> I tried different kernels (3.2 and 3.12), and different tunings (hard-float, soft-float, etc.)
> but the behavior is the same.
> 
> Tried using strace and found that on the old OE-classic and on i.MX6 I got trace
> logs for the syscalls to time (OE-classic) or gettimeofday (i.MX6) but for the
> new system there are no time related calls traced at all, not when it works
> and not when it fails...
> 
> Then I tried with gdb. The paths taken by the program depends a lot on the
> machine tuning options used when building the image and SDK but I believe I
> have found a common pattern:
> When it works, a time function invoking a syscall, e.g. __kernel_time, is called
> but when it doesn't work, instead a "gnu_indirect_function" is called, returning
> a pointer to either a vdso or a local function but after that the function isn't
> called. As I understand it, this should happen through as/ld magic but for some
> reason it doesn't.
>

As it turned out, this is a known problem with powerpc and eglibc 2.18.
In 2.17 the use of vdso and indirect functions was not introduced yet and
in 2.19 it is fixed.

The fact that the functions are implemented as vdso calls for later kernels
also explains why they are not visible to strace (the same is true for x86_64).

I will send a patch containing a backport of the fix for Dora / eglibc 2.18 shortly.

/M



More information about the Openembedded-core mailing list