[docs] Subprocess Crashes on OSX using wxpython GUI

Shalin Shah shalinshah1993 at gmail.com
Tue Nov 5 14:45:10 CET 2013


Hello,

I have a GUI software in which I wanted to do some heavy tasks so I create
new subprocesses to run those tasks. To do this I am using multiprocessing
module and this works perfectly fine on windows as well as unix. However
when I try the same for OSX 10.6 process crash occurs and I get a long
error report which I cannot decipher. Here is something I used to make a
sub-process :-

p = multiprocessing.Process(target = encode.encode , args =
(self.path,self.savePath,) , name = "Encode Process")
p.start()
temp = wx.ProgressDialog('Please wait...', 'Encoding the File....This
may take several minutes....\n\t....so sit back and relax....',parent
= self,style = wx.PD_APP_MODAL | wx.PD_CAN_ABORT)
temp.SetSize((450,130))while len(multiprocessing.active_children()) != 0:
      time.sleep(0.1)
      if not temp.UpdatePulse("Encoding the File....This may take
several minutes...\n\tso sit back and relax.....")[0]:
                   p.terminate()
                   terminated = True
                   break
temp.Destroy()
p.join()
p.terminate()


Here is the crash report :-

Path:/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/PythonIdentifier:
     PythonVersion:         ??? (???)Code Type:       X86
(Native)Parent Process:  Python [52639]
Date/Time:       2013-07-23 12:22:46.170 +0530
OS Version:      Mac OS X 10.6.7 (10J869)Report Version:  6
Interval Since Last Report:          14328 secCrashes Since Last
Report:           9Per-App Crashes Since Last Report:   9Anonymous
UUID:                      DE5488A5-8468-4937-800F-F898E4F09392
Exception Type:  EXC_BAD_ACCESS (SIGSEGV)Exception Codes:
KERN_INVALID_ADDRESS at 0x000000000d28e02eCrashed Thread:  0  Dispatch
queue: com.apple.main-thread
Application Specific Information:*** multi-threaded process forked ***
Thread 0 Crashed:  Dispatch queue: com.apple.main-thread0
...ple.ApplicationServices.ATS  0x929b43a0 _eGetGlyphVectorIndex +
2191   ...ple.ApplicationServices.ATS  0x929bec46
OldGlyphsCacheRun(TStrike*, int, unsigned long, unsigned short const*,
void (*)(unsigned long, unsigned short const*, unsigned long, unsigned
char* const*, void const*), void*) + 3542
...ple.ApplicationServices.ATS  0x929c2502 _eGCGetGlyphDeviceMetrics +
4753   ...ple.ApplicationServices.ATS  0x929c56fd
GCGetGlyphDeviceMetrics + 1174   com.apple.QD
0x906cc386 GetLayoutDevMetricsGroup(ATSGlyphVector*, unsigned long,
unsigned long, Rect*) + 11055   com.apple.QD
0x906ca6c9 MakeLayoutDeviceValues + 6166   com.apple.QD
    0x906ca434 PositionDeviceGlyphs + 1367   com.apple.QD
      0x906c87a7 TTextLineLayout::EnsureLayoutIsUpToDate(unsigned
long, unsigned char, unsigned long, TATSUGlyphRecordArray**) + 5018
com.apple.QD                    0x90747ebe
TTextLineLayout::OffsetToPosition(unsigned long, unsigned char,
unsigned short, ATSUCaret*, ATSUCaret*, unsigned char*) + 1689
com.apple.QD                    0x90735ca5 ATSUOffsetToCursorPosition
+ 11710  com.apple.QD                    0x90735cfc
ATSUOffsetToPosition + 6111  com.apple.HIToolbox
0x957dea93 CUnicodeTextRun::CharacterToPixel(LineRunDisplayInfo
const&, short, void*, void*) + 55112  com.apple.HIToolbox
0x957ef995 CLine::RunCharToPixel(LineRunInfo const*, long, unsigned
char, ATSUCaret*, ATSUCaret*) + 8713  com.apple.HIToolbox
0x957eff7b CLine::CharacterToPixel(TCharOffset, char, ATSUCaret*) +
22114  com.apple.HIToolbox             0x957f0063
CLine::GetLineHilites(TCharOffsetRange, CLineHilitesList*, unsigned
char, char) + 7915  com.apple.HIToolbox             0x957b60ea
CTextensionDisplay::GetLineHilites(long, TCharOffsetRange,
CLineHilitesList*, unsigned char, char) + 10616  com.apple.HIToolbox
          0x957e8819 CSelection::CalcRangeRect(TCharOffsetRange,
TLongRect*, unsigned char) + 19717  com.apple.HIToolbox
0x957e88df CSelection::CalcCaretRect() + 6118  com.apple.HIToolbox
        0x957e893d CSelection::GetCaretRect(TLongRect*) + 3319
com.apple.HIToolbox             0x957b6132
CTextensionDisplay::CharToPoint(TCharOffset, long*, long*, long*) +
6020  com.apple.HIToolbox             0x957b6e66
CTextensionDisplay::CharToPoint(TCharOffset, long*) + 5821
com.apple.HIToolbox             0x957ebd2a
CSelection::UpdateAnchors(TCharOffsetRange const&, unsigned char,
unsigned char) + 9822  com.apple.HIToolbox             0x957b9b4b
CTextensionDisplay::EndEdit(TEditInfo const&, long, long,
TCharOffset*) + 16523  com.apple.HIToolbox             0x957c80e2
CTextension::EndEdit(TEditInfo const&, long, long, TCharOffset*,
unsigned char) + 5624  com.apple.HIToolbox             0x957d930a
CUnicodeTextension::UnicodeReplaceRange(long, long, TReplaceParams
const&, unsigned char, unsigned char) + 260025  com.apple.HIToolbox
         0x957d9509 CUnicodeTextension::ReplaceRange(long, long,
TReplaceParams const&, unsigned char, unsigned char) + 10126
com.apple.HIToolbox             0x957ca5cd
CReplaceTextCommand::DoMainAction() + 6727  com.apple.HIToolbox
     0x957ca035 CTextensionEditCommand::DoIt(short*) + 2928
com.apple.HIToolbox             0x957c9920
CTextensionCommand::Execute(short*) + 5429  com.apple.HIToolbox
     0x957cf9c9 OpaqueTXNObject::ExecuteCurrCommand() + 11330
com.apple.HIToolbox             0x957cff11
OpaqueTXNObject::NewCommand(short, AttrObjModifier const*,
TKeyDownParams*, TReplaceParams*) + 106131  com.apple.HIToolbox
     0x957bd030 DoSetDataCommand(OpaqueTXNObject*, unsigned long,
unsigned long, TReplaceParams*) + 29932  com.apple.HIToolbox
  0x957c4fd3 TXNSetData + 68333  libwx_macud-2.8.0.dylib
0x0171d9f8 wxMacMLTEControl::SetTXNData(wxString const&, unsigned
long, unsigned long) + 16834  libwx_macud-2.8.0.dylib
0x017207b5 wxMacMLTEControl::WriteText(wxString const&) + 20535
libwx_macud-2.8.0.dylib         0x0171fa82
wxTextCtrl::WriteText(wxString const&) + 24236  _controls_.so
         0x05c88633 _wrap_TextCtrl_AppendText + 247 (wxPython.h:48)37
org.python.python               0x000c8841 PyEval_EvalFrameEx +
2076938  org.python.python               0x000ca90a PyEval_EvalCodeEx
+ 204239  org.python.python               0x000c8b33
PyEval_EvalFrameEx + 2152340  org.python.python
0x000c9933 PyEval_EvalFrameEx + 2510741  org.python.python
  0x000ca90a PyEval_EvalCodeEx + 204242  org.python.python
  0x00042832 function_call + 16243  org.python.python
0x0000f5b5 PyObject_Call + 8544  org.python.python
0x00021ff6 instancemethod_call + 42245  org.python.python
 0x0000f5b5 PyObject_Call + 8546  org.python.python
0x000c278e PyEval_CallObjectWithKeywords + 7847  org.python.python
          0x00038f02 PyFile_WriteObject + 35448  org.python.python
          0x000c6c4c PyEval_EvalFrameEx + 1361249  org.python.python
            0x000c9933 PyEval_EvalFrameEx + 2510750  org.python.python
              0x000ca90a PyEval_EvalCodeEx + 204251  org.python.python
              0x00042832 function_call + 16252  org.python.python
         0x0000f5b5 PyObject_Call + 8553  org.python.python
   0x000c617b PyEval_EvalFrameEx + 1084354  org.python.python
     0x000c9933 PyEval_EvalFrameEx + 2510755  org.python.python
       0x000c9933 PyEval_EvalFrameEx + 2510756  org.python.python
         0x000ca90a PyEval_EvalCodeEx + 204257  org.python.python
         0x00042832 function_call + 16258  org.python.python
    0x0000f5b5 PyObject_Call + 8559  org.python.python
0x00021ff6 instancemethod_call + 42260  org.python.python
 0x0000f5b5 PyObject_Call + 8561  org.python.python
0x0007dd17 slot_tp_init + 8762  org.python.python
0x0007c710 type_call + 17663  org.python.python
0x0000f5b5 PyObject_Call + 8564  org.python.python
0x000c6ef6 PyEval_EvalFrameEx + 1429465  org.python.python
  0x000c9933 PyEval_EvalFrameEx + 2510766  org.python.python
    0x000ca90a PyEval_EvalCodeEx + 204267  org.python.python
    0x00042832 function_call + 16268  org.python.python
0x0000f5b5 PyObject_Call + 8569  org.python.python
0x00021ff6 instancemethod_call + 42270  org.python.python
 0x0000f5b5 PyObject_Call + 8571  org.python.python
0x000c278e PyEval_CallObjectWithKeywords + 7872  _core_.so
          0x0100ab2e wxPyCallback::EventThunker(wxEvent&) + 234
(helpers.cpp:1759)73  libwx_macud-2.8.0.dylib         0x0169c97a
wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&,
wxEvtHandler*, wxEvent&) + 10874  libwx_macud-2.8.0.dylib
0x0169ca20 wxEvtHandler::SearchDynamicEventTable(wxEvent&) + 8075
libwx_macud-2.8.0.dylib         0x0169d81f
wxEvtHandler::ProcessEvent(wxEvent&) + 22576  libwx_macud-2.8.0.dylib
       0x016cf6b1 wxControl::ProcessCommand(wxCommandEvent&) + 2777
