Issue7144
Created on 2009-10-15 19:35 by peterhunt, last changed 2009-11-19 17:31 by ronaldoussoren.
|
msg94106 - (view) |
Author: Pete Hunt (peterhunt) |
Date: 2009-10-15 19:35 |
|
Apologies if I mess up the formatting - my first bug report submitted.
Steps to reproduce (OSX Snow Leopard, 2.6.3)
>>> import threading, imp
>>> def doit():
... print imp.load_module("cherrypy", None,
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
packages/CherryPy-3.1.2-py2.6.egg/cherrypy", ('', '', 5))
...
>>> threading.Thread(target=doit).start()
>>> Trace/BPT trap
|
|
msg94107 - (view) |
Author: Ronald Oussoren (ronaldoussoren) |
Date: 2009-10-15 19:41 |
|
This seems to be a known issue: importing extensions in a thread fails on
OSX 10.6 (with a hard crash of the interpreter). The crash in inside the
initialisation function for an Apple framework.
I haven't been able to determine if the problem is in Python or OSX,
although it likely is a problem in the OS and is definitely a regression
in OSX (it works on 10.5 but crashes on 10.6).
|
|
msg94899 - (view) |
Author: Adam Doherty (dohertywa) |
Date: 2009-11-04 18:28 |
|
Hello:
Having the same issues in a web app I've written. Tested with the
default 2.5 and 2.6 on Snow Leopard and 2.5 on Ubuntu 8.04 (no problems
under Linux) Replaced the default Python with 2.6.4 from python.org, my
app no longer crashes.
Hope it helps.
|
|
msg95390 - (view) |
Author: Ronald Oussoren (ronaldoussoren) |
Date: 2009-11-17 16:47 |
|
The crash is caused by loading any extension that happens to link with
CoreFoundation on a secondary thread, unless CoreFoundation was already
initialized.
The CF framework contains a constructor that explicitly aborts when it
is not called on the main thread (all of this on Snow Leopard only).
I've found a workaround for this issue: ensure that Python is linked to
the CoreFoundation framework, that way CF will be initialized when
Python starts.
I'm working on a clean patch for this
|
|
msg95499 - (view) |
Author: Ronald Oussoren (ronaldoussoren) |
Date: 2009-11-19 17:31 |
|
I've just committed a fix for this issue in all 4 active branches (2.6,
2.7, 3.1 and 3.2)
|
|
| Date |
User |
Action |
Args |
| 2009-11-19 17:31:05 | ronaldoussoren | set | status: open -> closed resolution: fixed messages:
+ msg95499
|
| 2009-11-17 16:47:29 | ronaldoussoren | set | messages:
+ msg95390 |
| 2009-11-04 18:28:43 | dohertywa | set | nosy:
+ dohertywa messages:
+ msg94899
|
| 2009-10-15 19:41:02 | ronaldoussoren | set | messages:
+ msg94107 |
| 2009-10-15 19:35:20 | peterhunt | create | |
|