The change

diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c
index ef26b02..3ba32a1 100644
--- a/platform/linux-generic/odp_timer.c
+++ b/platform/linux-generic/odp_timer.c
@@ -659,7 +659,7 @@ static void itimer_init(odp_timer_pool *tp)
        ispec.it_value.tv_sec     = (time_t)sec;
        ispec.it_value.tv_nsec    = (long)nsec;

-       if (timer_settime(&tp->timerid, 0, &ispec, NULL))
+       if (timer_settime(tp->timerid, 0, &ispec, NULL))
                ODP_ABORT("timer_settime() returned error %s\n",
                          strerror(errno));
 }

makes the problem go away, but it stops a bit later, with

odp_timer_test.c:151:test_abs_timeouts():  [7] timeout, tick 402
odp_timer_test.c:151:test_abs_timeouts():  [7] timeout, tick 402
odp_timer_test.c:125:test_abs_timeouts(): odp_timer_set_abs() failed: too early

which I guess is already reported, in

http://lists.linaro.org/pipermail/lng-odp/2015-January/007525.html

Best regards,

Ola D

On 2015-01-14 15:08, Mike Holmes wrote:
I think you have a patch for this already - it needs to say Reported-by
Ola Dahl, maybe Maxim can insert that this time if you don't end up
making a v2

