[racket] crash possibly related to sqlite

From: Dmitry Pavlov (dpavlov at ipa.nw.ru)
Date: Thu Jul 3 17:01:37 EDT 2014

Hello,

I have a big Racket+C program that does numerical
integration and uses flvectors, unsafe ops and ffi.

Recently I added some access to sqlite3 too.
The program instantly got the habit of crashing at
random moments, after running safely for hours.
It never happened before, so I guess the most likely
suspect is the sqlite library.

The crash message is:
SIGSEGV MAPERR si_code 1 fault on addr (nil)

I managed to build a racket binary with debug info
from the most recent source
116555c5177e306e9e871ce36af2fadbaedcbd7e

Below is what I have obtained from the core dump.
So my question is: how does one debug that
kind of thing? Is it possible to make the crash
happen faster? Is it possible to run racket with
array boundary and stack and memory checks,
or run racket under valgrind or something?

Best regards,

Dmitry



$ gdb ~/racket/racket/bin/racket core
GNU gdb (GDB) 7.6.2 (Debian 7.6.2-1)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/dpavlov/racket/racket/bin/racket...done.

warning: core file may not match specified executable file.
[New LWP 19719]
[New LWP 19720]

warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/home/dpavlov/racket/racket/bin/racket integte2.slon'.
Program terminated with signal 6, Aborted.
#0  0x00007f6bbf9773a9 in __GI_raise (sig=sig at entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007f6bbf9773a9 in __GI_raise (sig=sig at entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007f6bbf97a4c8 in __GI_abort () at abort.c:89
#2  0x000000000078dd29 in fault_handler (sn=11, si=0x1e86670, ctx=0x1e86540)
    at ./sighand.c:99
#3  <signal handler called>
#4  0x00007f6bbc583736 in ?? ()
#5  0x00007fff77e11b10 in ?? ()
#6  0x00007f6bc060d708 in ?? ()
#7  0x00007f6bbeb59c18 in ?? ()
#8  0x0000000000000001 in ?? ()
#9  0x0000000000000004 in ?? ()
#10 0x00007f6bbeb59c98 in ?? ()
#11 0x00007f6baccec548 in ?? ()
#12 0x00007f6bbeb59bd0 in ?? ()
#13 0x00007fff77e11a10 in ?? ()
#14 0x00007f6bbc03677b in ?? ()
#15 0x00007fff77e11a10 in ?? ()
#16 0x00007f6bbc773eea in ?? ()
#17 0x00007f6bbeb59be8 in ?? ()
#18 0x00007f6bc060d708 in ?? ()
#19 0x00007fff77e11c10 in ?? ()
#20 0x0000000000000005 in ?? ()
#21 0x0000000000000004 in ?? ()
#22 0x00007f6bbeb59cf0 in ?? ()
#23 0x00007f6bb4e89640 in ?? ()
#24 0x00007f6bbeb59c88 in ?? ()
#25 0x00007fff77e11a70 in ?? ()
#26 0x00007f6bc0616d9d in ?? ()
#27 0x00007f6bba6d1730 in ?? ()
#28 0x00007f6bbc777349 in ?? ()
#29 0x00007f6bb9e41608 in ?? ()
#30 0x0000000000000004 in ?? ()
#31 0x0000000000a71110 in scheme_default_prompt_tag ()
#32 0x0000000000004048 in ?? ()
#33 0x0000000000000004 in ?? ()
#34 0x0000000000000001 in ?? ()
#35 0x00007f6bbddebb10 in ?? ()
#36 0x00007fff77e11f80 in ?? ()
#37 0x00007fff77e11d90 in ?? ()
#38 0x00000000004564ec in scheme_do_eval (
    obj=0x7884bc <fast_malloc_one_small_tagged+202>, num_rands=32619,
    rands=0x7f6bac7b76f8, get_value=-1095394432) at ./../src/eval.c:2952
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)

Posted on the users mailing list.