unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Sunjoong Lee <sunjoong@gmail.com>
To: David Pirotte <david@altosw.be>
Cc: guile-user@gnu.org
Subject: Re: crash in guile-sqlite3
Date: Sat, 28 Apr 2012 05:08:26 +0900	[thread overview]
Message-ID: <CAK93xhq3rFidVtVS23eMsPQZ5rz1cY+t=WSKVobcKtfAoNZCoA@mail.gmail.com> (raw)
In-Reply-To: <20120427160028.7bff8d19@rascar>

[-- Attachment #1: Type: text/plain, Size: 1875 bytes --]

Hi, David;

2012/4/28 David Pirotte <david@altosw.be>
>
> Best would be to send us an small, complete and concise example of you
> consider
> reproducible, could you d that ?
>

I mean a example code of Joonas Sarajärvi,
http://paste.pocoo.org/show/587676/ , produces a Segmentation fault on
Guile 2.0.5 too. I though what if a integer. In the integer case, there is
no Segmentation fault. Here is a diff of my test code from Joonas's:

--- ex0.scm.old 2012-04-28 04:41:23.545825725 +0900
+++ ex0.scm 2012-04-28 04:51:47.065231945 +0900
@@ -16,16 +16,16 @@
   (sqlite-finalize stmt))

 (display "creating\n")
-(let* ((sql "CREATE TABLE foos(dbid INTEGER PRIMARY KEY, name TEXT);")
+(let* ((sql "CREATE TABLE foos(dbid INTEGER PRIMARY KEY, name INTEGER);")
        (stmt (sqlite-prepare db sql)))
   (sqlite-step stmt)
   (sqlite-finalize stmt))

 ;; Insert some rows of data.
 (display "inserting\n")
-(let ((name "myfoo")
+(let ((name 10)
       (stmt (sqlite-prepare db "INSERT INTO foos(name) VALUES(?);")))
-  (display (string-append "for \"" name "\":\n"))
+  (display (string-append "for " (number->string name) ":\n"))
   (display "binding\n")
   (sqlite-bind stmt 1 name)
   (display "stepping\n")
@@ -34,7 +34,7 @@
   ;; This finalize call in particular seems to break things
   (sqlite-finalize stmt)
   ;; This seems to be never reached.
-  (display "finalized\n")))
+  (display "finalized\n"))

 (display "closing\n")
 (sqlite-close db)
\ No newline at end of file

The differences are only string to integer but Joonas's code produces a
Segmentation fault. Why? So, I read the sqlite3.scm, Andy's Guile-SQLite3.
And then, I realized sqlite-bind will call different functions; bind-int64
and bind-text. Joonas asked the insight on why this is happening. It would
be best if I be able to solve that for Joonas.

[-- Attachment #2: Type: text/html, Size: 3646 bytes --]

  reply	other threads:[~2012-04-27 20:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-27  5:40 crash in guile-sqlite3 Sunjoong Lee
2012-04-27 19:00 ` David Pirotte
2012-04-27 20:08   ` Sunjoong Lee [this message]
2012-04-27 22:58     ` David Pirotte
2012-04-27 23:59     ` David Pirotte
2012-04-29  1:58 ` Sunjoong Lee
2012-04-30  9:00   ` Andy Wingo
2012-04-30 10:32     ` Sunjoong Lee
2012-04-30 10:46       ` Andy Wingo
2012-04-30 12:44         ` Sunjoong Lee
2012-05-01 11:45   ` Joonas Sarajärvi
2012-05-01 15:01     ` Joonas Sarajärvi
2012-05-01 15:05       ` Daniel Krueger
2012-05-01 15:10         ` Daniel Krueger
  -- strict thread matches above, loose matches on Subject: below --
2012-05-01 19:37 Sunjoong Lee
2012-05-02  4:41 ` Joonas Sarajärvi
2012-04-26 18:51 Joonas Sarajärvi
2012-04-26 20:24 ` rixed
2012-04-26 21:04   ` Noah Lavine
2012-04-27  6:31     ` rixed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK93xhq3rFidVtVS23eMsPQZ5rz1cY+t=WSKVobcKtfAoNZCoA@mail.gmail.com' \
    --to=sunjoong@gmail.com \
    --cc=david@altosw.be \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).