[GRASS-dev] Re: ctypes problem with Vect_open_old

Martin Landa landa.martin at gmail.com
Thu Jul 28 17:35:36 EDT 2011


Hi,

2011/7/28 Glynn Clements <glynn at gclements.plus.com>:

[...]

> The simplest fix is probably to add -D__GLIBC_HAVE_LONG_LONG to
> CTYPESFLAGS in lib/python/ctypes/Makefile. That macro is unlikely to
> be understood by anything other than glibc, and any system using glibc
> is almost certain to be using a compiler which supports "long long".

I modified Makefile

CTYPESFLAGS = --cpp "$(CC) -E $(CPPFLAGS) $(LFS_CFLAGS)
$(EXTRA_CFLAGS) $(NLS_CFLAGS) $(DEFS) $(EXTRA_INC) $(INC)
-D__GLIBC_HAVE_LONG_LONG"

after recompilation I can see in vector.py

__quad_t = c_longlong # /usr/include/i386-linux-gnu/bits/types.h: 56

__off_t = c_long # /usr/include/i386-linux-gnu/bits/types.h: 141

__off64_t = __quad_t # /usr/include/i386-linux-gnu/bits/types.h: 142


Unfortunately the sample script still fails

...
D1/5: Vect_open_sidx(): name = a mapset= landa mode = update
D1/5: get coor info: /home/martin/grassdata/nc_spm_08/landa/vector/a/coor
D1/5: Info->size = 76, Info->mtime = 1311887704
D2/5: Spidx header: file version 5.1 , supported from GRASS version 5.1
D2/5:   byte order 0
D2/5:   header size 113
D2/5:   with_z 0
D2/5:   coor size 76
D1/5: Sidx head: coor size = 76, coor mtime = 0
D1/5: Memory based spatial index
D1/5: dig_read_spindx()
D2/5: Spidx header: file version 5.1 , supported from GRASS version 5.1
D2/5:   byte order 0
D2/5:   header size 113
D2/5:   with_z 0
D2/5:   coor size 76
*** glibc detected *** python: malloc(): memory corruption: 0x086b5908 ***

Any idea where could be a problem?

Thanks, Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa


More information about the grass-dev mailing list