Skip to content
This repository has been archived by the owner on May 10, 2019. It is now read-only.

Fatal Python error: PyThreadState_Get: no current thread (Mountain Lion) #7

Closed
c1de0x opened this issue Aug 17, 2012 · 16 comments
Closed

Comments

@c1de0x
Copy link

c1de0x commented Aug 17, 2012

On Mountain Lion, I'm getting:

$ gnuradio-companion
/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gtk-2.0/gtk/init.py:57: GtkWarning: could not open display
warnings.warn(str(e), _gtk.Warning)
Fatal Python error: PyThreadState_Get: no current thread

Possibly a lib-path error?

$ DYLD_PRINT_LIBRARIES=1 gnuradio-companion 2>&1 | grep -i python | grep -v Cellar
dyld: loaded: /usr/local/bin/python
dyld: loaded: /System/Library/Frameworks/Python.framework/Versions/2.7/Python
Fatal Python error: PyThreadState_Get: no current thread

this is forked from Issue #6

@c1de0x
Copy link
Author

c1de0x commented Aug 17, 2012

$ uname -a
Darwin xyz.local 12.0.0 Darwin Kernel Version 12.0.0: Sun Jun 24 23:00:16 PDT 2012; root:xnu-2050.7.9~1/RELEASE_X86_64 x86_64
$ which python
/usr/local/bin/python
$ python --version
Python 2.7.3

$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

@titanous
Copy link
Owner

$ otool -L /usr/local/Cellar/gnuradio/3.6.1/lib/libgnuradio-qtgui.3.6.1.dylib 
/usr/local/Cellar/gnuradio/3.6.1/lib/libgnuradio-qtgui.3.6.1.dylib:
    /usr/local/lib/libgnuradio-qtgui.3.6.1.dylib (compatibility version 3.6.1, current version 0.0.0)
    @loader_path/libgnuradio-core.3.6.1.dylib (compatibility version 3.6.1, current version 0.0.0)
    /usr/local/lib/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.2)
    /usr/local/lib/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.2)
    /usr/local/lib/qwt.framework/Versions/6/qwt (compatibility version 6.0.0, current version 6.0.1)
    /System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.2)
    @loader_path/libgruel.3.6.1.dylib (compatibility version 3.6.1, current version 0.0.0)
    /usr/local/lib/libboost_date_time-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/lib/libboost_program_options-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/lib/libboost_filesystem-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/lib/libboost_system-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/lib/libboost_thread-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)

Indicates that it's linking against the system python. I'm looking into how to prevent that.

@titanous
Copy link
Owner

It looks like this DYLD_FRAMEWORK_PATH is needed: f9655d5

I removed it because of this error message:

dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid

I'm looking into how to make it work again.

@titanous
Copy link
Owner

According to this, that's just a red herring: http://openradar.appspot.com/11894054

I'm trying to compile it with the path set correctly, we'll see how it goes.

@c1de0x
Copy link
Author

c1de0x commented Aug 17, 2012

ok ill test again when you push an update

@titanous
Copy link
Owner

You can actually test right now by running:

export DYLD_FRAMEWORK_PATH=/usr/local/lib:$DYLD_FRAMEWORK_PATH
brew uninstall gnuradio
brew install gnuradio

@c1de0x
Copy link
Author

c1de0x commented Aug 17, 2012

nope. still borked

$ otool -L /usr/local/Cellar/gnuradio/3.6.1/lib/libgnuradio-qtgui.3.6.1.dylib
/usr/local/Cellar/gnuradio/3.6.1/lib/libgnuradio-qtgui.3.6.1.dylib:
/usr/local/lib/libgnuradio-qtgui.3.6.1.dylib (compatibility version 3.6.1, current version 0.0.0)
@loader_path/libgnuradio-core.3.6.1.dylib (compatibility version 3.6.1, current version 0.0.0)
/usr/local/lib/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.2)
/usr/local/lib/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.2)
/usr/local/lib/qwt.framework/Versions/6/qwt (compatibility version 6.0.0, current version 6.0.1)
/System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.2)
@loader_path/libgruel.3.6.1.dylib (compatibility version 3.6.1, current version 0.0.0)
/usr/local/lib/libboost_date_time-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libboost_program_options-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libboost_filesystem-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libboost_system-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libboost_thread-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)

@titanous
Copy link
Owner

I just pushed a patch that fixes this issue. Can you test it out?

brew update
brew uninstall gnuradio
brew install gnuradio

@c1de0x
Copy link
Author

c1de0x commented Aug 18, 2012

Now I get a segfault:
gnuradio-companion/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gtk-2.0/gtk/init.py:57: GtkWarning: could not open display
warnings.warn(str(e), _gtk.Warning)
Segmentation fault: 11

@titanous
Copy link
Owner

Do you have XQuartz installed?

@c1de0x
Copy link
Author

c1de0x commented Aug 18, 2012

Yes. XQuartz 2.7.2

@titanous titanous reopened this Aug 18, 2012
@GRMrGecko
Copy link

From the looks of it, this looks to be an issue where GNURadio is compiling against OSX's python install.

Looking further it seems cairo is causing the crash. Uninstalled everything I installed to manually build GNU Radio with Mac OS X Python and re-installing it.

@GRMrGecko
Copy link

brew uninstall cairo py2cairo pygobject pygtk gtk+ gnuradio

brew install pygtk gnuradio

That fixed it for me as I installed the other packages before I installed python via brew..

@lokkju
Copy link

lokkju commented Jan 6, 2013

I'm still getting this - using a little tool I wrote that tells you which dylibs are using the system python ( https://gist.github.com/4466116 ), I found that /usr/local/lib/python2.7/site-packages/gnuradio/qtgui/_qtgui_swig.so was linked against the System python.

I tried removing both swig and gnuradio and reinstalling - but with no luck.

Ideas?

@zacmanchester
Copy link

I had the same problem. I got around it by temporarily symlinking the brewed python in place of the system python, brew uninstall gnuradio, brew install gnuradio, then changing the symlinks back.

@1am
Copy link

1am commented Oct 2, 2015

I know the issue is closed, but just for reference I've had a simillar issue today. What helped me was following what tomekr did in metacollin/homebrew-gnuradio#47 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants