[racket-dev] SIGSEGV MAPERR si_code 1 fault on addr (nil) when inserting rows via "db" / SQLite

From: Eric Hanchrow (eric.hanchrow at gmail.com)
Date: Sun Nov 13 14:15:26 EST 2011

For what it's worth, on OS X the error message is a bit different:  "Seg fault (internal error during gc) at 0x0".

On Nov 12, 2011, at 4:42 PM, Eric Hanchrow wrote:

> This is with racket 5.2, from Ubuntu:
> 
> Package: racket
> Version: 5.2.0-3
> 
> When I invoke the following file (on Ubuntu Linux erich-laptop
> 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:50:42 UTC 2011 i686 i686
> i386 GNU/Linux), I see
> 
> $ rm -rfv /tmp/bug* ; racket ./repro.rkt
> removed `/tmp/buggissimo'
> SIGSEGV MAPERR si_code 1 fault on addr (nil)
> /bin/bash: line 1: 12150 Aborted                 racket ./repro.rkt
> 
> #lang racket
> 
> (require
> (only-in db
>          query-exec
>          query-value
>          sqlite3-connect))
> 
> (define db
>  (sqlite3-connect #:database "/tmp/buggissimo" #:mode 'create))
> 
> (query-exec
> db
> "CREATE TABLE IF NOT EXISTS
>        log_word_map(word TEXT, log_id INTEGER,
>            PRIMARY KEY (word, log_id)
>            ON CONFLICT FAIL)")
> 
> (query-exec db "BEGIN TRANSACTION")
> 
> (for ([x (in-range 20000)])
>  (query-exec
>   db
>   "insert into log_word_map values (?, ?)"
>   (number->string x) 99))
> 
> (query-exec db "COMMIT")




Posted on the dev mailing list.