From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1643 invoked by alias); 28 Dec 2010 20:40:27 -0000 Received: (qmail 1625 invoked by uid 22791); 28 Dec 2010 20:40:26 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_CP X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Dec 2010 20:40:22 +0000 From: "sfilippone at uniroma2 dot it" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47085] New: [OOP] Problem in allocate( SOURCE=) for polymorphic component X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sfilippone at uniroma2 dot it X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 28 Dec 2010 20:40:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-12/txt/msg02788.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47085 Summary: [OOP] Problem in allocate( SOURCE=) for polymorphic component Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: sfilippone@uniroma2.it Created attachment 22859 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22859 test case With trunk at r168261 plus the patch for PR46838 I get the following error when running under valgrind: [sfilippo@localhost bug29]$ gfortran -v Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/usr/local/gnudev/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-dev/configure --prefix=/usr/local/gnudev --enable-languages=c,c++,fortran --with-gmp=/home/travel/GCC/gmp --with-mpfr=/home/travel/GCC/mpfr --with-mpc=/home/travel/GCC/mpc : (reconfigured) ../gcc-dev/configure --prefix=/usr/local/gnudev --with-gmp=/home/travel/GCC/gmp --with-mpfr=/home/travel/GCC/mpfr --with-mpc=/home/travel/GCC/mpc --enable-languages=c,c++,fortran,lto --no-create --no-recursion Thread model: posix gcc version 4.6.0 20101227 (experimental) (GCC) [sfilippo@localhost bug29]$ gfortran -o ppde ppde.f90 [sfilippo@localhost bug29]$ valgrind ./ppde ==9847== Memcheck, a memory error detector ==9847== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==9847== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info ==9847== Command: ./ppde ==9847== ==9847== Conditional jump or move depends on uninitialised value(s) ==9847== at 0x400C08: __copy_psb_gen_block_map_mod_psb_gen_block_map_ (in /home/sfilippo/NUMERICAL/NewPSBLAS/GNUbugs/bug29/ppde) ==9847== by 0x4019C7: psb_cdcpy_ (in /home/sfilippo/NUMERICAL/NewPSBLAS/GNUbugs/bug29/ppde) ==9847== by 0x401B85: MAIN__ (in /home/sfilippo/NUMERICAL/NewPSBLAS/GNUbugs/bug29/ppde) ==9847== by 0x401BD9: main (in /home/sfilippo/NUMERICAL/NewPSBLAS/GNUbugs/bug29/ppde) ==9847== ==9847== Conditional jump or move depends on uninitialised value(s) ==9847== at 0x400C2E: __copy_psb_gen_block_map_mod_psb_gen_block_map_ (in /home/sfilippo/NUMERICAL/NewPSBLAS/GNUbugs/bug29/ppde) ==9847== by 0x4019C7: psb_cdcpy_ (in /home/sfilippo/NUMERICAL/NewPSBLAS/GNUbugs/bug29/ppde) ==9847== by 0x401B85: MAIN__ (in /home/sfilippo/NUMERICAL/NewPSBLAS/GNUbugs/bug29/ppde) ==9847== by 0x401BD9: main (in /home/sfilippo/NUMERICAL/NewPSBLAS/GNUbugs/bug29/ppde) ==9847== ==9847== Conditional jump or move depends on uninitialised value(s) ==9847== at 0x400C51: __copy_psb_gen_block_map_mod_psb_gen_block_map_ (in /home/sfilippo/NUMERICAL/NewPSBLAS/GNUbugs/bug29/ppde) ==9847== by 0x4019C7: psb_cdcpy_ (in /home/sfilippo/NUMERICAL/NewPSBLAS/GNUbugs/bug29/ppde) ==9847== by 0x401B85: MAIN__ (in /home/sfilippo/NUMERICAL/NewPSBLAS/GNUbugs/bug29/ppde) ==9847== by 0x401BD9: main (in /home/sfilippo/NUMERICAL/NewPSBLAS/GNUbugs/bug29/ppde) ==9847== ==9847== ==9847== HEAP SUMMARY: ==9847== in use at exit: 648 bytes in 6 blocks ==9847== total heap usage: 22 allocs, 16 frees, 4,473 bytes allocated ==9847== ==9847== LEAK SUMMARY: ==9847== definitely lost: 0 bytes in 0 blocks ==9847== indirectly lost: 0 bytes in 0 blocks ==9847== possibly lost: 0 bytes in 0 blocks ==9847== still reachable: 648 bytes in 6 blocks ==9847== suppressed: 0 bytes in 0 blocks ==9847== Rerun with --leak-check=full to see details of leaked memory ==9847== ==9847== For counts of detected and suppressed errors, rerun with: -v ==9847== Use --track-origins=yes to see where uninitialised values come from ==9847== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 6 from 6) The test case is reduced from a complex application, where the error shows up as follows: [sfilippo@localhost runs]$ ./ppde Generating Matrix (size=64)... The matrix has been generated and assembled in CSR format. -allocation time : 1.42813E-04 -coeff. gen. time : 3.26872E-04 -assembly time : 6.09159E-04 -total time : 1.11485E-03 Overall matrix creation time : 1.47796E-03 Program received signal 11 (SIGSEGV): Segmentation fault. Backtrace for this error: + /lib64/libc.so.6(+0x32970) [0x7fa574efe970] + /lib64/libc.so.6(cfree+0x1c) [0x7fa574f462dc] + function __copy_psb_gen_block_map_mod_psb_gen_block_map_ (0x4382E6) at line 97 of file psb_gen_block_map_mod.f03 + function psb_cdcpy_ (0x420B06) at line 93 of file psb_cdcpy.f90 + function ppde (0x403E4A) at line 82 of file ppde.f90 + /lib64/libc.so.6(__libc_start_main+0xfd) [0x7fa574eeac5d] With the reduced test case the segfault is not apparent, but the cause is still operational.