lseek() past EOF then read() crashes

Joel Sherrill Joel.Sherrill at
Tue Aug 13 13:44:41 UTC 2013

Could you post a small self contained example please?

Nick Withers <nick.withers at> wrote:

Hey all,

(I'm not on the -devel list; please include me in any possible replies,
if you'd like me to see them)

I seem to be able to reliably trigger an exception when using lseek() to
jump past the EOF of a file on IMFS, followed by a read().

I believe this should not occur, per : "No
data transfer shall occur past the current end-of-file. If the starting
position is at or after the end-of-file, 0 shall be returned. If the
file refers to a device special file, the result of subsequent read()
requests is implementation-defined"

This is on an MVME3100 (PowerPC) with Git HEAD RTEMS, circa 2013-08-12.

I've got a stack trace (not totally sure I trust it) if someone'd like?
Perhaps lseek() isn't supported on IMFS? The file in question's been
rtems_tarfs_load()ed there, if that could make a difference...?

If it's meant to work, would you like me to file a bug report with the
stack trace?
Nick Withers

Embedded Systems Programmer
Room 2.26, Building 57
Department of Nuclear Physics
Research School of Physics and Engineering
The Australian National University (CRICOS: 00120C)

eMail: nick.withers at
Phone: +61 2 6125 2091
Mobile: +61 414 397 446

rtems-devel mailing list
rtems-devel at

More information about the devel mailing list