Hmmm... this is getting even more interesting. 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>> (require (planet "sqli.scm
" ("oesterholt" "sqlid.plt" 1 5))<br> (planet "sqld-sqlite.scm" ("oesterholt" "sqld-sqlite.plt" 1 0)))<br>> (define *dbd* (sqld-sqlite-new "/home/keithf/test.s3"))
<br>> (define *dbh* (sqli-connect *dbd*))<br>> (define dbi (sqli-closure *dbh*))<br>> (require (lib "list.ss") (lib "etc.ss"))<br>> (dbi 'query "select * from notes where id > 600000 and id < 601000;")
<br>#f<br>> (define x (dbi 'fetchall))<br>> (equal? (map (lambda (v) (string->number (car v))) x)<br> (build-list 999 (lambda (i) (+ i 600001))))<br>#t<br>> ; So far, so good... Now watch:<br>
<br> (dbi 'query "select * from notes where id > 600000 and id < 1000000;")<br>procedure application: expected procedure, given: #<bad-value>; arguments were: 2 ("603504" "5dd1d22a77beecafba55698c85e243b7")
<br> <br> === 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's probably a similar difficulty as I'm having with sqlite.plt<br><br><div><span class="gmail_quote">On 8/31/07, <b class="gmail_sendername">Hans Oesterholt-Dijkema
</b> <<a href="mailto:hdnews@gawab.com">hdnews@gawab.com</a>> 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'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'm at a loss, for now. I've gone through sqlite.ss
and added 'raw to every malloc call in the file, and I still get random
memory corruption and segmentation violations when running, for example<br>
(select *my-db* "select * from my_table where my_index > 600000
and my_index < 1000000")
<br>
where there are 399999 result rows, with two columns, from my_table. <br>
<br>
I thought it might be related to callbacks, but there are no callbacks
used in the particular code path I'm testing. 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. Is it possible that the system
malloc() is getting shadowed somehow by mzscheme? 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? 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>