[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fortran "evolution"



Stonie,

There is no usage of the free() call in gdradr. There are 4 malloc statements in
radar_grid.c to static pointers and the large grid is statically allocated in
gdradr.f.

It sounds as if either your linker is complaining about the size of allocated
arrays (assuming you have not changed the LLMXTG setting....I have sucesfully
used LLMXTG under Linux with 9+million points for the 1/12 degree SST)
or you have to add some compiler environment flags. The other possibility is
that the free() problem is down in the gemlib/fortran_wrapper layer which
handles the dynamic allocation for the dg/ library,

The if fortran is a big problem for you, then the best solution would be to
migrate gdradr.f to gdradr.c as a wrapper and dynamically allocate the grid
memory at that point.

Stee Chiswell
Unidata User Support

On Thu, 18 Jan 2007, Stonie Cooper wrote:

> Steve,
>
> I gave up on gfortran, and finally tried the intel fortran compiler.
> I'm getting the same error with gdradr - and it appears to not be a
> fortran error, but rather a C error (free()).
>
> Have you seen this before?
>
> *** glibc detected *** gdradr: free(): invalid next size (normal):
> 0x0aa3b478 ***
> ======= Backtrace: =========
> /lib/libc.so.6[0xb7bd819b]
> /lib/libc.so.6(__libc_free+0x79)[0xb7bd96ea]
> gdradr[0x811487f]
> gdradr[0x80fb2bb]
> gdradr[0x80fadc1]
> gdradr[0x804f86b]
> gdradr[0x8069f56]
> gdradr[0x8069b5d]
> gdradr[0x804f82d]
> gdradr[0x8106b7f]
> /lib/libc.so.6(__libc_start_main+0xdc)[0xb7b8c864]
> gdradr[0x804c1b1]
> ======= Memory map: ========
> 08048000-0816c000 r-xp 00000000 08:03 139479     /usr/local/
> GEMPAK5.9.4/os/linux/bin/gdradr
> 0816c000-0817e000 rwxp 00124000 08:03 139479     /usr/local/
> GEMPAK5.9.4/os/linux/bin/gdradr
> 0817e000-0aa5c000 rwxp 0817e000 00:00 0          [heap]
> b7900000-b7921000 rwxp b7900000 00:00 0
> b7921000-b7a00000 ---p b7921000 00:00 0
> b7ab0000-b7b27000 rwxp b7ab0000 00:00 0
> b7b27000-b7b66000 r-xp 00000000 08:03 469949     /opt/intel/fc/
> 9.1.040/lib/libirc.so
> b7b66000-b7b68000 rwxp 0003f000 08:03 469949     /opt/intel/fc/
> 9.1.040/lib/libirc.so
> b7b68000-b7b6a000 r-xp 00000000 08:03 6612       /lib/libdl-2.4.so
> b7b6a000-b7b6c000 rwxp 00001000 08:03 6612       /lib/libdl-2.4.so
> b7b6c000-b7b6d000 rwxp b7b6c000 00:00 0
> b7b6d000-b7b76000 r-xp 00000000 08:03 49205      /usr/lib/gcc/i686-pc-
> linux-gnu/4.1.1/libgcc_s.so.1
> b7b76000-b7b77000 rwxp 00008000 08:03 49205      /usr/lib/gcc/i686-pc-
> linux-gnu/4.1.1/libgcc_s.so.1
> b7b77000-b7c87000 r-xp 00000000 08:03 9267       /lib/libc-2.4.so
> b7c87000-b7c89000 r-xp 0010f000 08:03 9267       /lib/libc-2.4.so
> b7c89000-b7c8b000 rwxp 00111000 08:03 9267       /lib/libc-2.4.so
> b7c8b000-b7c8e000 rwxp b7c8b000 00:00 0
> b7c8e000-b7cb0000 r-xp 00000000 08:03 9265       /lib/libm-2.4.so
> b7cb0000-b7cb2000 rwxp 00021000 08:03 9265       /lib/libm-2.4.so
> b7cc6000-b7f02000 r-xp 00000000 08:03 469945     /opt/intel/fc/
> 9.1.040/lib/libimf.so
> b7f02000-b7f04000 rwxp 0023b000 08:03 469945     /opt/intel/fc/
> 9.1.040/lib/libimf.so
> b7f04000-b7f05000 rwxp b7f04000 00:00 0
> b7f05000-b7f06000 r-xp b7f05000 00:00 0          [vdso]
> b7f06000-b7f1f000 r-xp 00000000 08:03 9214       /lib/ld-2.4.so
> b7f1f000-b7f20000 r-xp 00019000 08:03 9214       /lib/ld-2.4.so
> b7f20000-b7f21000 rwxp 0001a000 08:03 9214       /lib/ld-2.4.so
> bffd7000-bffee000 rwxp bffd7000 00:00 0          [stack]
>
> Stonie
>