[Bug libfortran/20156] gfortran - bus error on backspace
--- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-04-03 08:04 --- Subject: Bug 20156 CVSROOT:/cvs/gcc Module name:gcc Branch: gcc-4_0-branch Changes by: [EMAIL PROTECTED] 2005-04-03 08:04:04 Modified files: gcc/testsuite : ChangeLog libgfortran: ChangeLog libgfortran/io : backspace.c Added files: gcc/testsuite/gfortran.dg: backspace.f Log message: PR libfortran/20068 PR libfortran/20125 PR libfortran/20156 PR libfortran/20471 * io/backspace.c (unformatted_backspace): Fix error in arithmetic. (st_backspace): When in WRITING mode, we flush and falling back into READING mode. In all cases, correctly position the stream. * gfortran.dg/backspace.f: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcconly_with_tag=gcc-4_0-branchr1=1.5084.2.90r2=1.5084.2.91 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/backspace.f.diff?cvsroot=gcconly_with_tag=gcc-4_0-branchr1=NONEr2=1.1.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcconly_with_tag=gcc-4_0-branchr1=1.163.2.13r2=1.163.2.14 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/backspace.c.diff?cvsroot=gcconly_with_tag=gcc-4_0-branchr1=1.9r2=1.9.12.1 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20156
[Bug libfortran/20156] gfortran - bus error on backspace
--- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-04-03 08:07 --- Subject: Bug 20156 CVSROOT:/cvs/gcc Module name:gcc Changes by: [EMAIL PROTECTED] 2005-04-03 08:07:43 Modified files: gcc/testsuite : ChangeLog libgfortran: ChangeLog libgfortran/io : backspace.c Added files: gcc/testsuite/gfortran.dg: backspace.f Log message: PR libfortran/20068 PR libfortran/20125 PR libfortran/20156 PR libfortran/20471 * io/backspace.c (unformatted_backspace): Fix error in arithmetic. (st_backspace): When in WRITING mode, we flush and falling back into READING mode. In all cases, correctly position the stream. * gfortran.dg/backspace.f: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gccr1=1.5270r2=1.5271 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/backspace.f.diff?cvsroot=gccr1=1.1r2=1.2 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gccr1=1.180r2=1.181 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/backspace.c.diff?cvsroot=gccr1=1.9r2=1.10 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20156
[Bug libfortran/20156] gfortran - bus error on backspace
--- Additional Comments From fxcoudert at gcc dot gnu dot org 2005-04-03 08:10 --- Fixed. -- What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED Target Milestone|--- |4.0.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20156
[Bug libfortran/20156] gfortran - bus error on backspace
--- Additional Comments From dir at lanl dot gov 2005-02-26 03:28 --- I looked into the fortran source code and found a quick fix for the the backspace bugs that were stopping my programs. In source file backspace.c. 1). changed new = file_position (current_unit-s) - *p - length; to new = file_position (current_unit-s) - *p - 2*length; 2). deleted if (u-current_record) next_record (1); 3). added if (u-mode==WRITING){ flush(u-s); struncate (u-s); u-mode = READING; } 4). added u-endfile = NO_ENDFILE; u-current_record = 0; These changes fix bugs 20125 and 20156 and a few others that I had not yet reported. I have run 48 test problems with 5 of my programs on the Macintosh with these changes and they all ran correctly. If this is of value to the person that actually fixes these problems please feel free to use it in any way. [dir:~/fe/mystic/decks] dir% diff -c /Users/dir/gfortran/gcc/libgfortran/io/backspace.c /Users/dir/junk/io/backspace.c *** /Users/dir/gfortran/gcc/libgfortran/io/backspace.c Fri Feb 25 18:48:05 2005 --- /Users/dir/junk/io/backspace.c Wed Jan 12 13:27:30 2005 *** *** 111,117 if (p == NULL) goto io_error; ! new = file_position (current_unit-s) - *p - 2*length; if (sseek (current_unit-s, new) == FAILURE) goto io_error; --- 111,117 if (p == NULL) goto io_error; ! new = file_position (current_unit-s) - *p - length; if (sseek (current_unit-s, new) == FAILURE) goto io_error; *** *** 155,175 u-endfile = AT_ENDFILE; else { if (file_position (u-s) == 0) goto done; /* Common special case */ ! if (u-mode==WRITING){ ! flush(u-s); ! struncate (u-s); !u-mode = READING; ! } if (u-flags.form == FORM_FORMATTED) formatted_backspace (); else unformatted_backspace (); - u-endfile = NO_ENDFILE; - u-current_record = 0; } - done: library_end (); --- 155,171 u-endfile = AT_ENDFILE; else { + if (u-current_record) + next_record (1); + if (file_position (u-s) == 0) goto done; /* Common special case */ ! if (u-flags.form == FORM_FORMATTED) formatted_backspace (); else unformatted_backspace (); } done: library_end (); -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20156
[Bug libfortran/20156] gfortran - bus error on backspace
--- Additional Comments From kargl at gcc dot gnu dot org 2005-02-26 06:28 --- Dale, I believe Bud Davis or Thomas Koening are the logical people to look at your patch. If either one doesn't pursue your patch within the next week drop me an email. One thing to keep in mind. The patch here is fairly minimal so it probably doesn't need copyright assignment paperwork on file with FSF. However, if you send additional patches (which I strongly encourage :-) and if you don't have paperwork on file with the FSF, please consider pursuing assignment. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20156
[Bug libfortran/20156] gfortran - bus error on backspace
-- What|Removed |Added Component|fortran |libfortran http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20156
[Bug libfortran/20156] gfortran - bus error on backspace
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-23 14:20 --- Confirmed. -- What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed||1 Last reconfirmed|-00-00 00:00:00 |2005-02-23 14:20:59 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20156