public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/40851]  New: problem with deallocation of pointers
@ 2009-07-24 20:03 juergen dot reuter at desy dot de
  2009-07-24 20:05 ` [Bug fortran/40851] " juergen dot reuter at desy dot de
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: juergen dot reuter at desy dot de @ 2009-07-24 20:03 UTC (permalink / raw)
  To: gcc-bugs

gfortran seems to deallocate a pointer which was not allocated or need not be
allocated. The program below compiles, but when executed returns the following
error message:
a.out(8814) malloc: *** error for object 0x1fa2: Non-aligned pointer being
freed
*** set a breakpoint in malloc_error_break to debug
Bus error
(Happens for Linux x86 and x86-64 as well as MAC OS X)
The code is:
program main

  type :: string
     character,dimension(:),allocatable :: chars
  end type string

  type :: string_container
     type(string) :: string
  end type string_container

  type(string_container), pointer :: ptr

  call set_ptr (ptr)

contains

  subroutine set_ptr (ptr)
    type(string_container), pointer, intent(out) :: ptr
    ptr => null ()
  end subroutine set_ptr

end program main


-- 
           Summary: problem with deallocation of pointers
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: juergen dot reuter at desy dot de
 GCC build triplet: 4.5.0 v149701
  GCC host triplet: Linux x86. x86-64 and MAC OS X
GCC target triplet: gfortran


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


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

end of thread, other threads:[~2009-08-23 16:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-24 20:03 [Bug fortran/40851] New: problem with deallocation of pointers juergen dot reuter at desy dot de
2009-07-24 20:05 ` [Bug fortran/40851] " juergen dot reuter at desy dot de
2009-07-25  6:56 ` burnus at gcc dot gnu dot org
2009-07-25 19:14 ` burnus at gcc dot gnu dot org
2009-07-27  9:32 ` burnus at gcc dot gnu dot org
2009-07-27  9:33 ` [Bug fortran/40851] [4.3/4.4] " burnus at gcc dot gnu dot org
2009-07-29  9:35 ` burnus at gcc dot gnu dot org
2009-08-16 20:29 ` [Bug fortran/40851] [4.3] " burnus at gcc dot gnu dot org
2009-08-16 20:29 ` [Bug fortran/40851] [4.3/4.4/4.5] " burnus at gcc dot gnu dot org
2009-08-16 20:52 ` steven at gcc dot gnu dot org
2009-08-16 21:37 ` rguenth at gcc dot gnu dot org
2009-08-23 11:09 ` mikpe at it dot uu dot se
2009-08-23 16:01 ` burnus at gcc dot gnu dot org
2009-08-23 16:02 ` burnus at gcc dot gnu dot org
2009-08-23 16:53 ` mikpe at it dot uu dot se

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