public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/41478]  New: function "pack" causes double free violation
@ 2009-09-26 20:05 reuter at physik dot uni-freiburg dot de
  2009-09-26 20:06 ` [Bug fortran/41478] " reuter at physik dot uni-freiburg dot de
                   ` (28 more replies)
  0 siblings, 29 replies; 30+ messages in thread
From: reuter at physik dot uni-freiburg dot de @ 2009-09-26 20:05 UTC (permalink / raw)
  To: gcc-bugs

The following program causes a double free violation, when compiled and run,
the error message is:
a.out(12292) malloc: *** error for object 0x2009d0: double free
*** set a breakpoint in malloc_error_break to debug
The code is:
program main

 type :: container_t
    integer, dimension(:), allocatable :: entry
 end type container_t

 type(container_t), dimension(2) :: a1, a2
 integer :: i

 do i = 1, 2
    allocate (a1(i)%entry (1), a2(i)%entry (1))
    a1(i)%entry = 0
    a2(i)%entry = i
 end do

 print *, "array1:"
 do i = 1, 2
    print *, a1(i)%entry
 end do
 print *, "array2:"
 do i = 1, 2
    print *, a2(i)%entry
 end do

 print *, "pack array2(2) into array1:"
 a1(1:1) = pack (a2(1:2), mask = [.false., .true.])

 print *, "array1:"
 do i = 1, 2
    print *, a1(i)%entry
 end do


end program main


-- 
           Summary: function "pack" causes double free violation
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reuter at physik dot uni-freiburg dot de
 GCC build triplet: i386-32bit, MAC OS X Leopard
  GCC host triplet: i386-32bit, MAC OS X Leopard
GCC target triplet: i386-32bit, MAC OS X Leopard


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


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

end of thread, other threads:[~2010-02-07  3:55 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-26 20:05 [Bug fortran/41478] New: function "pack" causes double free violation reuter at physik dot uni-freiburg dot de
2009-09-26 20:06 ` [Bug fortran/41478] " reuter at physik dot uni-freiburg dot de
2009-09-26 21:16 ` kargl at gcc dot gnu dot org
2009-09-27  0:39 ` jvdelisle at gcc dot gnu dot org
2009-09-27  9:59 ` dominiq at lps dot ens dot fr
2009-09-27 10:36 ` rguenth at gcc dot gnu dot org
2009-09-27 11:45 ` dominiq at lps dot ens dot fr
2009-09-27 13:12 ` rguenth at gcc dot gnu dot org
2009-10-01 21:22 ` [Bug fortran/41478] Corrupted memory using PACK for derived-types with allocated components burnus at gcc dot gnu dot org
2009-10-20 19:56 ` janus at gcc dot gnu dot org
2009-10-20 20:06 ` janus at gcc dot gnu dot org
2009-10-20 20:15 ` janus at gcc dot gnu dot org
2009-10-20 20:54 ` janus at gcc dot gnu dot org
2009-10-21  3:04 ` jvdelisle at gcc dot gnu dot org
2009-12-04 20:34 ` tkoenig at gcc dot gnu dot org
2009-12-04 20:37 ` tkoenig at gcc dot gnu dot org
2009-12-04 21:04 ` tkoenig at gcc dot gnu dot org
2009-12-06 22:57 ` janus at gcc dot gnu dot org
2009-12-13 21:51 ` janus at gcc dot gnu dot org
2010-01-11  6:14 ` pault at gcc dot gnu dot org
2010-01-11 12:30 ` dominiq at lps dot ens dot fr
2010-01-11 12:51 ` pault at gcc dot gnu dot org
2010-01-11 13:06 ` burnus at gcc dot gnu dot org
2010-01-11 13:50 ` dominiq at lps dot ens dot fr
2010-01-11 14:04 ` dominiq at lps dot ens dot fr
2010-01-11 17:51 ` dominiq at lps dot ens dot fr
2010-01-11 18:23 ` pault at gcc dot gnu dot org
2010-01-14  6:18 ` pault at gcc dot gnu dot org
2010-01-14  6:20 ` pault at gcc dot gnu dot org
2010-02-07  3:55 ` hjl dot tools at gmail dot com

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).