Hmmm... this is getting even more interesting.&nbsp; I gave sqlid.plt a try, and generated the transcript below:<br><br>Welcome to MzScheme v370 [3m], Copyright (c) 2004-2007 PLT Scheme Inc.<br>&gt;&nbsp;&nbsp; (require (planet &quot;sqli.scm
&quot; (&quot;oesterholt&quot; &quot;sqlid.plt&quot; 1 5))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (planet &quot;sqld-sqlite.scm&quot; (&quot;oesterholt&quot; &quot;sqld-sqlite.plt&quot; 1 0)))<br>&gt;&nbsp;&nbsp; (define *dbd* (sqld-sqlite-new &quot;/home/keithf/test.s3&quot;))
<br>&gt;&nbsp;&nbsp; (define *dbh* (sqli-connect *dbd*))<br>&gt;&nbsp;&nbsp; (define dbi (sqli-closure *dbh*))<br>&gt;&nbsp;&nbsp; (require (lib &quot;list.ss&quot;) (lib &quot;etc.ss&quot;))<br>&gt;&nbsp;&nbsp; (dbi &#39;query &quot;select * from notes where id &gt; 600000 and id &lt; 601000;&quot;)
<br>#f<br>&gt;&nbsp;&nbsp; (define x (dbi &#39;fetchall))<br>&gt;&nbsp;&nbsp; (equal? (map (lambda (v) (string-&gt;number (car v))) x)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (build-list 999 (lambda (i) (+ i 600001))))<br>#t<br>&gt; ; So far, so good... Now watch:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp; (dbi &#39;query &quot;select * from notes where id &gt; 600000 and id &lt; 1000000;&quot;)<br>procedure application: expected procedure, given: #&lt;bad-value&gt;; arguments were: 2 (&quot;603504&quot; &quot;5dd1d22a77beecafba55698c85e243b7&quot;)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;=== context ===<br>/home/keithf/.plt-scheme/planet/300/370/cache/oesterholt/sqld-sqlite.plt/1/7/sqld-i-sqlite.scm:101:8: sqlite-i-callback
<br>/home/keithf/.plt-scheme/planet/300/370/cache/oesterholt/sqld-sqlite.plt/1/7/sqld-i-sqlite.scm:64:42: ffi-wrapper:sqlite3_exec<br>/home/keithf/.plt-scheme/planet/300/370/cache/oesterholt/sqld-sqlite.plt/1/7/sqld-i-sqlite.scm
:136:8: c-sqlite-query<br>/home/keithf/.plt-scheme/planet/300/370/cache/oesterholt/sqld-sqlite.plt/1/7/sqld-sqlite-internal.scm:199:4<br>/home/keithf/.plt-scheme/planet/300/370/cache/oesterholt/sqlid.plt/1/5/sqli.scm:926:4
<br><br>If you manage to track down this problem, it&#39;s probably a similar difficulty as I&#39;m having with sqlite.plt<br><br><div><span class="gmail_quote">On 8/31/07, <b class="gmail_sendername">Hans Oesterholt-Dijkema
</b> &lt;<a href="mailto:hdnews@gawab.com">hdnews@gawab.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


  

<div bgcolor="#ffffff" text="#000000">
I experienced also seg faults with 370. However, I only noticed<br>
them while using threads. I think I&#39;ve solved them in the sqlite driver.<br>
Maybe that helps? Have a go with sqld-sqlite.plt.<br>
<br>
--Hans<br>
<br>
<br>
<br>
Keith Frost schreef:
<blockquote type="cite"><div><span class="e" id="q_114bd0d947df038c_1">Well, I&#39;m at a loss, for now.&nbsp; I&#39;ve gone through sqlite.ss
and added &#39;raw to every malloc call in the file, and I still get random
memory corruption and segmentation violations when running, for example<br>
(select&nbsp; *my-db*&nbsp; &quot;select * from&nbsp; my_table where my_index &gt; 600000
and my_index &lt; 1000000&quot;)
  <br>
where there are 399999 result rows, with two columns, from my_table.&nbsp; <br>
  <br>
I thought it might be related to callbacks, but there are no callbacks
used in the particular code path I&#39;m testing.&nbsp; It seems to me that
something must be going awry when libsqlite3 allocates the space to
hold the strings from the query, and sets the pointers allocated by
mzscheme to point to this space.&nbsp; Is it possible that the system
malloc() is getting shadowed somehow by mzscheme?&nbsp; I know that sounds
crazy....
  <br>
  <br>
By the way, this behavior is not restricted to RHEL3; I see the same
problems on Debian Etch.<br>
  <br>
Is anybody else here getting substantial, reliable use out of
sqlite.plt on 370 or 371?&nbsp; On what platform?<br>
  <br>
Thanks, <br>
  <br>
Keith Frost<br>
  </span></div><pre><hr size="4" width="90%"><span class="q">
_________________________________________________<br>  For list-related administrative tasks:<br>  <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a>
  </span></pre>
</blockquote>
</div>

</blockquote></div><br>