public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/50378] New: MALLOC_CHECK_ glibc detects free() invalid pointer in compiler
@ 2011-09-13  9:05 zeccav at gmail dot com
  2011-09-13  9:21 ` [Bug fortran/50378] " burnus at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: zeccav at gmail dot com @ 2011-09-13  9:05 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50378
           Summary: MALLOC_CHECK_ glibc detects free() invalid pointer in
                    compiler
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zeccav@gmail.com


Created attachment 25257
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25257
just compile it

MALLOC_CHECK_ glibc detects free() invalid pointer in compiler


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

* [Bug fortran/50378] MALLOC_CHECK_ glibc detects free() invalid pointer in compiler
  2011-09-13  9:05 [Bug fortran/50378] New: MALLOC_CHECK_ glibc detects free() invalid pointer in compiler zeccav at gmail dot com
@ 2011-09-13  9:21 ` burnus at gcc dot gnu.org
  2011-09-13  9:53 ` mikael at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-09-13  9:21 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-09-13 09:16:35 UTC ---
Works for me with 4.7 (also in valgrind); with 4.6.1 20110801 [gcc-4_6-branch
revision 177033] I get an ICE (abort) and valgrind shows:

==5778== Invalid read of size 4
==5778==    at 0x5FC8C10: __gmpz_clear (in /usr/lib64/libgmp.so.10.0.1)

However, using 4.7.0 20110908 (experimental) [trunk revision 178693] I do not
get an ICE/valgrind warning - hence it might be fixed.


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

* [Bug fortran/50378] MALLOC_CHECK_ glibc detects free() invalid pointer in compiler
  2011-09-13  9:05 [Bug fortran/50378] New: MALLOC_CHECK_ glibc detects free() invalid pointer in compiler zeccav at gmail dot com
  2011-09-13  9:21 ` [Bug fortran/50378] " burnus at gcc dot gnu.org
@ 2011-09-13  9:53 ` mikael at gcc dot gnu.org
  2011-09-13 16:00 ` kargl at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-09-13  9:53 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikael at gcc dot gnu.org

--- Comment #2 from Mikael Morin <mikael at gcc dot gnu.org> 2011-09-13 09:39:14 UTC ---
PR 50050 ?


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

* [Bug fortran/50378] MALLOC_CHECK_ glibc detects free() invalid pointer in compiler
  2011-09-13  9:05 [Bug fortran/50378] New: MALLOC_CHECK_ glibc detects free() invalid pointer in compiler zeccav at gmail dot com
  2011-09-13  9:21 ` [Bug fortran/50378] " burnus at gcc dot gnu.org
  2011-09-13  9:53 ` mikael at gcc dot gnu.org
@ 2011-09-13 16:00 ` kargl at gcc dot gnu.org
  2011-09-13 20:15 ` zeccav at gmail dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: kargl at gcc dot gnu.org @ 2011-09-13 16:00 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #3 from kargl at gcc dot gnu.org 2011-09-13 15:56:33 UTC ---
