Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 106703 - sqlite 3.2.5 and 3.2.6 and pysqlite 2.0.3 result in python crash using trac
Summary: sqlite 3.2.5 and 3.2.6 and pysqlite 2.0.3 result in python crash using trac
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Anders Rune Jensen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-20 11:15 UTC by Chandler Carruth
Modified: 2005-11-06 09:38 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chandler Carruth 2005-09-20 11:15:06 UTC
Bug found using the Trac SCM software, but appears to be unrelated to Trac,
rather to pysqlite and sqlite. With pysqlite v 2.0.3 (latest ~x86), sqlite 3.2.5
and 3.2.6 both cause a crash. Traceback below from the Trac logging utils.
Unsure whether bug is in pysqlite or sqlite, but somehow these conflict.

Reproducible: Always
Steps to Reproduce:
1. emerge latest (~x86) pysqlite-2.0.3 and >=sqlite-3.2.5
2. emerge and set up trac (need trac-svn version perhaps) (or perhaps similar?)
3. perform *several* db-using queries to trac. Won't crash on the first, and
sometimes not for several.

Actual Results:  
Crash of python. Trac generates this error which includes the python traceback:

2005-09-20 13:51:40,493 Trac[main] ERROR: library routine called out of sequence
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/modpython_frontend.py", line
205, in handler
    dispatch_request(mpr.path_info, mpr, env)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 139, in
dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 80, in dispatch
    req.perm = PermissionCache(self.env, req.authname)
  File "/usr/lib/python2.4/site-packages/trac/perm.py", line 276, in __init__
    self.perms = PermissionSystem(env).get_user_permissions(username)
  File "/usr/lib/python2.4/site-packages/trac/perm.py", line 132, in
get_user_permissions
    for perm in self.store.get_user_permissions(username):
  File "/usr/lib/python2.4/site-packages/trac/perm.py", line 213, in
get_user_permissions
    cursor.execute("SELECT username,action FROM permission")
  File "/usr/lib/python2.4/site-packages/trac/db.py", line 208, in execute
    sqlite.Cursor.execute(self, sql, args or [])
OperationalError: library routine called out of sequence
2005-09-20 13:51:40,494 Trac[main] ERROR: Failed to render pretty error page:
object does not support item assignment
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 219, in
send_pretty_error
    populate_hdf(req.hdf, env, req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 151, in
populate_hdf
    hdf['trac'] = {
TypeError: object does not support item assignment


Expected Results:  
Correctly served page to web.

hermes portage # emerge info
Portage 2.0.52-r1 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r1,
2.6.12-morph6 i686)
=================================================================
System uname: 2.6.12-morph6 i686 Intel(R) Xeon(TM) CPU 2.80GHz
Gentoo Base System version 1.12.0_pre8
dev-lang/python:     2.3.4-r1, 2.4.1-r1
sys-apps/sandbox:    1.2.13
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -mfpmath=sse -O3 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-march=pentium4 -mfpmath=sse -O3 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distcc distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.mirrors.pair.com/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="x86 apache2 avi berkdb bitmap-fonts crypt eds emboss encode fam foomaticdb
fortran ftp gd gdbm gif gpm gstreamer imagemagick imlib ipv6 jpeg ldap libg++
libwww mad mikmod mmx mp3 mpeg mysql ncurses nptl nptlonly ogg oggvorbis opengl
oss pam pdflib perl png python qt quicktime readline ruby sdl spell sqlite sse
sse2 ssl tcpd tetex truetype truetype-fonts type1-fonts unicode usb utf8 vhosts
vorbis xml xml2 xmms xv zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 1 Seemant Kulleen (RETIRED) gentoo-dev 2005-09-20 14:12:39 UTC
Anders, you might want to remove Tal from the metadata.xml since he's been
missing in action for a donkey's age.
Comment 2 Chandler Carruth 2005-09-20 14:32:01 UTC
I have tested now w/ pysqlite-2.0.4, and got the same error. Looking for someone
to confirm this outside of my system.
Comment 3 Anders Rune Jensen (RETIRED) gentoo-dev 2005-09-20 14:41:34 UTC
(In reply to comment #1)
> Anders, you might want to remove Tal from the metadata.xml since he's been
> missing in action for a donkey's age.

Yeah that is probably a good idea.
Comment 4 Anders Rune Jensen (RETIRED) gentoo-dev 2005-10-12 12:07:06 UTC
Could you try sqlite-3.2.7?

I had the kinds of errors you are seeing in a program of mine when I tried
modifying the database from two threads at the same time without proper locking.
Is your sqlite compiled with or without threadsafety (nothreadsafe useflag)?
Comment 5 Chandler Carruth 2005-10-12 12:22:59 UTC
(In reply to comment #4)
> Could you try sqlite-3.2.7?
> 
> I had the kinds of errors you are seeing in a program of mine when I tried
> modifying the database from two threads at the same time without proper locking.
> Is your sqlite compiled with or without threadsafety (nothreadsafe useflag)?

Interestingly, it is no longer occurring w/ 3.2.7. I am always compiling it with
threadsafety. It seems 3.2.7 is unaffected.

-cc
Comment 6 Alastair Tse (RETIRED) gentoo-dev 2005-11-05 07:18:47 UTC
arj, should sqlite-3.2.7 be promoted to stable then?
Comment 7 Anders Rune Jensen (RETIRED) gentoo-dev 2005-11-05 11:27:05 UTC
Yes it should. Thanks for getting my attention to this bug again. The response
from Chandler was lost in the massive amount of bug mails ;-)
Comment 8 Anders Rune Jensen (RETIRED) gentoo-dev 2005-11-06 09:38:53 UTC
3.2.7 now stable on amd64. x86 will follow soon.