[issue21381] Python 3.4+ interpreter built on/with OS X 10.7 deployment target segfaults on 10.8+

Ned Deily report at bugs.python.org
Tue Apr 29 09:58:13 CEST 2014


Ned Deily added the comment:

Yes, it should be possible to build all Pythons for all recent OS X deployment targets but, normally, the safest way is to build a specific deployment target on the same OS X version; that should avoid any possibility of inadvertently linking with new features not available on the older deployment target system.  It is possible to use SDKs and tools from older versions of Xcode on newer systems to simulate building on an older system but that isn't foolproof.  Also, keep in mind that the deployment target is a minimum deployment target.  Pythons built with a deployment target of 10.n also work on 10.n+1 and generally 10.n+m, at least as long as there is no major compatibility break, like dropping support for running PPC architecture executables in 10.7.

However, the problem you've found here is an exception to that general rule.  The culprit appears to be the execution stack size increase at link time introduced by Issue18075 in b07ad4b5e349 for 3.4.0.  With the stack size increased to 16MB, when Python is built on 10.7, it seems to work fine on 10.7 but, if the same executable is moved to 10.8 or 10.9, it segfaults early in initialization.  The same behavior is observed with either debug or non-debug builds.  When the same executable is run under gdb or lldb, the interpreter doesn't segfault.  Likewise, the same behavior is seen when building on 10.8 or 10.9 and setting MACOSX_DEPLOYMENT_TARGET=10.7.  (Also, building with Xcode 4.6.3 (the current 10.7 toolchain) on 10.9 makes no difference.)

With dept target of 10.7, If the stack size increase in configure is commented out,

#LINKFORSHARED="-Wl,-stack_size,1000000 $LINKFORSHARED"

then builds with dept target of 10.7 succeed and all tests pass.  In fact, at first glance it seemed that all tests passed with a dept target of 10.9 using the current Xcode 5.1.1 build tools so it's not clear whether the original problem reported in Issue18075 still exists.

I'm puzzled by this one: thanks, Chris!  We could certainly make the stack size increase conditional but it's odd that it only seems to be a problem with 10.7.  Ronald (or anyone else): any ideas?

----------
nosy: +ronaldoussoren
title: python build crash on Mavericht -> Python 3.4+ interpreter built on/with OS X 10.7 deployment target segfaults on 10.8+
versions: +Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21381>
_______________________________________


More information about the Python-bugs-list mailing list