
First of all 1000 apologies if this is the wrong list. Please redirect me if necessary.
I'm attempting to build python 2.5.1 fat binaries on OSX and statically link to a newer sqlite than what ships with OSX. (3.3.17).
I'm getting "Bus Error" early when I run my app. If I turn on a lot of malloc debugging options and run under gdb I get this trace:
(gdb) info threads * 1 process 18968 local thread 0x1003 0x900e41d1 in strtol_l () (gdb) bt #0 0x900e41d1 in strtol_l () #1 0x900160a5 in atoi () #2 0x9406fd80 in sqlite3InitCallback () #3 0x0381faf2 in sqlite3_exec (db=0x338d080, zSql=0x331f1e0 "SELECT name, rootpage, sql FROM 'main'.sqlite_master WHERE tbl_name='sqlite_sequence'", xCallback=0x9406fd00 <sqlite3InitCallback>, pArg=0xbfffde14, pzErrMsg=0x0) at ./src/legacy.c:93 #4 0x0384c769 in sqlite3VdbeExec (p=0x1945200) at ./src/vdbe.c:4090 #5 0x03816686 in sqlite3Step (p=0x1945200) at ./src/vdbeapi.c:236 #6 0x03816817 in sqlite3_step (pStmt=0x1945200) at ./src/vdbeapi.c:289 #7 0x0380b9aa in _sqlite_step_with_busyhandler (statement=0x1945200, connection=0x32a77a0) at /Users/pandora/build-toolchain/build/Python-2.5.1/Modules/_sqlite/util.c:33 #8 0x0380850d in cursor_executescript (self=0x32bd4d0, args=0x32a2d10) at /Users/pandora/build-toolchain/build/Python-2.5.1/Modules/_sqlite/cursor.c:788 #9 0x0020e6fc in PyObject_Call (func=0x329ecd8, arg=0x32a2d10, kw=0x0) at Objects/abstract.c:1860 #10 0x00292a36 in PyEval_CallObjectWithKeywords (func=0x329ecd8, arg=0x32a2d10, kw=0x0) at Python/ceval.c:3433 #11 0x0020e6cd in PyObject_CallObject (o=0x329ecd8, a=0x32a2d10) at Objects/abstract.c:1851 #12 0x03806e1c in connection_executescript (self=0x32a77a0, args=0x32a2d10, kwargs=0x0) at /Users/pandora/build-toolchain/build/Python-2.5.1/Modules/_sqlite/connection.c:1001 #13 0x002998ae in PyEval_EvalFrameEx (f=0x338c250, throwflag=0) at Python/ceval.c:3564
Can someone advise as to the correct configure arguments for sqlite or something else I might be missing?
Thanks in advance.
-- Darrin

"Darrin Thompson" darrinth@gmail.com wrote in message news:a2e649c70705252145u68735a40u236b35b422b085c7@mail.gmail.com... | First of all 1000 apologies if this is the wrong list. Please redirect | me if necessary.
Usage questions should usually be directed first to comp.lang.python / gmane.comp.python.general / python-list (all 3 are interconnected). Try that unless you get answer here fairly quickly. There are *many* more readers.

Darrin Thompson schrieb:
First of all 1000 apologies if this is the wrong list. Please redirect me if necessary.
The list is right, but the question is slightly wrong:
Can someone advise as to the correct configure arguments for sqlite or something else I might be missing?
The question for python-dev is "how can I debug that further, and where should I submit a patch" :-)
(gdb) info threads
- 1 process 18968 local thread 0x1003 0x900e41d1 in strtol_l ()
(gdb) bt #0 0x900e41d1 in strtol_l () #1 0x900160a5 in atoi () #2 0x9406fd80 in sqlite3InitCallback ()
Can you figure out what parameter is being passed to atoi() here? Go up (u) a few stack frames, list (l) the source, and print (p) the variables being passed to atoi(). I'm puzzled that it doesn't display source code information - so one possible cause is that you pick up the wrong sqlite3InitCallback (i.e. the one that came with OSX, instead of the one you built yourself).
Regards, Martin

