Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29602 Discussions

libc malloc error or compiler error ??

clabra
New Contributor I
875 Views
Hi,

I'm having problems with a code whish worked well a few weeks ago.
It is really strange, because the problem ocurres only with the full optimization flags. In particular, the problem is with '-xT' ( I have an Intel Core 2 Duo, with Ubuntu 7.04 ).
If I compile the code without '-xT' I don't have any problem!!!

I'm not sure if the problem is the code, the compiler or the libc. I compiled the code a few weeks ago and worked fine. Maybe was an update of the system, but I don't know how I can find the real problem.
I tried with the intel fortran 9.1.045 and 10.0.023 and was the same.

I don't attach the code here because is a large code, but the line of the error is just
a%array = 0d0. I think the real problem is in a previous routine who allocate the memory.

Please, If someone can help me with this....

The output screen is:


*** glibc detected *** ./e600_2007.3.unix: malloc(): memory corruption: 0x0000000001134830 ***
======= Backtrace: =========
/lib/libc.so.6[0x3bd20701d1]
/lib/libc.so.6(__libc_malloc+0x7d)[0x3bd207198d]
./e600_2007.3.unix[0x77b09d]
./e600_2007.3.unix[0x7577bb]
./e600_2007.3.unix[0x75c7a7]
/lib/libc.so.6[0x3bd2030d40]
./e600_2007.3.unix[0x57f1d6]
./e600_2007.3.unix[0x50eb95]
./e600_2007.3.unix[0x5118a0]
./e600_2007.3.unix[0x58dd1c]
./e600_2007.3.unix[0x5bcb5c]
./e600_2007.3.unix[0x4033e2]
/lib/libc.so.6(__libc_start_main+0xf4)[0x3bd201d8e4]
./e600_2007.3.unix[0x403329]
======= Memory map: ========
00400000-008d2000 r-xp 00000000 08:01 15811614 /home/clabra/codes/simpact/e600-v0.3/bin/e600_2007.3.unix
00ad1000-00afa000 rwxp 004d1000 08:01 15811614 /home/clabra/codes/simpact/e600-v0.3/bin/e600_2007.3.unix
00afa000-012df000 rwxp 00afa000 00:00 0 [heap]
3bd1200000-3bd121c000 r-xp 00000000 08:02 2605091 /lib/ld-2.5.so
3bd141b000-3bd141d000 rwxp 0001b000 08:02 2605091 /lib/ld-2.5.so
3bd2000000-3bd2147000 r-xp 00000000 08:02 2605194 /lib/libc-2.5.so
3bd2147000-3bd2347000 ---p 00147000 08:02 2605194 /lib/libc-2.5.so
3bd2347000-3bd234a000 r-xp 00147000 08:02 2605194 /lib/libc-2.5.so
3bd234a000-3bd234c000 rwxp 0014a000 08:02 2605194&n bsp; /lib/libc-2.5.so
3bd234c000-3bd2351000 rwxp 3bd234c000 00:00 0
3bd2400000-3bd2402000 r-xp 00000000 08:02 2605198 /lib/libdl-2.5.so
3bd2402000-3bd2602000 ---p 00002000 08:02 2605198 /lib/libdl-2.5.so
3bd2602000-3bd2604000 rwxp 00002000 08:02 2605198 /lib/libdl-2.5.so
3bd2800000-3bd2881000 r-xp 00000000 08:02 2605195 /lib/libm-2.5.so
3bd2881000-3bd2a80000 ---p 00081000 08:02 2605195 /lib/libm-2.5.so
3bd2a80000-3bd2a82000 rwxp 00080000 08:02 2605195 /lib/libm-2.5.so
3bd7e00000-3bd7e0d000 r-xp 00000000 08:02 2605196 /lib/libgcc_s.so.1
3bd7e0d000-3bd800d000 ---p 0000d000 08:02 2605196 /lib/libgcc_s.so.1
3bd800d000-3bd800e000 rwxp 0000d000 08:02 2605196 /lib/libgcc_s.so.1
2ba2795e9000-2ba2795ec000 rwxp 2ba2795e9000 00:00 0
2ba279609000-2ba27a178000 rwxp 2ba279609000 00:00 0
2ba27c000000-2ba27c021000 rwxp 2ba27c000000 00:00 0
2ba27c021000-2ba280000000 ---p 2ba27c021000 00:00 0
7fff3145d000-7fff314c1000 rwxp 7fff3145d000 00:00 0 [stack]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vdso]
forrtl: error (76): Abort trap signal
Image PC Routine Line Source
libc.so.6 0000003BD2030D40 Unknown Unknown Unknown
libc.so.6 0000003BD2030CAB Unknown Unknown Unknown
libc.so.6&nbs p; 0000003BD2032660 Unknown Unknown Unknown
libc.so.6 0000003BD206866B Unknown Unknown Unknown
libc.so.6 0000003BD20701D1 Unknown Unknown Unknown
libc.so.6 0000003BD207198D Unknown Unknown Unknown
e600_2007.3.unix 000000000077B09D Unknown Unknown Unknown
e600_2007.3.unix 00000000007577BB Unknown Unknown Unknown
e600_2007.3.unix 000000000075C7A7 Unknown Unknown Unknown
libc.so.6 0000003BD2030D40 Unknown Unknown Unknown
e600_2007.3.unix 000000000057F1D6 init_24_mp_i 76 init_24.f90
e600_2007.3.unix 000000000050EB95 ele24_ 160 ele24.f90
e600_2007.3.unix 00000000005118A0 init_ 151 init.F90
e600_2007.3.unix 00000000005BCB5C MAIN__ 152 main.F90
e600_2007.3.unix 00000000004033E2 Unknown Unknown Unknown
libc.so.6 0000003BD201D8E4 Unknown Unknown Unknown
e600_2007.3.unix 0000000000403329 Unknown Unknown Unknown

0 Kudos
2 Replies
Steven_L_Intel1
Employee
875 Views
Please report this to Intel support.
0 Kudos
jimdempseyatthecove
Honored Contributor III
875 Views

Don't rule out coding error in your application.

If your code is assigning pointers to arrays (or other pointers) and if the if the original array gets returned then thepointer to that formerly allocated block of memory may look valid (i.e. still associated) while it is no longer valid.

If then you subsequentlywrite to the freed block of memory you may corrupt the heap or simply write to unallocated memory. Heap corruption does not typically cause an instantaneous fault and writing to unallocated memory does not necessarily corrupt the heap. In many cases a faulty program may appear to run without error.

You might need to insert some diagnostic code to verify those pointers.

Jim Dempsey

0 Kudos
Reply