public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/45451]  New: [OOP] Inconsistent status of ALLOCATABLE components inside CLASS variables.
@ 2010-08-30 12:09 sfilippone at uniroma2 dot it
  2010-08-30 12:09 ` [Bug fortran/45451] " sfilippone at uniroma2 dot it
                   ` (10 more replies)
  0 siblings, 11 replies; 20+ messages in thread
From: sfilippone at uniroma2 dot it @ 2010-08-30 12:09 UTC (permalink / raw)
  To: gcc-bugs

Hello,
After a lot (a LOT) of work, I've come up with this test case. The test case
*appears* to run fine, but valgrind shows something is amiss, and in the full
application (much more complex) there follow multiple segfaults. I did not find
(so far) a way to have a test case both small and exibiting the error out of
valgrind, hope you'll pardon me. 
The error: the ALLOCATABLE components of the ATX%A variable are detected as
ALLOCATED, and seemingly are printed OK, but VALGRIND says they were already
freed.

===============================================================================
[sfilippo@donald bug23]$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gnu46/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure --prefix=/usr/local/gnu46
--enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.6.0 20100830 (experimental) (GCC) 
[sfilippo@donald bug23]$ gfortran -ggdb  -o bug23 bug23.f03
[sfilippo@donald bug23]$ ./bug23
 New version 
 Allocation status:  T T T
           0           0           4           5
           0           0           2           3           0           0       
   0           0           0           0           0           0
   0.0000000000000000        1.0000000000000000        2.0000000000000000      
 3.0000000000000000        0.0000000000000000        0.0000000000000000       
0.0000000000000000        0.0000000000000000        0.0000000000000000       
0.0000000000000000        0.0000000000000000        0.0000000000000000     
[sfilippo@donald bug23]$ valgrind ./bug23
==6940== Memcheck, a memory error detector
==6940== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==6940== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==6940== Command: ./bug23
==6940== 
 New version 
 Allocation status:  T T T
==6940== Invalid read of size 4
==6940==    at 0x4CC19B8: extract_int (write.c:450)
==6940==    by 0x4CC27B1: write_integer (write.c:1260)
==6940==    by 0x4CC5BDE: _gfortrani_list_formatted_write (write.c:1552)
==6940==    by 0x4CBACA7: _gfortran_transfer_array (transfer.c:2000)
==6940==    by 0x401834: MAIN__ (bug23.f03:308)
==6940==    by 0x40197A: main (bug23.f03:284)
==6940==  Address 0x5141450 is 0 bytes inside a block of size 16 free'd
==6940==    at 0x4A04D72: free (vg_replace_malloc.c:325)
==6940==    by 0x4CCB5A8: _gfortran_move_alloc (move_alloc.c:41)
==6940==    by 0x400B90: __psb_d_csr_mat_mod_MOD_psb_d_mv_csr_from_fmt
(bug23.f03:238)
==6940==    by 0x401449: __psb_d_mat_mod_MOD_psb_d_mv_from (bug23.f03:277)
==6940==    by 0x4016C6: MAIN__ (bug23.f03:302)
==6940==    by 0x40197A: main (bug23.f03:284)
==6940== 
           1           3           4           5
           1           1           2           3           0           0       
   0           0           0           0           0           0
==6940== Invalid read of size 8
==6940==    at 0x4CC3795: write_float (write_float.def:1050)
==6940==    by 0x4CC508C: _gfortrani_write_real (write.c:1470)
==6940==    by 0x4CC5BAE: _gfortrani_list_formatted_write (write.c:1561)
==6940==    by 0x4CBACA7: _gfortran_transfer_array (transfer.c:2000)
==6940==    by 0x401904: MAIN__ (bug23.f03:310)
==6940==    by 0x40197A: main (bug23.f03:284)
==6940==  Address 0x5141510 is 0 bytes inside a block of size 96 free'd
==6940==    at 0x4A04D72: free (vg_replace_malloc.c:325)
==6940==    by 0x4CCB5A8: _gfortran_move_alloc (move_alloc.c:41)
==6940==    by 0x400BDC: __psb_d_csr_mat_mod_MOD_psb_d_mv_csr_from_fmt
(bug23.f03:240)
==6940==    by 0x401449: __psb_d_mat_mod_MOD_psb_d_mv_from (bug23.f03:277)
==6940==    by 0x4016C6: MAIN__ (bug23.f03:302)
==6940==    by 0x40197A: main (bug23.f03:284)
==6940== 
   1.0000000000000000        1.0000000000000000        2.0000000000000000      
 3.0000000000000000        0.0000000000000000        0.0000000000000000       
0.0000000000000000        0.0000000000000000        0.0000000000000000       
0.0000000000000000        0.0000000000000000        0.0000000000000000     
==6940== 
==6940== HEAP SUMMARY:
==6940==     in use at exit: 0 bytes in 0 blocks
==6940==   total heap usage: 33 allocs, 33 frees, 4,938 bytes allocated
==6940== 
==6940== All heap blocks were freed -- no leaks are possible
==6940== 
==6940== For counts of detected and suppressed errors, rerun with: -v
==6940== ERROR SUMMARY: 28 errors from 2 contexts (suppressed: 6 from 6)


-- 
           Summary: [OOP] Inconsistent status of ALLOCATABLE components
                    inside CLASS variables.
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sfilippone at uniroma2 dot it
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


^ permalink raw reply	[flat|nested] 20+ messages in thread
[parent not found: <bug-45451-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2010-11-05 18:41 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-30 12:09 [Bug fortran/45451] New: [OOP] Inconsistent status of ALLOCATABLE components inside CLASS variables sfilippone at uniroma2 dot it
2010-08-30 12:09 ` [Bug fortran/45451] " sfilippone at uniroma2 dot it
2010-08-30 12:13 ` sfilippone at uniroma2 dot it
2010-08-30 12:14 ` sfilippone at uniroma2 dot it
2010-08-30 16:32 ` janus at gcc dot gnu dot org
2010-08-30 20:48 ` janus at gcc dot gnu dot org
2010-08-31 14:04 ` sfilippone at uniroma2 dot it
2010-08-31 14:17 ` janus at gcc dot gnu dot org
2010-08-31 14:18 ` sfilippone at uniroma2 dot it
2010-08-31 19:21 ` sfilippone at uniroma2 dot it
2010-08-31 19:21 ` sfilippone at uniroma2 dot it
2010-09-01 12:02 ` burnus at gcc dot gnu dot org
     [not found] <bug-45451-4@http.gcc.gnu.org/bugzilla/>
2010-10-05 20:28 ` sfilippone at uniroma2 dot it
2010-10-24 19:56 ` burnus at gcc dot gnu.org
2010-10-24 21:42 ` burnus at gcc dot gnu.org
2010-10-24 22:31 ` burnus at gcc dot gnu.org
2010-10-26  6:50 ` burnus at gcc dot gnu.org
2010-10-26  7:36 ` burnus at gcc dot gnu.org
2010-11-05 18:15 ` janus at gcc dot gnu.org
2010-11-05 18:41 ` janus at gcc dot gnu.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).