<span id="result_box" class="long_text"><span style="background-color: rgb(255, 255, 255);" title="He modificado el código como me has
sugerido." onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">I modified the code as
you have suggested. </span><span title="Pero me encuentro con un nuevo
problema." onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">But I encounter a new
problem. </span><span style="background-color: rgb(255, 255, 255);" title="Si ejecuto un programa sencillo desde la linea de comando como
este: http://osgeo.pastebin.com/pPqkcvk3 obtengo el siguiente error:" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">If I run a simple program
from the command line like this: <a href="http://osgeo.pastebin.com/pPqkcvk3">http://osgeo.pastebin.com/pPqkcvk3</a> get
the following error:<br></span><span style="background-color: rgb(255, 255, 255);" title=""python: malloc.c:4628: _int_mall"...,
101python: malloc.c:4628: _int_malloc: Assertion `(unsigned long)(size)
>= (unsigned long)(nb)' failed."" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">"python: malloc.c:4628: _int_malloc: Assertion `(unsigned long)(size) >= (unsigned long)(nb)' failed."</span><span style="background-color: rgb(255, 255, 255);" title="El error se
ocasiona cuando se ejecuta Vect_open_old() ..." onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'"><br></span><span style="background-color: rgb(255, 255, 255);" title="Actualicé el código a la versión 42566 pero
sigo teniendo el mismo problema." onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">I updated the code to the
42566 version but I still have the same problem. </span><span title="¿alguna sugerencia?." onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'"></span></span><span id="result_box" class="long_text"><span title="¿alguna
sugerencia?." onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">Any suggestions?</span></span>. <span id="result_box" class="long_text"><span style="" title=""> </span><span style="" title="">I will keep trying!.</span></span><span id="result_box" class="long_text"><span style="background-color: rgb(255, 255, 255);" title=""> </span><span style="background-color: rgb(255, 255, 255);" title="">Thank you. </span><span style="background-color: rgb(255, 255, 255);" title="">Fernando.</span></span><span id="result_box" class="long_text"><span title="¿alguna sugerencia?." onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'"></span></span><br>
<br clear="all">Ing. Fernando Pacheco M.S.L.<br><br>Ingesur srl<br>Dirección: Requena 1062 ap.302, Montevideo, Uruguay.<br>Teléfonos: (+598 2) 408 90 48, (+598 9) 962 79 32<br>Web: <a href="http://ingesur.com.uy/">http://ingesur.com.uy/</a><br>
<br>
<br><br><div class="gmail_quote">On Tue, Jun 15, 2010 at 2:10 PM, Fernando Pacheco <span dir="ltr"><<a href="mailto:fernando.pacheco@ingesur.com.uy">fernando.pacheco@ingesur.com.uy</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Woks!. Thank you. Fernando.<div class="im"><br><br clear="all">Ing. Fernando Pacheco M.S.L.<br><br>Ingesur srl<br>Dirección: Requena 1062 ap.302, Montevideo, Uruguay.<br>Teléfonos: (+598 2) 408 90 48, (+598 9) 962 79 32<br>
Web: <a href="http://ingesur.com.uy/" target="_blank">http://ingesur.com.uy/</a><br>
<br><br></div><div><div></div><div class="h5"><div class="gmail_quote">On Tue, Jun 15, 2010 at 1:56 PM, Glynn Clements <span dir="ltr"><<a href="mailto:glynn@gclements.plus.com" target="_blank">glynn@gclements.plus.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><br>
Fernando Pacheco wrote:<br>
<br>
> I'm trying to access a grass vector map with python (2.6). I'm using the svn<br>
> version (revision 42 565) but keep getting "Segmentation fault" when trying<br>
> to open the file with Vect_open_old (map, input, mpaset). The code I'm using<br>
> can be found here: <a href="http://osgeo.pastebin.com/VLGunxyq" target="_blank">http://osgeo.pastebin.com/VLGunxyq</a><br>
> Can you please tell me I'm doing wrong (the same code works well with python<br>
> libraries generated with SWIG)?.<br>
<br>
</div>There are two problems, one in your code, one in the ctypes wrappers.<br>
<br>
First, Vect_open_old needs a pointer to a a Map_info structure, not<br>
the structure itself, so you need to use byref(), e.g.:<br>
<br>
from ctypes import *<br>
<br>
...<br>
<br>
vector.Vect_open_old(byref(map), input, mapset)<br>
<br>
Second, if LFS is enabled, any files which use the vector structures<br>
are compiled with -D_FILE_OFFSET_BITS=64. This wasn't being passed to<br>
the preprocessor when the ctypes wrappers were generated, resulting in<br>
incorrect wrappers being generated for various structures, including<br>
the Map_info structure. This should be fixed by r42566.<br>
<font color="#888888"><br>
--<br>
Glynn Clements <<a href="mailto:glynn@gclements.plus.com" target="_blank">glynn@gclements.plus.com</a>><br>
</font></blockquote></div><br>
</div></div></blockquote></div><br>