public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/31320]  New: Illegal read with gfortran.dg/alloc_comp_assign_2.f90 and *_3.f90
@ 2007-03-22 23:17 burnus at gcc dot gnu dot org
  2007-03-24  8:16 ` [Bug fortran/31320] " pault at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-03-22 23:17 UTC (permalink / raw)
  To: gcc-bugs

gfortran -g gfortran.dg/alloc_comp_assign_2.f90
valgrind ./a.out

==30049== Invalid read of size 1
==30049==    at 0x4C24854: memcpy (in
/usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
==30049==    by 0x401682: MAIN__ (in
/projects/tob/gcc/gcc/testsuite/gfortran.dg/a.out)
==30049==    by 0x405FAB: main (fmain.c:22)
==30049==  Address 0x404D64B is 3 bytes after a block of size 16 alloc'd
==30049==    at 0x4C22C56: malloc (in
/usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
==30049==    by 0x4E3DD78: _gfortrani_get_mem (memory.c:53)
==30049==    by 0x400A5C: MAIN__ (in
/projects/tob/gcc/gcc/testsuite/gfortran.dg/a.out)
==30049==    by 0x405FAB: main (fmain.c:22)

I checked the example itself with g95 and NAG f95 and both fail at the second,
third and fourth "call abort()" whereas ifort has a segv.
Is this example (PR 20541) really valid?

A check with NAG f95, g95 and ifort with valgrind shows no problem for NAG f95,
and invalid reads for g95 and ifort.

For alloc_comp_assign_3.f90: Compiles with g95, ifort and NAG f95 and gives no
"call abort()", however, gfortran has:

==30454== Invalid read of size 1
==30454==    at 0x4C24854: memcpy (in
/usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
==30454==    by 0x401223: MAIN__ (alloc_comp_assign_3.f90:22)
==30454==    by 0x40444B: main (fmain.c:22)
==30454==  Address 0x404D64B is 3 bytes after a block of size 16 alloc'd
==30454==    at 0x4C22C56: malloc (in
/usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
==30454==    by 0x4E3DD78: _gfortrani_get_mem (memory.c:53)
==30454==    by 0x400A5C: MAIN__ (alloc_comp_assign_3.f90:19)
==30454==    by 0x40444B: main (fmain.c:22)

For alloc_comp_initializer_1.f90 the same.


-- 
           Summary: Illegal read with gfortran.dg/alloc_comp_assign_2.f90
                    and *_3.f90
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31320


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-07-17 17:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-22 23:17 [Bug fortran/31320] New: Illegal read with gfortran.dg/alloc_comp_assign_2.f90 and *_3.f90 burnus at gcc dot gnu dot org
2007-03-24  8:16 ` [Bug fortran/31320] " pault at gcc dot gnu dot org
2007-04-12  9:52 ` burnus at gcc dot gnu dot org
2007-07-05 14:31 ` dfranke at gcc dot gnu dot org
2007-07-05 16:09 ` dfranke at gcc dot gnu dot org
2007-07-05 16:33 ` dfranke at gcc dot gnu dot org
2007-07-13 13:47 ` pault at gcc dot gnu dot org
2007-07-16 12:57 ` burnus at gcc dot gnu dot org
2007-07-17 17:08 ` pault at gcc dot gnu dot org
2007-07-17 17:23 ` pault at gcc dot gnu dot org
2007-07-17 17:58 ` burnus at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).