One other thing to check is to ensure that sqlite was compiled with -fno-strict-aliasing. I know there was a strange problem on one of the buildbots due to this flag not being present. I have no idea if that could be your problem here though.
n --
On 5/28/07, "Martin v. Löwis" martin@v.loewis.de wrote:
Darrin Thompson schrieb:
First of all 1000 apologies if this is the wrong list. Please redirect me if necessary.
The list is right, but the question is slightly wrong:
Can someone advise as to the correct configure arguments for sqlite or something else I might be missing?
The question for python-dev is "how can I debug that further, and where should I submit a patch" :-)
(gdb) info threads
- 1 process 18968 local thread 0x1003 0x900e41d1 in strtol_l ()
(gdb) bt #0 0x900e41d1 in strtol_l () #1 0x900160a5 in atoi () #2 0x9406fd80 in sqlite3InitCallback ()
Can you figure out what parameter is being passed to atoi() here? Go up (u) a few stack frames, list (l) the source, and print (p) the variables being passed to atoi(). I'm puzzled that it doesn't display source code information - so one possible cause is that you pick up the wrong sqlite3InitCallback (i.e. the one that came with OSX, instead of the one you built yourself).
Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/nnorwitz%40gmail.com

On 5/29/07, "Martin v. Löwis" martin@v.loewis.de wrote:
The question for python-dev is "how can I debug that further, and where should I submit a patch" :-)
I have no problem with that. :-)
(gdb) info threads
- 1 process 18968 local thread 0x1003 0x900e41d1 in strtol_l ()
(gdb) bt #0 0x900e41d1 in strtol_l () #1 0x900160a5 in atoi () #2 0x9406fd80 in sqlite3InitCallback ()
Can you figure out what parameter is being passed to atoi() here? Go up (u) a few stack frames, list (l) the source, and print (p) the variables being passed to atoi().
Well, duh!
#3 0x0395faca in sqlite3_exec (db=0x338d160, zSql=0x338faf0 "SELECT name, rootpage, sql FROM 'main'.sqlite_master WHERE tbl_name='sqlite_sequence'", xCallback=0x9406fd00 <sqlite3InitCallback>, pArg=0xbfffde14, pzErrMsg=0x0) at ./src/legacy.c:93 #4 0x0398c741 in sqlite3VdbeExec (p=0x1943e00) at ./src/vdbe.c:4090 #5 0x0395665e in sqlite3Step (p=0x1943e00) at ./src/vdbeapi.c:236
(gdb) l 88 azVals = &azCols[nCol]; 89 for(i=0; i<nCol; i++){ 90 azVals[i] = (char *)sqlite3_column_text(pStmt, i); 91 } 92 } 93 if( xCallback(pArg, nCol, azVals, azCols) ){ -- here -- 94 rc = SQLITE_ABORT; 95 goto exec_out; 96 } 97 }
I don't have source info on frame 2 and above, which is really odd, as sqlite is statically linked to _sqlite3.so.
From looking at the source code I know that what is being passed to
atoi is supposed to be a root page number.
int sqlite3InitCallback(void *pInit, int argc, char **argv, char **azColName){
Specifically, argv[1] is what goes to atoi, and is documented to be a root page number. All kinds of possibilities suggest themselves.
I'm puzzled that it doesn't display source code information - so one possible cause is that you pick up the wrong sqlite3InitCallback (i.e. the one that came with OSX, instead of the one you built yourself).
I'm confident it isn't picking up the wrong lib, based on otool -L:
$ otool -L /opt/so/Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/lib-dynload/_sqlite3.so /opt/so/Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/lib-dynload/_sqlite3.so: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.3)
On Linux I might also poke around in /proc to see what files were mapped into memory, but I'm not sure how to do that on OSX yet.
-- Darrin

On 26 May, 2007, at 6:45, Darrin Thompson wrote:
First of all 1000 apologies if this is the wrong list. Please redirect me if necessary.
I'm attempting to build python 2.5.1 fat binaries on OSX and statically link to a newer sqlite than what ships with OSX. (3.3.17).
I'm getting "Bus Error" early when I run my app. If I turn on a lot of malloc debugging options and run under gdb I get this trace:
What happens when you use the binary installer at python.org? This is build with a newer version of sqlite as well (because the installer supports OSX 10.3).
The script that builds the binary installer is in Mac/BuildScript.
Ronald

On 5/29/07, Ronald Oussoren ronaldoussoren@mac.com wrote:
What happens when you use the binary installer at python.org? This is build with a newer version of sqlite as well (because the installer supports OSX 10.3).
Hmmm. I hadn't thought of checking the sqlite version in there. I did use the binary installer once but had "other problems" which I'm now suspecting were my misuse of Qt's pyrcc.
The script that builds the binary installer is in Mac/BuildScript.
Sweet! I'll look into this.
-- Darrin
participants (5)
-
"Martin v. Löwis"
-
Darrin Thompson
-
Neal Norwitz
-
Ronald Oussoren
-
Terry Reedy