(In reply to comment #2)
> PR 50050 ?

Yes, your patch(es) for PR 50050 appear to have fixed
this issue.  I had an older 4.5.4 that gave an error,
but a newly built 4.5.4 works as expected.

Vittorio, can you update your 4.6.1 to a newer
version and retry your test case?


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

* [Bug fortran/50378] MALLOC_CHECK_ glibc detects free() invalid pointer in compiler
  2011-09-13  9:05 [Bug fortran/50378] New: MALLOC_CHECK_ glibc detects free() invalid pointer in compiler zeccav at gmail dot com
                   ` (2 preceding siblings ...)
  2011-09-13 16:00 ` kargl at gcc dot gnu.org
@ 2011-09-13 20:15 ` zeccav at gmail dot com
  2011-09-13 20:20 ` sgk at troutmask dot apl.washington.edu
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: zeccav at gmail dot com @ 2011-09-13 20:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Vittorio Zecca <zeccav at gmail dot com> 2011-09-13 20:08:33 UTC ---
I thought I had the latest version of gfortran...
Where can I find the latest one, with sources?


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

* [Bug fortran/50378] MALLOC_CHECK_ glibc detects free() invalid pointer in compiler
  2011-09-13  9:05 [Bug fortran/50378] New: MALLOC_CHECK_ glibc detects free() invalid pointer in compiler zeccav at gmail dot com
                   ` (3 preceding siblings ...)
  2011-09-13 20:15 ` zeccav at gmail dot com
@ 2011-09-13 20:20 ` sgk at troutmask dot apl.washington.edu
  2011-09-13 20:21 ` zeccav at gmail dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2011-09-13 20:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 2011-09-13 20:14:33 UTC ---
On Tue, Sep 13, 2011 at 08:08:33PM +0000, zeccav at gmail dot com wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50378
> 
> --- Comment #4 from Vittorio Zecca <zeccav at gmail dot com> 2011-09-13 20:08:33 UTC ---
> I thought I had the latest version of gfortran...
> Where can I find the latest one, with sources?
> 

What does gfortran -v report?  Your code causes not problem for 

gcc version 4.5.4 20110913 (prerelease) (GCC) 
gcc version 4.6.1 20110606 (prerelease) (GCC) 
gcc version 4.7.0 20110908 (experimental) (GCC) 

In looking at the date of my 4.6.1, I may have messed
up my testing becaue Mikael patch is after that date.
Time to rebuild and retest.


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

* [Bug fortran/50378] MALLOC_CHECK_ glibc detects free() invalid pointer in compiler
  2011-09-13  9:05 [Bug fortran/50378] New: MALLOC_CHECK_ glibc detects free() invalid pointer in compiler zeccav at gmail dot com
                   ` (4 preceding siblings ...)
  2011-09-13 20:20 ` sgk at troutmask dot apl.washington.edu
@ 2011-09-13 20:21 ` zeccav at gmail dot com
  2011-09-13 21:37 ` burnus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: zeccav at gmail dot com @ 2011-09-13 20:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Vittorio Zecca <zeccav at gmail dot com> 2011-09-13 20:19:56 UTC ---
I have gfortran 4.6.1
I am downloading gcc-4.7.tar.xz from gfortran.org right now.
Tomorrow I'll check it, it is night here.


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

* [Bug fortran/50378] MALLOC_CHECK_ glibc detects free() invalid pointer in compiler
  2011-09-13  9:05 [Bug fortran/50378] New: MALLOC_CHECK_ glibc detects free() invalid pointer in compiler zeccav at gmail dot com
                   ` (5 preceding siblings ...)
  2011-09-13 20:21 ` zeccav at gmail dot com
@ 2011-09-13 21:37 ` burnus at gcc dot gnu.org
  2011-09-14  8:31 ` zeccav at gmail dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-09-13 21:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-09-13 20:31:26 UTC ---
(In reply to comment #4)
> I thought I had the latest version of gfortran...
> Where can I find the latest one, with sources?

While 4.6.1 (released 2011-08-17) is the latest stable release, you should use
the latest branch ("gcc-4_6-branch") or the development version (trunk, 4.7).
They are available via Subversion (http://gcc.gnu.org/svn.html), GIT
(http://gcc.gnu.org/git/?p=gcc.git) and as regular (weekly?) source snapshots.

Additionally, there exists also binary builds. See
http://gcc.gnu.org/wiki/GFortranBinaries for a link to the binaries and (at the
bottom) some pieces of information/links for building GCC from source.

It makes sense to report bugs against the current gcc-4_6-branch or 4.7 as
those contain all the existing fixes, which will be part in the next release.
Also Linux distributions tend to base their GCC packages on the release
branches and not on the releases from the release branch.


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

* [Bug fortran/50378] MALLOC_CHECK_ glibc detects free() invalid pointer in compiler
  2011-09-13  9:05 [Bug fortran/50378] New: MALLOC_CHECK_ glibc detects free() invalid pointer in compiler zeccav at gmail dot com
                   ` (6 preceding siblings ...)
  2011-09-13 21:37 ` burnus at gcc dot gnu.org
@ 2011-09-14  8:31 ` zeccav at gmail dot com
  2011-09-14  9:12 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: zeccav at gmail dot com @ 2011-09-14  8:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Vittorio Zecca <zeccav at gmail dot com> 2011-09-14 08:23:39 UTC ---
gfortran 4.7.0 fixes this one.
However, sometimes I get the following:

/home/vitti/gcc-4.7/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/f951:
symbol lookup error:
/home/vitti/gcc-4.7/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/f951:
undefined symbol: mpfr_get_z_exp

Never got this one, I have mpfr-3.0.0-4
How can I fix it?


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

* [Bug fortran/50378] MALLOC_CHECK_ glibc detects free() invalid pointer in compiler
  2011-09-13  9:05 [Bug fortran/50378] New: MALLOC_CHECK_ glibc detects free() invalid pointer in compiler zeccav at gmail dot com
                   ` (7 preceding siblings ...)
  2011-09-14  8:31 ` zeccav at gmail dot com
@ 2011-09-14  9:12 ` burnus at gcc dot gnu.org
  2011-09-14 20:04 ` zeccav at gmail dot com
  2011-09-14 20:16 ` kargl at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-09-14  9:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-09-14 08:50:04 UTC ---
(In reply to comment #8)
> x86_64-unknown-linux-gnu/4.7.0/f951:
> symbol lookup error:
> undefined symbol: mpfr_get_z_exp
> 
> Never got this one, I have mpfr-3.0.0-4

See http://www.mpfr.org/mpfr-3.0.0/#changes and
http://www.mpfr.org/mpfr-3.0.1/mpfr.html#Changed-Functions

"mpfr_get_z_exp changed in MPFR 3.0 [...] this function has been renamed to
mpfr_get_z_2exp in MPFR 3.0" and "mpfr_get_z_exp is still available via a macro
in mpfr.h".

Seemingly, you have a f951 which has been compiled with MPFR 2.x but you run it
with MPFR 3. In that case, the macro does not help.

gfortran calls this function for real-to-integer conversions, which seems to be
the only use.


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

* [Bug fortran/50378] MALLOC_CHECK_ glibc detects free() invalid pointer in compiler
  2011-09-13  9:05 [Bug fortran/50378] New: MALLOC_CHECK_ glibc detects free() invalid pointer in compiler zeccav at gmail dot com
                   ` (8 preceding siblings ...)
  2011-09-14  9:12 ` burnus at gcc dot gnu.org
@ 2011-09-14 20:04 ` zeccav at gmail dot com
  2011-09-14 20:16 ` kargl at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: zeccav at gmail dot com @ 2011-09-14 20:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Vittorio Zecca <zeccav at gmail dot com> 2011-09-14 20:01:17 UTC ---
gfortran 4.7.0 has been compiled with the old mpfr 2.4.2, I just downloaded it,
this one will probably work. 
Anyway gfortran 4.7.0 does not give free() errors.


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

* [Bug fortran/50378] MALLOC_CHECK_ glibc detects free() invalid pointer in compiler
  2011-09-13  9:05 [Bug fortran/50378] New: MALLOC_CHECK_ glibc detects free() invalid pointer in compiler zeccav at gmail dot com
                   ` (9 preceding siblings ...)
  2011-09-14 20:04 ` zeccav at gmail dot com
@ 2011-09-14 20:16 ` kargl at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: kargl at gcc dot gnu.org @ 2011-09-14 20:16 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED

--- Comment #11 from kargl at gcc dot gnu.org 2011-09-14 20:13:17 UTC ---
(In reply to comment #10)
> gfortran 4.7.0 has been compiled with the old mpfr 2.4.2, I just downloaded it,
> this one will probably work. 
> Anyway gfortran 4.7.0 does not give free() errors.

Thanks for the bug report and confirming that the issue
is fixed.


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

end of thread, other threads:[~2011-09-14 20:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-13  9:05 [Bug fortran/50378] New: MALLOC_CHECK_ glibc detects free() invalid pointer in compiler zeccav at gmail dot com
2011-09-13  9:21 ` [Bug fortran/50378] " burnus at gcc dot gnu.org
2011-09-13  9:53 ` mikael at gcc dot gnu.org
2011-09-13 16:00 ` kargl at gcc dot gnu.org
2011-09-13 20:15 ` zeccav at gmail dot com
2011-09-13 20:20 ` sgk at troutmask dot apl.washington.edu
2011-09-13 20:21 ` zeccav at gmail dot com
2011-09-13 21:37 ` burnus at gcc dot gnu.org
2011-09-14  8:31 ` zeccav at gmail dot com
2011-09-14  9:12 ` burnus at gcc dot gnu.org
2011-09-14 20:04 ` zeccav at gmail dot com
2011-09-14 20:16 ` kargl 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).