[GRASS-dev] Re: ctypes problem with Vect_open_old

Martin Landa landa.martin at gmail.com
Mon Aug 1 06:25:14 EDT 2011


Hi,

2011/7/29 Glynn Clements <glynn at gclements.plus.com>:
> I can't reproduce this. Running it under GDB might help, or it might
> not; memory corruption is like that.

after pressing Ctrl+C

Program received signal SIGINT, Interrupt.
0xb7fe2424 in __kernel_vsyscall ()

> bt

#0  0xb7fe2424 in __kernel_vsyscall ()
#1  0xb7ceddb1 in __lll_lock_wait_private () at
../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/lowlevellock.S:95
#2  0xb7c84ba7 in _L_lock_9661 () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
#3  0xb7c833d6 in __libc_free (mem=0x8311ac0) at malloc.c:3736
#4  0xb7ff444f in ?? () from /lib/ld-linux.so.2
#5  0xb7fefab1 in ?? () from /lib/ld-linux.so.2
#6  0xb7ff4e21 in ?? () from /lib/ld-linux.so.2
#7  0xb7ff0b46 in ?? () from /lib/ld-linux.so.2
#8  0xb7ff4866 in ?? () from /lib/ld-linux.so.2
#9  0xb7d17972 in do_dlopen (ptr=0xbfff52c8) at dl-libc.c:86
#10 0xb7ff0b46 in ?? () from /lib/ld-linux.so.2
#11 0xb7d17a71 in dlerror_run (operate=<value optimized out>,
args=0x839d4b0) at dl-libc.c:47
#12 0xb7d17b8b in __libc_dlopen_mode (name=0xb7d44c3d "libgcc_s.so.1",
mode=-2147483647) at dl-libc.c:160
#13 0xb7cf55b8 in init () at ../sysdeps/i386/backtrace.c:44
#14 0xb7fb885e in pthread_once () at
../nptl/sysdeps/unix/sysv/linux/i386/pthread_once.S:122
#15 0xb7cf57ad in __backtrace (array=0xbfff589c, size=64) at
../sysdeps/i386/backtrace.c:121
#16 0xb7c749eb in __libc_message (do_abort=2, fmt=0xb7d49a90 "***
glibc detected *** %s: %s: 0x%s ***\n")
    at ../sysdeps/unix/sysv/linux/libc_fatal.c:168
#17 0xb7c7eac1 in malloc_printerr (action=<value optimized out>,
str=0x8311ab8 "", ptr=0x842b918) at malloc.c:6283
#18 0xb7c818a4 in _int_malloc (av=<value optimized out>, bytes=<value
optimized out>) at malloc.c:4396
#19 0xb7c834ac in __libc_malloc (bytes=476) at malloc.c:3660
#20 0xb5fc92b6 in RTreeNewNode (t=0x8474ba0, level=0) at node.c:76
#21 0xb5fe3ecd in rtree_load_to_memory (fp=0x842dcf4, rootpos=589,
t=0x8474ba0, off_t_size=4) at spindex_rw.c:965
#22 0xb5fe481d in rtree_load_from_sidx (fp=0x842dcf4, rootpos=589,
t=0x8474ba0, off_t_size=4) at spindex_rw.c:1123
#23 0xb5fe4aac in dig_Rd_spidx (fp=0x842dcf4, Plus=0x842dafc) at
spindex_rw.c:1201
#24 0xb60520a1 in Vect_open_sidx (Map=0x842daf0, mode=1) at open.c:1104
#25 0xb6050830 in Vect__open_old (Map=0x842daf0, name=0xb7b95b54 "a",
mapset=0xb7bd30c4 "", layer=0x0, update=1, head_only=0) at open.c:312
#26 0xb60510c2 in Vect_open_update (Map=0x842daf0, name=0xb7b95b54
"a", mapset=0xb7bd30c4 "") at open.c:558
#27 0xb7868baf in ffi_call_SYSV () from
/usr/lib/python2.6/lib-dynload/_ctypes.so
#28 0xb786894e in ffi_call () from /usr/lib/python2.6/lib-dynload/_ctypes.so
#29 0xb7863622 in _CallProc () from /usr/lib/python2.6/lib-dynload/_ctypes.so
#30 0xb785abdd in ?? () from /usr/lib/python2.6/lib-dynload/_ctypes.so
#31 0x08066efd in PyObject_Call ()
#32 0x080d85e9 in PyEval_EvalFrameEx ()
#33 0x080dbb27 in PyEval_EvalCodeEx ()
#34 0x080dbc37 in PyEval_EvalCode ()
#35 0x080fb026 in PyRun_FileExFlags ()
#36 0x080fbdc6 in PyRun_SimpleFileExFlags ()
#37 0x0805e4e2 in Py_Main ()
#38 0x0805d6bb in main ()

It seems to crash at [1]. In summary, the sample script works on

* my laptop (Debian GNU/Linux unstable 32bit, gcc 4.6.1, python 2.6.7)
- GRASS compiled *without* LFS

and fails on

* testing server (Debian GNU/Linux stable 64bit, gcc 4.4.5, python
2.6.6) - GRASS compiled *with* LFS

...
D1/5: Vect_Rewind(): name = a
D3/5: Vect_write_line(): name = (null), format = 152120884, level = 0
ERROR: Unable to write feature, vector map is not opened

* my computer (Debian GNU/Linux unstable 32bit, gcc 4.6.1, python
2.6.7) - GRASS compiled *with* LFS

1/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 = 105, Info->mtime = 1312193976
D2/5: Spidx header: file version 5.1 , supported from G4.4.5RASS version 5.1
D2/5:   byte order 0
D2/5:   header size 113
D2/5:   with_z 0
D2/5:   coor size 105
D1/5: Sidx head: coor size = 105, 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 105
*** glibc detected *** /usr/bin/python: malloc(): memory corruption:
0x0976e950 ***

Martin

[1] http://trac.osgeo.org/grass/browser/grass/trunk/lib/vector/rtree/node.c#L76

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


More information about the grass-dev mailing list