[ python-Bugs-1581906 ] test_sqlite fails on OSX G5 arch if test_ctypes is run

SourceForge.net noreply at sourceforge.net
Sat Jun 30 04:45:36 CEST 2007


Bugs item #1581906, was opened at 2006-10-21 13:02
Message generated for change (Comment added) made by montanaro
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1581906&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.6
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Skip Montanaro (montanaro)
Assigned to: Thomas Heller (theller)
Summary: test_sqlite fails on OSX G5 arch if test_ctypes is run

Initial Comment:
I noticed a test_sqlite test failure on my Mac G5 the other day while trying 
to set up a buildbot for sqlalchemy.  Everything runs fine on my G4 
powerbook.  Both machines run Mac OSX 10.4.8 with Apple's gcc 4.0.0, 
build 5026.

I whittled the problem down to just having test_ctypes and test_sqlite 
enabled, then further whittled it down to just having Lib/ctypes/test/
test_find.py available (all other ctypes tests eliminated).  More detailed 
problem descriptions are in these two postings to python-dev:

    http://article.gmane.org/gmane.comp.python.devel/84478
    http://article.gmane.org/gmane.comp.python.devel/84481

Skip


----------------------------------------------------------------------

>Comment By: Skip Montanaro (montanaro)
Date: 2007-06-29 21:45

Message:
Logged In: YES 
user_id=44345
Originator: YES

One other minor(?) data point.  I am using a version of sqlite3 which I
compiled and installed, not Apple's older version:

>>> sqlite3.version, sqlite3.sqlite_version
('2.3.3', '3.3.8')
...
% pwd
/Users/skip/local/lib/python2.6/lib-dynload
% otool -L _sqlite3.so 
_sqlite3.so:
        /Users/skip/local/lib/libsqlite3.0.dylib (compatibility version
9.0.0, current version 9.6.0)
        /usr/lib/libmx.A.dylib (compatibility version 1.0.0, current
version 93.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 88.1.7)

It appears those of us who can reproduce the problem all have slightly
different installs (2.5 v. 2.6, Apple's GCC v. DarwinPorts, Apple's sqlite3
v. DarwinPorts v. homebuilt, G4 v. G5 v. Intel architecture).


----------------------------------------------------------------------

Comment By: Skip Montanaro (montanaro)
Date: 2007-06-29 21:39

Message:
Logged In: YES 
user_id=44345
Originator: YES

Fails for me as well (Python 2.6a0, PowerBook G4, 10.4.10, Apple's GCC
4.0.1).  Thomas, can you reproduce with the lines marketdickinson used?

I don't see any directory changing going on:

% python
Python 2.6a0 (trunk:54264M, Mar 10 2007, 15:19:48) 
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getcwd()
'/Users/skip'
>>> from ctypes import CDLL>>>
CDLL('/System/Library/Frameworks/GLUT.framework/GLUT').glutWireTetrahedron<_FuncPtr
object at 0x106c6c0>
>>> os.getcwd()
'/Users/skip'
>>> import sqlite3
>>> sqlite3.connect(":memory:")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ProgrammingError: library routine called out of sequence
>>> os.getcwd()
'/Users/skip'

Pass it back if you still can't reproduce the problem.  Meanwhile I've
subscribed to the pysqlite mailing list and will ask there.

Skip


----------------------------------------------------------------------

Comment By: Mark Dickinson (marketdickinson)
Date: 2007-06-29 18:37

Message:
Logged In: YES 
user_id=703403
Originator: NO

And also on Python 2.5, compiled under Apple's GCC. (Still OS X
10.4.10/G4)
The following four lines of Python code are enough to cause the problem
for me.

Interestingly, if the second and third lines are exchanged (so that the
two import commands come first), then no exception is raised.

Python 2.5.1 (r251:54863, May 10 2007, 20:59:25) 
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import CDLL
>>>
CDLL('/System/Library/Frameworks/GLUT.framework/GLUT').glutWireTetrahedron
<_FuncPtr object at 0x514500>
>>> import sqlite3
>>> sqlite3.connect(":memory:")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
sqlite3.ProgrammingError: library routine called out of sequence



----------------------------------------------------------------------

Comment By: Mark Dickinson (marketdickinson)
Date: 2007-06-29 14:11

Message:
Logged In: YES 
user_id=703403
Originator: NO

I've just noticed the same failure on an iBook G4, with OS X 10.4.10,
sqlite version 3.4.0, 
and Python built with gcc 4.2.0 (from macports).

(Python 2.6a0 (trunk:56123M, Jun 29 2007, 13:22:18) 
[GCC 4.2.0] on darwin)




----------------------------------------------------------------------

Comment By: ted pollari (incongruity)
Date: 2007-06-13 15:19

Message:
Logged In: YES 
user_id=1375728
Originator: NO

FWIW, I'm getting an identical error on a MacBook Pro with a Core Duo
processor

----------------------------------------------------------------------

Comment By: Thomas Heller (theller)
Date: 2007-05-04 09:04

Message:
Logged In: YES 
user_id=11105
Originator: NO

FYI, this PyOpenGL bug may be related:

https://sourceforge.net/tracker/?func=detail&atid=105988&aid=1712741&group_id=5988

----------------------------------------------------------------------

Comment By: Thomas Heller (theller)
Date: 2007-03-22 15:18

Message:
Logged In: YES 
user_id=11105
Originator: NO

Skip,

I do not have a G5 machine available, only a G4 and the problem doesn't
appear there.
For someone with a G5 it should not be too difficult to reproduce (or
investigate),
I think that running './python Lib/test/regrtest.py test_ctypes
test_sqlite' should suffice.

However, if loading the GLUT library changes the cwd, and sqlite fails
with a changed working dir,
I'm not sure where the problem really is and how it should be fixed.  It
could be said that test_ctypes
should restore the cwd after the tests (but maybe this should be done by
the test framework?),
or it could be said that test_sqlite should set the cwd in case the test
relies on it.

I'll assign back to you because I have no way to test it on a machine
where the problem appears.

----------------------------------------------------------------------

Comment By: Skip Montanaro (montanaro)
Date: 2007-03-18 12:20

Message:
Logged In: YES 
user_id=44345
Originator: YES

Thomas, I assigned this to you simply so you can cast your eye on the
problem and see if you think there might be anything ctypes-related in the
problem I've reported.  I've ignored it up 'til now, but I bumped up
against it again trying to get the Pybots SQLAlchemy test suite running on
my Mac.  During my previous encounter with this problem Ronald Oussouren
reported on a possible connection with GLUT:

    http://mail.python.org/pipermail/python-dev/2006-October/069523.html

Assuming there is no obvious ctypes connection you can determine  (it's
not clear to me that there is any current directory funny business going
on) just assign it back to me and I'll try to find a pysqlite expert to
take a look.

Thx,

Skip


----------------------------------------------------------------------

Comment By: Skip Montanaro (montanaro)
Date: 2006-10-21 13:04

Message:
Logged In: YES 
user_id=44345

Another article here:

    http://article.gmane.org/gmane.comp.python.devel/84487


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1581906&group_id=5470


More information about the Python-bugs-list mailing list