libwx_macud-2.8.0.dylib         0x016ca2f6
wxButton::MacControlHit(void*, void*) + 6278  libwx_macud-2.8.0.dylib
       0x01734d47
wxMacWindowControlEventHandler(OpaqueEventHandlerCallRef*,
OpaqueEventRef*, void*) + 60579  libwx_macud-2.8.0.dylib
0x017356a9 wxMacWindowEventHandler(OpaqueEventHandlerCallRef*,
OpaqueEventRef*, void*) + 19780  com.apple.HIToolbox
0x95582c2f DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*,
HandlerCallRec*) + 156781  com.apple.HIToolbox             0x95581ef6
SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*,
HandlerCallRec*) + 41182  com.apple.HIToolbox             0x955a47f3
SendEventToEventTarget + 5283  com.apple.HIToolbox
0x955f3cce SendControlHit(HIView*, OpaqueEventRef*, short, unsigned
long) + 29684  com.apple.HIToolbox             0x955f3b4f
HIView::NotifyControlHit(OpaqueEventRef*, short, unsigned long) + 4585
 com.apple.HIToolbox             0x9565865f
HIView::ClickInternal(CGPoint const&, unsigned long, void
(*)(OpaqueControlRef*, short), OpaqueEventRef*, bool) + 24586
com.apple.HIToolbox             0x95659c18
HIView::ClickSelf(OpaqueEventRef*) + 36887  com.apple.HIToolbox
     0x95595af9 HIView::EventHandler(OpaqueEventHandlerCallRef*,
OpaqueEventRef*, void*) + 236388  com.apple.HIToolbox
0x95582c2f DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*,
HandlerCallRec*) + 156789  com.apple.HIToolbox             0x95581ef6
SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*,
HandlerCallRec*) + 41190  com.apple.HIToolbox             0x955a47f3
SendEventToEventTarget + 5291  com.apple.HIToolbox
0x955f2b8e HIView::Click(OpaqueEventRef*) + 48092  com.apple.HIToolbox
            0x955f295b HandleClickAsHIView(OpaqueWindowPtr*,
OpaqueEventRef*) + 15193  com.apple.HIToolbox             0x955f1238
HandleWindowClick(OpaqueWindowPtr*, Point, short, unsigned long,
OpaqueEventRef*) + 49194  com.apple.HIToolbox             0x955f0d3b
HandleMouseEvent(OpaqueEventHandlerCallRef*, OpaqueEventRef*) + 78695
com.apple.HIToolbox             0x955f0652
StandardWindowEventHandler(OpaqueEventHandlerCallRef*,
OpaqueEventRef*, void*) + 9396  com.apple.HIToolbox
0x95582c2f DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*,
HandlerCallRec*) + 156797  com.apple.HIToolbox             0x95581ef6
SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*,
HandlerCallRec*) + 41198  com.apple.HIToolbox             0x955a47f3
SendEventToEventTarget + 5299  com.apple.HIToolbox
0x955b634f ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*,
OpaqueEventRef*, void*) + 1257100 com.apple.HIToolbox
0x95583080 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*,
HandlerCallRec*) + 2672101 com.apple.HIToolbox             0x95581ef6
SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*,
HandlerCallRec*) + 411102 com.apple.HIToolbox             0x955a47f3
SendEventToEventTarget + 52103 libwx_macud-2.8.0.dylib
0x016bfd9a wxApp::MacHandleOneEvent(void*) + 34104
libwx_macud-2.8.0.dylib         0x016bfe62 wxApp::MacDoOneEvent() +
120105 libwx_macud-2.8.0.dylib         0x016da3de
wxEventLoop::Dispatch() + 32106 libwx_macud-2.8.0.dylib
0x0179667d wxEventLoopManual::Run() + 97107 libwx_macud-2.8.0.dylib
     0x0176c7fe wxAppBase::MainLoop() + 76108 _core_.so
       0x010018dc wxPyApp::MainLoop() + 52 (helpers.cpp:215)109
