#2317 closed defect (fixed)

fsfseeko01 invalid on some architectures

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

Description

There is a target dependent issue with fsfseeko01. The value
it seeks to does not necessarily overflow. On some targets,
it remains a valid value. I haven't checked every target but
I recall seeing this test fail during my earlier test runs.
So far I can confirm this test is not valid on the lm32
and or1k.

Works: sparc, psim, jmr3904
Fails: lm32, or1k, simsh

I am not sure how the logic fails but give instructions, we
can probe the gcc's and see what is reported and slipping
through.
The test attempts to pass in an invalid seek value based on
the size of some types and this logic must not be right on
all targets.

* BEGIN OF TEST FSFSEEKO 1 *

Breakpoint 3, test ()

at ../../../../../../../rtems/c/src/../../testsuites/fstests/fsfseeko01/init.c:61

61 rv = fseeko(file, off, SEEK_SET);
(gdb) n
62 rtems_test_assert(rv == 0);
(gdb)
63 rtems_test_assert(errno == 0);
(gdb)
65 errno = 0;
(gdb)
66 actual_long_off = ftell(file);
(gdb) p off
$1 = 2147483647
(gdb) n
67 rtems_test_assert(actual_long_off == -1L);
(gdb) p actual_long_off
$2 = 2147483647
(gdb)

Change History (1)

comment:1 Changed on Apr 8, 2015 at 5:46:55 AM by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: newclosed

In f820f22cf02d5fb08802f91fb31efaa51f63e58a/rtems:

fstests/fsfseeko01: Fix for long == off_t

Close #2317.

Note: See TracTickets for help on using tickets.