This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/25835] Segfault or Bad Address error on unformatted sequential READ
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jan 2006 02:12:40 -0000
- Subject: [Bug libfortran/25835] Segfault or Bad Address error on unformatted sequential READ
- References: <bug-25835-10743@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from jvdelisle at gcc dot gnu dot org 2006-01-18 02:12 -------
The following chunk from fd_alloc is where the problem occurs. Get rid of
setting active to zero and the error goes away, but regression occurs in
direct_io_2.f90. Perhaps active needs to be set to zero somewhere else.
/* Salvage bytes currently within the buffer. This is important for
* devices that cannot seek. */
if (s->buffer != NULL && s->buffer_offset <= where &&
where <= s->buffer_offset + s->active)
{
n = s->active - (where - s->buffer_offset);
memmove (new_buffer, s->buffer + (where - s->buffer_offset), n);
s->active = n;
}
else
{ /* new buffer starts off empty */
s->active = 0; /* Don't execute this line to make case work.
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25835