Issues

Issue #28 resolved

new argv_emulation causes crash on MacOS 10.5

miheld
created an issue

the new argv_emulation of py2app 0.6.4 (taken from hg today) causes my app to crash when tested on MacOS 10.5

I am trying to build a 64bit app on MacOS 10.6 Python 2.7.2 (intel build) turning the argv_emulation off the app is running fine.

Comments (7)

  1. Ronald Oussoren repo owner

    I don't have access to a machine running 10.5 at the moment, I'll have to create a VM running 10.5 Server for this.

    One thing you could try: look for the definition of timer_func in py2app/bootstrap/argv_emulation.py and change the first argument for CFUNCTYPE from ctypes.c_void_p to None. That is definitely a bug in the argv_emulator, although it it unlikely that this will actually fix your problem.

  2. Ronald Oussoren repo owner

    I cannot reproduce the problem with system python on 10.5, which likely means the problem is in the support for 64-bit code (which the new argv emulator should support, and does support on osx 10.6+).

  3. Ronald Oussoren repo owner

    I can reproduce the problem with a 64-bit build of python 2.7. That brings me no closer to a fix though, I have no idea why the code crash.

    One possible reason: I don't call NewAEEventHandlerUPP before installing AE EventHandlers. Changing that doesn't help because that function is not available in 64-bit mode at all.

  4. Ronald Oussoren repo owner

    The code works accidentally on 10.7 as it uses RunApplicationEventLoop and QuitApplicationEventLoop which are document to be only available in 32-bit code.

    For some reason the crash goes away when I don't remove the "-psn" argument from sys.argv, but then my code still crashes because QuitApplicationEventLoop is not present in 64-bit code on OSX 10.5.

  5. Ronald Oussoren repo owner

    Fix issue 28: the argv emulator crashes in 64-bit mode on OSX 10.5

    This replaces the usage of Carbon's RunApplicationEventLoop by a manual runloop. This is needed because the RunApplicationEventLoop function is not supported in 64-bit code (although it happens to be present in the Carbon shared library). Futhermore the function crashes on OSX 10.5.

    6376ea3781d8

  6. Log in to comment