On 14 January 2015 at 09:04, Ola Liljedahl <[email protected]
<mailto:[email protected]>> wrote:

    On 14 January 2015 at 14:55, Mike Holmes <[email protected]
    <mailto:[email protected]>> wrote:
    > Should this be a tacked bug in
    >https://bugs.linaro.org/enter_bug.cgi?product=OpenDataPlane ?
    Yes I guess so.

     >
     > Mike
     >
     > On 14 January 2015 at 06:10, Ola Liljedahl
    <[email protected] <mailto:[email protected]>> wrote:
     >>
     >> On 14 January 2015 at 11:23, Ola Dahl <[email protected]
    <mailto:[email protected]>> wrote:
     >> > Hi,
     >> >
     >> > when I run the ODP timer test on 32-bit Ubuntu, it fails.
     >> >
     >> > I use ODP commit
     >> >
     >> > commit 68c7b7e88b1b948868d35497e715cf5077e90e40
     >> > Author: Mike Holmes <[email protected]
    <mailto:[email protected]>>
     >> > Date:   Fri Jan 2 16:30:16 2015 -0500
     >> >
     >> >     api: odp_coremask: Improve documentation
     >> >
     >> > and the timer test fails as
     >> >
     >> > ubuntu@ubuntu:~/odp$ ./example/timer/odp_timer_test
     >> >
     >> > ODP timer example starts
     >> > odp_buffer_pool.c:90:odp_buffer_pool_init_global():
     >> > Buffer pool init global
     >> > odp_buffer_pool.c:91:odp_buffer_pool_init_global():
    pool_entry_s size
     >> > 256
     >> > odp_buffer_pool.c:92:odp_buffer_pool_init_global():
    pool_entry_t size
     >> > 256
     >> > odp_buffer_pool.c:93:odp_buffer_pool_init_global():
    odp_buffer_hdr_t
     >> > size
     >> > 76
     >> > odp_buffer_pool.c:94:odp_buffer_pool_init_global():
     >> > odp_queue.c:100:odp_queue_init_global():Queue init ...
     >> > odp_queue.c:120:odp_queue_init_global():done
     >> > odp_queue.c:121:odp_queue_init_global():Queue init global
     >> > odp_queue.c:123:odp_queue_init_global():  struct queue_entry_s
    size 192
     >> > odp_queue.c:125:odp_queue_init_global():  queue_entry_t size
           192
     >> > odp_queue.c:126:odp_queue_init_global():
     >> > odp_schedule.c:90:odp_schedule_init_global():Schedule init ...
     >> > odp_schedule.c:142:odp_schedule_init_global():done
     >> >
     >> > ODP system info
     >> > ---------------
     >> > ODP API version: 0.7.0
     >> > CPU model:       Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
     >> > CPU freq (hz):   2388222999
     >> > Cache line size: 64
     >> > Max CPU count:   1
     >> >
     >> > num worker threads: 1
     >> > first CPU:          0
     >> > resolution:         10000 usec
     >> > min timeout:        0 usec
     >> > max timeout:        10000000 usec
     >> > period:             1000000 usec
     >> > timeouts:           30
     >> > odp_timer.c:640:itimer_init():Creating POSIX timer for timer pool
     >> > timer_pool, period 10000000 ns
     >> > odp_timer.c:664:itimer_init():timer_settime() returned error
    Invalid
     >> > argument
     >> The POSIX timer uses CLOCK_MONOTONIC but this should always be
     >> supported me thinks.
     >> The man page has this for EINVAL:
     >>        timer_settime() may fail with the following errors:
     >>
     >>        EINVAL new_value.it_value is negative; or
     >> new_value.it_value.tv_nsec is
     >>               negative or greater than 999,999,999.
     >>
     >>
     >> > Aborted (core dumped)
     >> Can you run again with core dumps enabled (ulimit -c unlimited) and
     >> print the values of the parameters to timer_settime? Or run it
    in gdb.
     >>
     >> > ubuntu@ubuntu:~/odp$
     >> >
     >> > I use Virtualbox and a fresh Ubuntu 32-bit image, prepared using
     >> >
     >> >     3  sudo apt-get install git
     >> >     4  git clone https://git.linaro.org/lng/odp.git
     >> >     5  cd odp
     >> >     7  sudo apt-get install autoconf
     >> >     9  sudo apt-get install autotools-dev
     >> >    11  sudo apt-get install libtool
     >> >    14  ./bootstrap
     >> >    26  sudo apt-get update
     >> >    29  sudo apt-get install libssl-dev
     >> >    30  ./configure
     >> >    36  make all
     >> >    37  ./example/timer/odp_timer_test
     >> This works on my 32-bit ChromeBook2 (ARMv7a) so not a 32-bit
    problem.
     >>
     >> But I do get spurious errors "odp_timer_set_abs() failed: too early"
     >> and the example treats them as fatal errors (they don't have to be,
     >> that's why they are return codes, the application could/should try
     >> again with a later timeout tick). Possibly this is caused by the
     >> worker threads being preempted at the wrong place and so
    attempting to
     >> set timeouts for ticks that have already passed.
     >>
     >> Managed to configure and build odp for 32-bit x86 (I had to install
     >> libssl-dev:i386 package and that had weird side effects on my
     >> installation! gcc was for some reason also uninstalled and had to be
     >> reinstalled).
     >>
     >> And building ODP with "make CFLAGS=-m32", I get the same problem.
     >> 662 if (timer_settime(&tp->timerid, 0, &ispec, NULL))
     >> (gdb) p ispec
     >> $1 = {it_interval = {tv_sec = 0, tv_nsec = 10000000}, it_value =
    {tv_sec =
     >> 0,
     >>     tv_nsec = 10000000}}
     >> (gdb) n
     >> 663 ODP_ABORT("timer_settime() returned error %s\n",
     >> (gdb) n
     >> odp_timer.c:664:itimer_init():timer_settime() returned error Invalid
     >> argument
     >>
     >> Program received signal SIGABRT, Aborted.
     >>
     >> I found the bug:
     >> Current code:
     >> timer_settime(&tp->timerid, 0, &ispec, NULL)
     >> (timer_create some lines above also uses &tp->timerid to get the new
     >> timerid).
     >>
     >> Correct code:
     >> timer_settime(tp->timerid, 0, &ispec, NULL)
     >> Note no "&" on the timerid variable.
     >>
     >> This code was copied from the old timer implementation and has
    worked
     >> on x86-64 and ARMv7a (and other architectures?). And the compiler
     >> doesn't complain...
     >>
     >> 660 ispec.it_value.tv_nsec    = (long)nsec;
     >> (gdb)
     >> 662 if (timer_settime(tp->timerid, 0, &ispec, NULL))
     >> (gdb)
     >> 665 }
     >>
     >>
     >> >
     >> > Best regards,
     >> >
     >> > Ola D
     >> >
     >> > _______________________________________________
     >> > lng-odp mailing list
     >> > [email protected] <mailto:[email protected]>
     >> > http://lists.linaro.org/mailman/listinfo/lng-odp
     >>
     >> _______________________________________________
     >> lng-odp mailing list
     >> [email protected] <mailto:[email protected]>
     >> http://lists.linaro.org/mailman/listinfo/lng-odp
     >
     >
     >
     >
     > --
     > Mike Holmes
     > Linaro  Sr Technical Manager
     > LNG - ODP




--
*Mike Holmes*
Linaro  Sr Technical Manager
LNG - ODP


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to