<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=&#39;#ebeff9&#39;" onmouseout="this.style.backgroundColor=&#39;#fff&#39;">I modified the code as 
you have suggested. </span><span title="Pero me encuentro con un nuevo 
problema." onmouseover="this.style.backgroundColor=&#39;#ebeff9&#39;" onmouseout="this.style.backgroundColor=&#39;#fff&#39;">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=&#39;#ebeff9&#39;" onmouseout="this.style.backgroundColor=&#39;#fff&#39;">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="&quot;python: malloc.c:4628: _int_mall&quot;..., 
101python: malloc.c:4628: _int_malloc: Assertion `(unsigned long)(size) 
&gt;= (unsigned long)(nb)&#39; failed.&quot;" onmouseover="this.style.backgroundColor=&#39;#ebeff9&#39;" onmouseout="this.style.backgroundColor=&#39;#fff&#39;">&quot;python: malloc.c:4628: _int_malloc: Assertion `(unsigned long)(size) &gt;= (unsigned long)(nb)&#39; failed.&quot;</span><span style="background-color: rgb(255, 255, 255);" title="El error se 
ocasiona cuando se ejecuta Vect_open_old() ..." onmouseover="this.style.backgroundColor=&#39;#ebeff9&#39;" onmouseout="this.style.backgroundColor=&#39;#fff&#39;"><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=&#39;#ebeff9&#39;" onmouseout="this.style.backgroundColor=&#39;#fff&#39;">I updated the code to the
 42566 version but I still have the same problem. </span><span title="¿alguna sugerencia?." onmouseover="this.style.backgroundColor=&#39;#ebeff9&#39;" onmouseout="this.style.backgroundColor=&#39;#fff&#39;"></span></span><span id="result_box" class="long_text"><span title="¿alguna 
sugerencia?." onmouseover="this.style.backgroundColor=&#39;#ebeff9&#39;" onmouseout="this.style.backgroundColor=&#39;#fff&#39;">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=&#39;#ebeff9&#39;" onmouseout="this.style.backgroundColor=&#39;#fff&#39;"></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">&lt;<a href="mailto:fernando.pacheco@ingesur.com.uy">fernando.pacheco@ingesur.com.uy</a>&gt;</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">&lt;<a href="mailto:glynn@gclements.plus.com" target="_blank">glynn@gclements.plus.com</a>&gt;</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>
&gt; I&#39;m trying to access a grass vector map with python (2.6). I&#39;m using the svn<br>
&gt; version (revision 42 565) but keep getting &quot;Segmentation fault&quot; when trying<br>
&gt; to open the file with Vect_open_old (map, input, mpaset). The code I&#39;m using<br>
&gt; can be found here: <a href="http://osgeo.pastebin.com/VLGunxyq" target="_blank">http://osgeo.pastebin.com/VLGunxyq</a><br>
&gt; Can you please tell me I&#39;m doing wrong (the same code works well with python<br>
&gt; 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&#39;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 &lt;<a href="mailto:glynn@gclements.plus.com" target="_blank">glynn@gclements.plus.com</a>&gt;<br>
</font></blockquote></div><br>
</div></div></blockquote></div><br>