https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61632

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
With the following reduced test

      program p
      CHARACTER(3), save :: ZTYP(3)
      DATA ZTYP /'XXX','YYY','ZZZ'/
      write(*,600,IOSTAT=iosa) 0.0,ZTYP
      if (iosta /= 0) print *, 'error'
      write(*,600,IOSTAT=iosa) 0.0,ZTYP
      if (iosta /= 0) print *, 'error'
 600  FORMAT(1PE13.5,4X,A3)
      end program p

valgrind reports

==95142== Memcheck, a memory error detector
==95142== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==95142== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==95142== Command: a.out
==95142== 
  0.00000E+00    XXX
 error
  0.00000E+00    XXX
==95142== Invalid write of size 8
==95142==    at 0x1000DCF40: _gfortrani_format_error (in
/opt/gcc/gcc4.10w/lib/libgfortran.3.dylib)
==95142==    by 0x6F66204C4145521F: ???
==95142==    by 0x33206D6574692071: ???
==95142==    by 0x6D726F66206E691F: ???
==95142==    by 0x7274206465747460: ???
==95142==    by 0x202C726566736E60: ???
==95142==    by 0x5241484320746F66: ???
==95142==    by 0xA5245544340: ???
==95142==    by 0x32AAABA6: ???
==95142==  Address 0x7fff5f7adda9 is not stack'd, malloc'd or (recently) free'd
==95142== 
==95142== Invalid read of size 8
==95142==    at 0x1000DCF45: _gfortrani_format_error (in
/opt/gcc/gcc4.10w/lib/libgfortran.3.dylib)
==95142==    by 0x6F66204C4145521F: ???
==95142==    by 0x33206D6574692071: ???
==95142==    by 0x6D726F66206E691F: ???
==95142==    by 0x7274206465747460: ???
==95142==    by 0x202C726566736E60: ???
==95142==    by 0x5241484320746F66: ???
==95142==    by 0xA5245544340: ???
==95142==    by 0x32AAABA6: ???
==95142==  Address 0x10045166c is not stack'd, malloc'd or (recently) free'd
==95142== 
==95142== 
==95142== Process terminating with default action of signal 11 (SIGSEGV)
==95142==  General Protection Fault
==95142==    at 0x100298FC1: dyld_stub_binder (in /usr/lib/libSystem.B.dylib)
==95142==    by 0x10013502F: ??? (in /opt/gcc/gcc4.10w/lib/libgfortran.3.dylib)
==95142==    by 0x10013502F: ??? (in /opt/gcc/gcc4.10w/lib/libgfortran.3.dylib)
==95142==    by 0x6F66204C4145521F: ???
==95142==    by 0x33206D6574692071: ???
==95142==    by 0x6D726F66206E691F: ???
==95142==    by 0x7274206465747460: ???
==95142==    by 0x202C726566736E60: ???
==95142==    by 0x5241484320746F66: ???
==95142==    by 0xA5245544340: ???
==95142==    by 0x4FFFFF: ???
==95142== 
==95142== HEAP SUMMARY:
==95142==     in use at exit: 7,732 bytes in 21 blocks
==95142==   total heap usage: 23 allocs, 2 frees, 8,244 bytes allocated
==95142== 
==95142== LEAK SUMMARY:
==95142==    definitely lost: 0 bytes in 0 blocks
==95142==    indirectly lost: 0 bytes in 0 blocks
==95142==      possibly lost: 0 bytes in 0 blocks
==95142==    still reachable: 7,644 bytes in 20 blocks
==95142==         suppressed: 88 bytes in 1 blocks
==95142== Rerun with --leak-check=full to see details of leaked memory
==95142== 
==95142== For counts of detected and suppressed errors, rerun with: -v
==95142== ERROR SUMMARY: 380 errors from 2 contexts (suppressed: 0 from 0)
Segmentation fault

Reply via email to