• Bug#267082: python2.3-sqlite: on importing sqlite from python, the scri

    From alexs@1:229/2 to All on Fri Aug 20 18:00:19 2004
    From: [email protected]

    Package: python2.3-sqlite
    Version: 0.5.1-1
    Severity: critical
    Justification: breaks unrelated software

    on importing SQLite module in python the program dies from a Segmentation fault. strace suggest it may be to do with the math module, but the math
    module by itself load fine.

    the minimum script for it to break is

    #!/usr/bin/python
    import sqlite

    the last couple of line in the strace are,

    stat64("/usr/lib/python2.3/lib-tk/math", 0xbfffa760) = -1 ENOENT (No such file or directory)
    open("/usr/lib/python2.3/lib-tk/math.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
    open("/usr/lib/python2.3/lib-tk/mathmodule.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
    open("/usr/lib/python2.3/lib-tk/math.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
    open("/usr/lib/python2.3/lib-tk/math.pyc", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
    stat64("/usr/lib/python2.3/lib-dynload/math", 0xbfffa760) = -1 ENOENT (No such file or directory)
    open("/usr/lib/python2.3/lib-dynload/math.so", O_RDONLY|O_LARGEFILE) = 7 fstat64(7, {st_mode=S_IFREG|0644, st_size=16368, ...}) = 0 open("/usr/lib/python2.3/lib-dynload/math.so", O_RDONLY) = 8
    read(8, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260\21"..., 512) = 512 fstat64(8, {st_mode=S_IFREG|0644, st_size=16368, ...}) = 0
    old_mmap(NULL, 15332, PROT_READ|PROT_EXEC, MAP_PRIVATE, 8, 0) = 0x40297000 old_mmap(0x4029a000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 8, 0x3000) = 0x4029a000
    close(8) = 0
    close(7) = 0
    gettimeofday({1093015779, 680336}, NULL) = 0
    --- SIGSEGV (Segmentation fault) @ 0 (0) ---
    +++ killed by SIGSEGV +++



    -- System Information:
    Debian Release: 3.1
    APT prefers testing
    APT policy: (1000, 'testing')
    Architecture: i386 (i686)
    Kernel: Linux 2.6.7-lock
    Locale: LANG=C, LC_CTYPE=C

    Versions of packages python2.3-sqlite depends on:
    ii libc6 2.3.2.ds1-13 GNU C Library: Shared libraries an ii libsqlite0 2.8.13-3 SQLite shared library
    ii python2.3 2.3.4-5 An interactive high-level object-o

    -- no debconf information


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Joel Rosdahl@1:229/2 to alexs on Fri Aug 20 20:00:14 2004
    From: [email protected]

    Hi,

    Thanks for the report.

    alexs <[email protected]> writes:

    on importing SQLite module in python the program dies from a
    Segmentation fault. strace suggest it may be to do with the math
    module, but the math module by itself load fine.

    the minimum script for it to break is

    #!/usr/bin/python
    import sqlite

    I can't reproduce this.

    However, I recognize the error; I've seen it before. It happened when
    I was packaging the newest version (2.0.5) of python-egenix-*. After
    installing the new packages, python-sqlite segfaulted exactly like it
    did for you. After removing python2.3-egenix-mxdatetime, it started
    working again, so it seems to be connected to PySQLite's use of
    mxDateTime. But I was able to work around the problem (without knowing
    the exact cause of it) in python-egenix-*, so the 2.0.5-1 packages
    seem to work OK.

    Here is a demo build of python2.3-egenix-mx{tools,datetime} that makes python-sqlite crash in the above mentioned way:

    http://joel.rosdahl.net/tmp/python2.3-egenix-mxtools_2.0.5-1+segfaultdemo_i386.deb
    http://joel.rosdahl.net/tmp/python2.3-egenix-mxdatetime_2.0.5-1+segfaultdemo_i386.deb

    So: Do you by any chance have python2.3-egenix-mxdatetime installed,
    and if so, what version? Or a local build of it?

    Does the sqlite module start working again if you apply the following
    patch?

    ======================================================================
    --- /usr/lib/python2.3/site-packages/sqlite/main.py~ 2004-07-04 00:24:18.000000000 +0200
    +++ /usr/lib/python2.3/site-packages/sqlite/main.py 2004-08-20 19:31:51.000000000 +0200
    @@ -4,11 +4,12 @@
    import copy, new, sys, weakref
    from types import *

    -try:
    - from mx import DateTime
    - have_datetime = 1
    -except ImportError:
    - have_datetime = 0
    +#try:
    +# from mx import DateTime
    +# have_datetime = 1
    +#except ImportError:
    +# have_datetime = 0
    +have_datetime = 0

    if have_datetime:
    # Make the required Date/Time constructor visable in the PySQLite module. ======================================================================

    Joel

    --
    Joel Rosdahl <[email protected]>
    Key BB845E97; fingerprint 9F4B D780 6EF4 5700 778D 8B22 0064 F9FF BB84 5E97


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the t