_core_.so                       0x0104f03a _wrap_PyApp_MainLoop + 82
(_core_wrap.cpp:31686)110 org.python.python               0x000c8841
PyEval_EvalFrameEx + 20769111 org.python.python
0x000ca90a PyEval_EvalCodeEx + 2042112 org.python.python
0x00042832 function_call + 162113 org.python.python
0x0000f5b5 PyObject_Call + 85114 org.python.python
0x00021ff6 instancemethod_call + 422115 org.python.python
 0x0000f5b5 PyObject_Call + 85116 org.python.python
0x000c6ef6 PyEval_EvalFrameEx + 14294117 org.python.python
  0x000c9933 PyEval_EvalFrameEx + 25107118 org.python.python
    0x000ca90a PyEval_EvalCodeEx + 2042119 org.python.python
    0x000caa97 PyEval_EvalCode + 87120 org.python.python
0x000ef158 PyRun_FileExFlags + 168121 org.python.python
0x000f0087 PyRun_SimpleFileExFlags + 855122 org.python.python
     0x00109137 Py_Main + 3255123 org.python.python
0x00001f82 0x1000 + 3970


I am not sure what the problem is as it works perfectly fine on windows and
unix. Any kind of help is appreciated. I ran this again using sudo and this
time there is no crash but on the other hand there is no output. Already
seen this *issue* <http://bugs.python.org/issue9405> but how should I fix
it in my case?

-- 
Regards,
Shalin Shah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20131105/a553fb56/attachment-0001.html>


More information about the docs mailing list