Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using tensorflow.contrib with cv_bridge causes tcmalloc error #161

Closed
ethanabrooks opened this issue Mar 6, 2017 · 3 comments
Closed

Using tensorflow.contrib with cv_bridge causes tcmalloc error #161

ethanabrooks opened this issue Mar 6, 2017 · 3 comments

Comments

@ethanabrooks
Copy link

Environment info

Operating System:

❯ uname -a 
Linux dos 3.13.0-76-generic #120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Minimal reproducible example.

import tensorflow.contrib
import cv_bridge

import rospy
rospy.init_node('node')

This throws the following error:

/usr/bin/python2.7 /home/ethan/.PyCharmCE2016.3/config/scratches/scratch_4.py
src/tcmalloc.cc:277] Attempt to free invalid pointer 0xa2e78616d5f7475 

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

I've also posted to the tensorflow page (tensorflow/tensorflow#8146)

What other attempted solutions have you tried?

I tried reinstalling ros and tensorflow. No change. I also tried print(cv_bridge.__file__) to make sure I was importing the right directory for cv_bridge.

@ethanabrooks
Copy link
Author

The solution was to switch the order of imports:

import tensorflow.contrib
import cv_bridge

import rospy
rospy.init_node('node')

Nevertheless, this is clearly a bug.

@ethanabrooks
Copy link
Author

ethanabrooks commented Mar 9, 2017

Ok. I did a little more digging and I found this line in my .zshrc:

export LD_PRELOAD="/usr/lib/libtcmalloc_minimal.so.4"  

Commenting this out solved the problem. I'm not really sure which of the three libraries that were involved would be responsible, but it might be good to include a more informative error message.

@vrabaud
Copy link
Contributor

vrabaud commented Mar 13, 2017

ok, that is a tough one that really depends on your setting. What does libtcmalloc_minimal do ? Is OpenCV linked to it ?
Seems like it got fixed in tensorflow no ? tensorflow/tensorflow#7960

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

No branches or pull requests

2 participants