Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#2296 closed defect (fixed)

powerpc psxualarm01 Failure

Reported by: Joel Sherrill Owned by: Joel Sherrill
Priority: normal Milestone: 4.11
Component: unspecified Version: 4.11
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

Assigning this to Sebastian and politely asking that he tries this on real hardware.

psxualarm01 fails on psim at init.c:95. I added the Status print.

* BEGIN OF TEST PSXUALARM *
Init's ID is 0x0b010001
Init: ualarm in 1 us
Status=4294
../../../../../../../rtems/c/src/../../testsuites/psxtests/psxualarm/init.c: 96 status == 0

Tracing, sleep() calls nanosleep(). nanosleep() appears to complete that the sleep() didn't block at all and there are 10 seconds remaining. The sleep() call in newlib doesn't appear to have the correct value in its ts variable and ts.tv_sec is 4294 consistent with the value printed.

Can you check this on real PowerPC hardware and see if it happens there? I am concerned that this is something odd beyond a coding bug (which I don't think there is).

Thanks.

Change History (4)

comment:1 Changed on 03/11/15 at 17:29:40 by Joel Sherrill

Hmmm... maybe an underflow:

(gdb) p ticks
$5 = 1000
(gdb) n
97 ticks -= executing->Timer.stop_time - executing->Timer.start_time;
(gdb)
99 _Timespec_From_ticks( ticks, rmtp );
(gdb)
108 if ( ticks )
(gdb) p ticks
$6 = 4294967292
(gdb) p *rmtp
$7 = {tv_sec = 4294, tv_nsec = 927296000}
(gdb) p executing->Timer
$8 = {Node = {next = 0x2aa24 <_POSIX_signals_Ualarm_timer>,

previous = 0x2c3f4 <_Watchdog_Ticks_chain>}, state = WATCHDOG_INACTIVE,

initial = 1000, delta_interval = 0, start_time = 300, stop_time = 1304,
routine = 0x14808 <_Thread_Delay_ended>, id = 0, user_data = 0x32a30}

It took 1004 ticks to fire but we were only waiting for 1000.

comment:2 Changed on 03/11/15 at 17:38:41 by Joel Sherrill

Milestone: 4.11.14.11
Owner: changed from Sebastian Huber to Joel Sherrill
Status: newassigned

comment:3 Changed on 03/11/15 at 17:38:53 by Joel Sherrill

I have a pending patch and am testing this.

comment:4 Changed on 03/12/15 at 18:34:01 by Joel Sherrill <joel.sherrill@…>

Resolution: fixed
Status: assignedclosed

In [changeset:"d937d364af95fec2e9a7a4af4dca6ac7d23397b2/rtems"]:

posix/src/nanosleep.c: Address issue when delay is longer than desired

This resulted in the elapsed time going below 0 and an arbitrarily large
number returned as the time remaining.

closes #2296.

Note: See TracTickets for help on using tickets.