Re: [Pythonmac-SIG] debugging bus error on launch [py2app]
Jeffrey O'Neill wrote: I've used py2app for many years and have really appreciated how it makes it so easy to distribute my app. I'm now running into problems and would appreciate suggestions for how to debug. You've probably done this, but just to make sure: Delete the entirety of the "build" and "dist" directories and re-run py2app -- sometimes left over cruft gets in the way when you change things. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] debugging bus error on launch [py2app]
On Mon, Jun 6, 2011 at 1:08 PM, Chris Weisiger wrote: > On Mon, Jun 6, 2011 at 9:56 AM, Jeffrey O'Neill > wrote: > >> >> Hi Ronald, >> >> Thanks for the suggestions. I'm not importing GUI code in a thread (and >> threads are not used in launching the app either) so that is not causing the >> problem. >> >> I tried gdb with no-strip and the output is below. It doesn't help me >> any. :( GDB says it is x86_64-apple-darwin while my app is 32 bit but I >> don't know if that matters. >> > > That sounds like it would cause a problem. :) You said you upgraded your > Python install; are you sure you got the 32-bit version? If you do > > import platform; print platform.architecture() > > what do you get? > > Does the program work properly when not built as an app? > Yes, definitely 32-bit Python: $ python Python 2.7.1 (r271:86882M, Nov 30 2010, 09:39:13) [GCC 4.0.1 (Apple Inc. build 5494)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import platform; print platform.architecture() ('32bit', '') My app works fine when run without py2app. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] debugging bus error on launch [py2app]
On Mon, Jun 6, 2011 at 9:56 AM, Jeffrey O'Neill wrote: > > On Mon, Jun 6, 2011 at 10:04 AM, Ronald Oussoren > wrote: > >> >> The setup file looks fine. What you could try is to build using >> '--no-strip' and then use 'gdb ./dist/OpenSTV.app/Contents/MacOS/OpenSTV'. >> With some luck this gives a hint on what causes the crash. >> >> Are you by any change importing GUI code in a secondary thread? I've seen >> crashes in __CFInitialize before when Apple's frameworks get loaded on any >> thread that isn't the main thread. >> > > Hi Ronald, > > Thanks for the suggestions. I'm not importing GUI code in a thread (and > threads are not used in launching the app either) so that is not causing the > problem. > > I tried gdb with no-strip and the output is below. It doesn't help me any. > :( GDB says it is x86_64-apple-darwin while my app is 32 bit but I don't > know if that matters. > That sounds like it would cause a problem. :) You said you upgraded your Python install; are you sure you got the 32-bit version? If you do import platform; print platform.architecture() what do you get? Does the program work properly when not built as an app? -Chris ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] debugging bus error on launch [py2app]
On Mon, Jun 6, 2011 at 10:04 AM, Ronald Oussoren wrote: > > The setup file looks fine. What you could try is to build using > '--no-strip' and then use 'gdb ./dist/OpenSTV.app/Contents/MacOS/OpenSTV'. > With some luck this gives a hint on what causes the crash. > > Are you by any change importing GUI code in a secondary thread? I've seen > crashes in __CFInitialize before when Apple's frameworks get loaded on any > thread that isn't the main thread. > Hi Ronald, Thanks for the suggestions. I'm not importing GUI code in a thread (and threads are not used in launching the app either) so that is not causing the problem. I tried gdb with no-strip and the output is below. It doesn't help me any. :( GDB says it is x86_64-apple-darwin while my app is 32 bit but I don't know if that matters. Jeff gdb output $ gdb ./dist/OpenSTV.app/Contents/MacOS/OpenSTV ... This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .. done (gdb) run Starting program: /Users/joneill/OpenSTV/OpenSTV/dist/OpenSTV.app/Contents/MacOS/OpenSTV Reading symbols for shared libraries +. done Reading symbols for shared libraries .. done Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x 0x953caedb in objc_msgSend () (gdb) bt #0 0x953caedb in objc_msgSend () #1 0x00103bc0 in ?? () #2 0x9387f8ee in cacheBundleInfo () #3 0x9387f82d in _CFAppVersionCheckLessThan () #4 0x93879704 in __CFInitialize () #5 0x8fe0ee40 in __dyld__ZN16ImageLoaderMachO11doImageInitERKN11ImageLoader11LinkContextE () #6 0x8fe0ee74 in __dyld__ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE () #7 0x8fe0d31e in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj () #8 0x8fe0d3d1 in __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextE () #9 0x8fe0200b in __dyld__ZN4dyld15runInitializersEP11ImageLoader () #10 0x8fe0b299 in __dyld_dlopen () #11 0x94128848 in dlopen () #12 0x5a9f in main () ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] debugging bus error on launch [py2app]
On 5 Jun, 2011, at 18:24, Jeffrey O'Neill wrote: > I've used py2app for many years and have really appreciated how it makes it > so easy to distribute my app. I'm now running into problems and would > appreciate suggestions for how to debug. My setup: > -- Snow Leopard > -- 32-bit Python 2.7 from python.org > -- py2app 6.3 > -- only external package is wxPython 2.8.12.0 (32-bit, Carbon, unicode) > > The changes from my last successful use of py2app six months ago are (1) > moving from python 2.6 to python 2.7; (2) upgrading to latest py2app (don't > know what I had before but I think it was at least a couple years old); and > (3) changes to my python code that should not be significant. > > When I do > python setup.mac.py py2app > everything seems to operate fine. Stuff gets copied to build dir, creates > app bundle, stripping, etc... (Tried this both with and without -A). > > When I run out of the dist dir: > $ ./dist/OpenSTV.app/Contents/MacOS/OpenSTV > I get > Bus error > with a dump. > > I don't know where to begin debugging this and would greatly appreciate > pointers. My setup.mac.py is copied below and also the dump that OS X > provides. Note that my setup is a little complicated because I use > __import__ and have to explicitly list the stuff that is being imported that > way. The setup file looks fine. What you could try is to build using '--no-strip' and then use 'gdb ./dist/OpenSTV.app/Contents/MacOS/OpenSTV'. With some luck this gives a hint on what causes the crash. Are you by any change importing GUI code in a secondary thread? I've seen crashes in __CFInitialize before when Apple's frameworks get loaded on any thread that isn't the main thread. Ronald smime.p7s Description: S/MIME cryptographic signature ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG