LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-31-2008, 11:49 AM   #1
RudraB
Member
 
Registered: Mar 2007
Distribution: Fedora
Posts: 264

Rep: Reputation: 23
gfortarn problem


when I am running my fortran 90 code, i am getting an unusual problem. While the code is compiling very well in ifort, its showing following error just before the end of run:
######### calculation over
*** glibc detected *** /matsc/students/Rudra/Recursion/Real/run.out: double free or corruption (out): 0xb7f79008 ***
======= Backtrace: =========
/lib/libc.so.6[0x5efac1]
/lib/libc.so.6(cfree+0x90)[0x5f30f0]
/usr/lib/libgfortran.so.1(_gfortran_internal_free+0x21)[0x24e0c1]
/matsc/students/Rudra/Recursion/Real/run.out[0x804a075]
/matsc/students/Rudra/Recursion/Real/run.out[0x804af1b]
/matsc/students/Rudra/Recursion/Real/run.out[0x804af47]
/lib/libc.so.6(__libc_start_main+0xe0)[0x59c390]
/matsc/students/Rudra/Recursion/Real/run.out[0x8048751]
======= Memory map: ========
00110000-00111000 r-xp 00110000 00:00 0 [vdso]
00242000-002c1000 r-xp 00000000 08:07 4259911 /usr/lib/libgfortran.so.1.0.0
002c1000-002c2000 rwxp 0007e000 08:07 4259911 /usr/lib/libgfortran.so.1.0.0
00567000-00582000 r-xp 00000000 08:07 4859005 /lib/ld-2.7.so
00582000-00583000 r-xp 0001a000 08:07 4859005 /lib/ld-2.7.so
00583000-00584000 rwxp 0001b000 08:07 4859005 /lib/ld-2.7.so
00586000-006d9000 r-xp 00000000 08:07 2457626 /lib/libc-2.7.so
006d9000-006db000 r-xp 00153000 08:07 2457626 /lib/libc-2.7.so
006db000-006dc000 rwxp 00155000 08:07 2457626 /lib/libc-2.7.so
006dc000-006df000 rwxp 006dc000 00:00 0
006e1000-00708000 r-xp 00000000 08:07 2457630 /lib/libm-2.7.so
00708000-00709000 r-xp 00026000 08:07 2457630 /lib/libm-2.7.so
00709000-0070a000 rwxp 00027000 08:07 2457630 /lib/libm-2.7.so
00aaa000-00ab5000 r-xp 00000000 08:07 2457634 /lib/libgcc_s-4.1.2-20070925.so.1
00ab5000-00ab6000 rwxp 0000a000 08:07 2457634 /lib/libgcc_s-4.1.2-20070925.so.1
08048000-0804c000 r-xp 00000000 00:11 5112713 /matsc/students/Rudra/Recursion/Real/run.out
0804c000-0804d000 rw-p 00003000 00:11 5112713 /matsc/students/Rudra/Recursion/Real/run.out
0906e000-090b2000 rw-p 0906e000 00:00 0
b7e00000-b7e21000 rw-p b7e00000 00:00 0
b7e21000-b7f00000 ---p b7e21000 00:00 0
b7f79000-b7fc1000 rw-p b7f79000 00:00 0
bf89f000-bf8b4000 rw-p bffea000 00:00 0 [stack]

Program received signal SIGABRT, Aborted.
0x00110402 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install gcc.i386 glibc.i686
(gdb) backtrace
#0 0x00110402 in __kernel_vsyscall ()
#1 0x005af690 in raise () from /lib/libc.so.6
#2 0x005b0f91 in abort () from /lib/libc.so.6
#3 0x005e79eb in __libc_message () from /lib/libc.so.6
#4 0x005efac1 in _int_free () from /lib/libc.so.6
#5 0x005f30f0 in free () from /lib/libc.so.6
#6 0x0024e0c1 in _gfortran_internal_free () from /usr/lib/libgfortran.so.1
#7 0x0804a075 in coefficient_ (istart=@0xbf8b1eb4, lorbit=@0xbf8b1eac, nrec=@0xbf8b1ea8, nsite=@0xbf8b1efc,
nmax=@0xbf8b1eb0, nn=@0xbf8b1ef8, cmat=0xbf8b1e50, dmat=0xbf8b1e08) at coeff.f90:5
#8 0x0804af1b in MAIN__ () at main.f90:64
#9 0x0804af47 in main ()
(gdb)


can anybody tell me whats wrong? gfortran is working well elsewhere
 
Old 03-31-2008, 01:51 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
I can tell you what I think the problem is but my proposed fix is fairly vague.

The program is failing in the standard glibc subroutines used to free memory. You are attempting to free memory that has already been freed. In looking into Backtrace I think that you are using subroutine recursion i.e. a subroutine is being called by itself or by one of its subroutines. It has been years since I did FORTRAN recursion but as I remember it there are rules that say you have to exit up the stack in the same order as you called down the stack. That may no longer be the rule for ifort but ifort will have some sort of rules on the matter of exiting recursive subroutine calls.

So I think you should check your code to make sure that you are obeying ifort's rules for using recursive subroutines.

----------------------
Steve Stites
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 07:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration