scsh-hackers
[Top] [All Lists]

Re: C extension problems

To: Michael Sperber <sperber@informatik.uni-tuebingen.de>
Subject: Re: C extension problems
From: Kristof Bastiaensen <kristof@vleeuwen.org>
Date: Thu, 29 Dec 2005 13:50:41 +0100
Cc: scsh-hackers@scsh.net
List-id: Discussion among the implementors <scsh-hackers.list-id.scsh.net>
At Thu, 29 Dec 2005 07:55:44 +0100,
Michael Sperber wrote:
> 
> 
> Kristof Bastiaensen <kristof@vleeuwen.org> writes:
> 
> > #0  0x41527124 in __pthread_sigsuspend () from /lib/libpthread.so.0
> > #1  0x41525f29 in __pthread_wait_for_restart_signal () from 
> > /lib/libpthread.so.0
> > #2  0x41526c89 in pthread_create@@GLIBC_2.1 () from /lib/libpthread.so.0
> > #3  0x414f207c in sqlite3OsTempFileName () from /usr/lib/libsqlite3.so.0
> 
> So it *is* stuck somewhere deep in the bowels of sqlite.  Can you
> reproduce the problem with an sqlite compiled with -g and get the line
> number where it's stuck in sqlite3OsTempFileName?  I'm a bit mystified
> that it should be domething with threads---the definition I see in
> sqlite 3.2.8 doesn't seem to do that directly.
>

So am I.  I found that configuring sqlite3 with --disable-threadsafe
will make the problem disappear.  I don't understand however why it
works with scheme48 but not with scsh, since both don't use threads.
Perhaps this is a bug in sqlite3?

Here is the backtrace with more information:

#0  0x4152c124 in __pthread_sigsuspend () from /lib/libpthread.so.0
#1  0x4152af29 in __pthread_wait_for_restart_signal ()
   from /lib/libpthread.so.0
#2  0x4152bc89 in pthread_create@@GLIBC_2.1 () from /lib/libpthread.so.0
#3  0x414df29b in testThreadLockingBehavior (fd_orig=-4) at src/os_unix.c:371
#4  0x414df5e2 in findLockInfo (fd=3, ppLock=0xfffffffc, ppOpen=0xfffffffc)
    at src/os_unix.c:428
#5  0x414df6a6 in sqlite3OsOpenReadWrite (
    zFilename=0x807ce58 "/tmp/existing", id=0xbffff4c0, pReadonly=0xbffff3ec)
    at src/os_unix.c:535
#6  0x4150576f in sqlite3pager_open (ppPager=0x807ce28, 
    zFilename=0x40794cd8 "/tmp/existing", nExtra=80, flags=-4)
    at src/pager.c:1624
#7  0x414f0ee1 in sqlite3BtreeOpen (zFilename=0x40794cd8 "/tmp/existing", 
    ppBtree=0x807cc04, flags=-4) at src/btree.c:1239
#8  0x414de85e in sqlite3BtreeFactory (db=0x807cb30, 
    zFilename=0x41532ff4 "pþ", omitJournal=0, nCache=-4, ppBtree=0x807cc04)
    at src/main.c:624
#9  0x414decc9 in openDatabase (zFilename=0x40794cd8 "/tmp/existing", 
    ppDb=0xbffff614) at src/main.c:762
#10 0x414dd62f in s48_sqlite3_open () from /usr/lib/scsh-sqlite3.so
#11 0x0805ead2 in s48_external_call ()
#12 0x08059d1a in s48_restart ()
#13 0x0805b9ed in s48_call_startup_procedure ()
#14 0x0804edea in internal_s48_main ()
#15 0x0804ea45 in main ()

Kristof Bastiaensen

<Prev in Thread] Current Thread [Next in Thread>