invalid memory address error near wxEntry Start and/or libwx_baseu

David Smith wrote:

Hello,

I've built a standalone wxpython app on OSX 10.8 using the latest
macport versions for python 2.7.3 / wxpython-devel 2.9.4 / py2app 0.7.3.
The app runs on OSX 10.8, but it crashes with an invalid memory address
on OSX 10.6 (please see the attached "problem report"). I should note
that the 10.6 machine has the latest macport's python 2.7.3 and wxpython
2.8.12 installed, but the app is fully standalone, so I don't expect a
conflict.

Also, I think the wxpython startup sequence in the app is mostly vanilla:

Any suggestions or hints for this error?

It may be that the macports wxPython was built with a different deployment target and so it is trying to call an API that doesn't exist on 10.6. Look in to the macports options and the wxpython-devel variants and see if they give you a way to specify a minimum deployment target and if so rebuild at least Python and wxPython.

If not then you can probably get by with building your app using python and wxpython binaries built on the 10.6 machine. Or you can try using the stock python.org Python and the wxPython from wxpython.org instead of the macports versions.

···

--
Robin Dunn
Software Craftsman

Thanks for the tips. I’ll give them a try, and post my results.

···

On Saturday, February 23, 2013 3:21:13 PM UTC-5, Robin Dunn wrote:

David Smith wrote:

Hello,

I’ve built a standalone wxpython app on OSX 10.8 using the latest

macport versions for python 2.7.3 / wxpython-devel 2.9.4 / py2app 0.7.3.

The app runs on OSX 10.8, but it crashes with an invalid memory address

on OSX 10.6 (please see the attached “problem report”). I should note

that the 10.6 machine has the latest macport’s python 2.7.3 and wxpython

2.8.12 installed, but the app is fully standalone, so I don’t expect a

conflict.

Also, I think the wxpython startup sequence in the app is mostly vanilla:

Any suggestions or hints for this error?

It may be that the macports wxPython was built with a different
deployment target and so it is trying to call an API that doesn’t exist
on 10.6. Look in to the macports options and the wxpython-devel
variants and see if they give you a way to specify a minimum deployment
target and if so rebuild at least Python and wxPython.

If not then you can probably get by with building your app using python
and wxpython binaries built on the 10.6 machine. Or you can try using
the stock python.org Python and the wxPython from wxpython.org instead
of the macports versions.


Robin Dunn

Software Craftsman

http://wxPython.org

Hi Robin,

I was able to build the standalone app on OS X 10.8 and run on OS X 10.6 and 10.8 by uninstalling macports and building the python stack from binary installers (python 2.7, numpy, scipy, matplotlib, wxpython 2.9.4). I don’t know why the macport versions didn’t work together. For more detail, here’s my post to PythonMac-SIG:

To recap, my recent roadblocks were with current macport versions of python 2.7, wxpython 2.9.4, and py2app 0.7.3 on OS X 10.8. The first problem occurred when building the standalone app with py2app. The error seemed to arise from py2app or macholib: “Mach-O header is too large to relocate”. Following your helpful suggestions at bitbucket, I increased the file depth of the macports installation, and decreased the app’s build directory file depth (see link below). With those changes, the app built without error. The app executed on OS X 10.8, but generated a memory address error on OS X 10.6 during wxpython initiation (another link below). I did not discover a solution for the memory error.

The solution to the problems above was removing macports and building the python stack from binary installers (python 2.7, numpy, scipy, matplotlib, wxpython). Now everything works - the app builds cleanly and executes on OS X 10.8 and 10.6. I’m not sure why the macport versions don’t work together, but I’m happy to have a working solution.

forum/ticket references:

https://trac.macports.org/ticket/38163

https://bitbucket.org/ronaldoussoren/py2app/issue/93/mach-o-header-may-be-too-large-to-relocate
http://mail.python.org/pipermail/pythonmac-sig/2013-February/023844.html

Thanks,

Dave

···

On Saturday, February 23, 2013 3:21:13 PM UTC-5, Robin Dunn wrote:

David Smith wrote:

Hello,

I’ve built a standalone wxpython app on OSX 10.8 using the latest
macport versions for python 2.7.3 / wxpython-devel 2.9.4 / py2app 0.7.3.
The app runs on OSX 10.8, but it crashes with an invalid memory address
on OSX 10.6 (please see the attached “problem report”). I should note
that the 10.6 machine has the latest macport’s python 2.7.3 and wxpython
2.8.12 installed, but the app is fully standalone, so I don’t expect a
conflict.

Also, I think the wxpython startup sequence in the app is mostly vanilla:

Any suggestions or hints for this error?

It may be that the macports wxPython was built with a different
deployment target and so it is trying to call an API that doesn’t exist
on 10.6. Look in to the macports options and the wxpython-devel
variants and see if they give you a way to specify a minimum deployment
target and if so rebuild at least Python and wxPython.

If not then you can probably get by with building your app using python
and wxpython binaries built on the 10.6 machine. Or you can try using
the stock python.org Python and the wxPython from wxpython.org instead
of the macports versions.


Robin Dunn
Software Craftsman
http://wxPython.org