ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
4

import tf segfaults python on OS X 10.9 with brewed python

asked 2013-12-09 01:09:42 -0500

demmeln gravatar image

updated 2014-01-28 17:18:46 -0500

ngrennan gravatar image

I revently got the desktop-full variant of ROS hydro installed on Mac OS X 10.9 Mavericks. There were a series of smaller issues, e.g. most of the ones mentioned at http://answers.ros.org/question/94771/building-octomap-orocos_kdl-and-other-packages-on-osx-109-solution/, but in the end I got everything to compile.

When I start up python and type import tf, it crashes with

Segmentation fault: 11

My python version is 2.7.6 from homebrew. I don't even know how to start debugging this. Any help is greatly appreciated.

Edit:

This seems to be caused by faulty cmake find_package(PythonLibs), which in turn caused by _tf.so to be linked against apple's python, while I'm using brewed python. I opened this issue: https://github.com/mxcl/homebrew/issues/25118.

I guess the question that remains is if anybody else has the same issue. For me it is not isolated to tf, but all python modules that are built with find_package(PythonLibs) and link against the found python libs.

Edit2:

[moved to new question]

Edit3:

When used to be Edit2 is now a new question as suggested. Thanks.

http://answers.ros.org/question/110671/recommended-python-version-on-os-x-with-homebrew/

edit retag flag offensive close merge delete

Comments

Unless you have a reason for using the Homebrew Python, I would highly recommend using the built-in Python, in my experience it causes far fewer issues.

William gravatar image William  ( 2013-12-10 06:47:44 -0500 )edit

I think Edit2 above should be asked as a new question.

ahendrix gravatar image ahendrix  ( 2013-12-13 13:13:32 -0500 )edit

Can you edit the wiki to reflect that?

demmeln gravatar image demmeln  ( 2014-02-11 01:27:57 -0500 )edit

Thank you!

demmeln gravatar image demmeln  ( 2014-02-11 04:42:53 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2013-12-11 05:17:55 -0500

ahendrix gravatar image

I'm running Mavericks with the system python (2.7.5), and I don't have this problem.

Unless you know of a very specific reason that you need python 2.7.6 instead of 2.7.5, I strongly suggest removing your homebrew install of python and using the system version instead.

I would try this out by doing brew unlink python and confirm that the system python interpreter does what you want. You can then remove python with brew uninstall python or re-enable your homebrew python install with brew link python

edit flag offensive delete link more

Comments

I'll accept this since it sort of works around the issue. Beware that you have to reinstall various formulas, as well as pip packages and recompile ROS when switching python between brewed and system.

demmeln gravatar image demmeln  ( 2013-12-15 23:45:11 -0500 )edit

I also get Segmentation fault when running stereo image proc on Mac OSX with system python. If someone have any ideas how to resolve it, will very appreciate it!

Artem gravatar image Artem  ( 2013-12-16 01:54:43 -0500 )edit

You should add a question for that specific problem. What does the OS X problem report state?

demmeln gravatar image demmeln  ( 2013-12-16 03:51:07 -0500 )edit

I have had this problem for a long time on OSX. I am thinking about debugging it. I don't have the cameras around to try it. Will create a question soon. Thank you!

Artem gravatar image Artem  ( 2013-12-16 03:58:18 -0500 )edit

I wounder if this could ne related to this issue with message filters, since stereo image proc is using the approx time policy. You could try patching that header file locally. https://github.com/ros/ros_comm/pull/326

demmeln gravatar image demmeln  ( 2013-12-17 00:19:47 -0500 )edit

It looks like the problem was in the topic I was subscribing. Because my image_raw originally grayscale I should have subscribed to image_rect instead of image_rect_color. So no segmentation fault for now. :)

Artem gravatar image Artem  ( 2013-12-17 00:37:11 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2013-12-09 01:09:42 -0500

Seen: 4,608 times

Last updated: Dec 15 '13