[Bug fortran/61632] Memory corruption on error when writing formatted data

2015-02-11 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 Jerry DeLisle changed: What|Removed |Added Status|NEW |ASSIGNED

[Bug fortran/61632] Memory corruption on error when writing formatted data

2015-01-14 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 Jerry DeLisle changed: What|Removed |Added Severity|normal |enhancement --- Comment #26 from Jerry D

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-25 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 --- Comment #25 from Jerry DeLisle --- Left to do: For format strings greater than 80 characters, shift the view of where the error occurs in the format string so that it will display reasonably well. (If the error occurs after 80 characters in t

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-20 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 --- Comment #24 from Jerry DeLisle --- Author: jvdelisle Date: Sun Jul 20 20:03:41 2014 New Revision: 212875 URL: https://gcc.gnu.org/viewcvs?rev=212875&root=gcc&view=rev Log: 2014-07-20 Jerry DeLisle PR libgfortran/61632 * io/format

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-20 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 --- Comment #23 from Jerry DeLisle --- (In reply to Dominique d'Humieres from comment #22) > > (1) my understanding of > > offset = (j > 60) ? j - 40 : 0; > > j -= offset; > width = dtp->format_len - offset; > > is to set j to 40 and

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-20 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 --- Comment #22 from Dominique d'Humieres --- > Created attachment 33160 [details] > Updated patch taking care of valgrind error > > This patch includes fixing the valgrind error by allocating and setting > the NULL byte at the end of the format

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-20 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 Jerry DeLisle changed: What|Removed |Added Attachment #33155|0 |1 is obsolete|

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-18 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 Jerry DeLisle changed: What|Removed |Added Attachment #33114|0 |1 is obsolete|

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-15 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 --- Comment #19 from Jerry DeLisle --- (In reply to Dominique d'Humieres from comment #15) > > Its sort of like Steve said earlier. The coder is choosing to ignore an > > error condition so anything gfortran does is valid. In this case the > >

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-15 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 --- Comment #18 from Dominique d'Humieres --- > I did not say that iostat had to be used. However, one can find > things like: > > 9.10.1 Error conditions and the ERR= specifier > > If an error condition occurs during execution of an input/

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-15 Thread sgk at troutmask dot apl.washington.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 --- Comment #17 from Steve Kargl --- On Tue, Jul 15, 2014 at 09:08:44AM +, dominiq at lps dot ens.fr wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 > > --- Comment #15 from Dominique d'Humieres --- > > Its sort of like Steve sa

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-15 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 --- Comment #16 from Dominique d'Humieres --- > This: > > +fmt->format_string_len = strrchr (f->source, ')') - f->source + 1; > >Is taking the difference between two string pointers, ie memory addresses > > This: > > printf("pos 0 =%x, pos )

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-15 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 --- Comment #15 from Dominique d'Humieres --- > Its sort of like Steve said earlier. The coder is choosing to ignore an > error condition so anything gfortran does is valid. In this case the > output got writen to buffer before the error occurr

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-14 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 --- Comment #14 from Jerry DeLisle --- (In reply to Dominique d'Humieres from comment #10) --- snip --- > > Is the printing of 'YYY' supposed to happen? Its sort of like Steve said earlier. The coder is choosing to ignore an error condition

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-14 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 --- Comment #13 from Jerry DeLisle --- This: +fmt->format_string_len = strrchr (f->source, ')') - f->source + 1; Is taking the difference between two string pointers, ie memory addresses This: printf("pos 0 =%x, pos ) =%x\n",strchr (f->s

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 --- Comment #12 from Dominique d'Humieres --- A little bit less clumsy if (f != NULL) -fmt->format_string = f->source; +fmt->format_string_len = strrchr (f->source, ')') - f->source + 1; I don't understand why +fmt->format_strin

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 --- Comment #11 from Dominique d'Humieres --- > Its not really a glitch. In this case reversion has occurred so i can only > approximate where in the string the error occured. I can improve on it with: > > offset = fmt->reversion_ok ? fmt->fo

[Bug fortran/61632] Memory corruption on error when writing formatted data

2014-07-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632 --- Comment #10 from Dominique d'Humieres --- The following code program p call ss0() end program p subroutine ss0 CHARACTER(3), save :: ZTYP(3) DATA ZTYP /'XXX','YYY','ZZZ'/ write(*,600,IOSTAT=iosa) 'AA