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
image_view: Attempt to unlock mutex that was not locked #201
Comments
Looking online, it seems like a GTK bug: https://git.gnome.org/browse/gtk+/commit/?h=gtk-2-24&id=fbf38d16bcc26630f0f721d266509f5bc292f606 Otherwise, go with rqt_image_view, it will not have that bug. |
Thanks for the help! Using OpenCV 3.1 and have got both GTK+ 3 and 2 installed - But from the CMake file for image_view I can see that it's linking against GTK2 specifically When you say compile against Qt - do you mean to compile image_view with qt ? |
image_view does not link to GTK, only the nodelet (which got removed from image_view for that kind of issue). |
I'm not very familiar with how nodelets work, but doesn't the following excerpt from the CMake file imply that image_view executable is indeed linking against the gtk libraries?
|
It's confusing but that is the line to look at: |
So you are still having problems with the executable alone ? (if you do an ldd on it, do you see any GTK lib ?) |
Yes, the image_view is still failing with the same error and it does seem to be linking against gtk3.0
|
interesting, so it really is because of your platform. Can you check to which libopencv_highgui3 you are linked to and if it is linked to gtk (mine is not as we force OpenCV to be linked to Qt but maybe not on your platform). |
Yes, this does seem to be the case. I didn't think that the gtk dependency could've been inherited from opencv itself !
So, I assume recompiling opencv with Qt might fix this particular issue? |
yes. If you have Qt and use the official opencv3-release (if you use the standard compilation from source from ROS), then you should be fine: |
Hi, closing as we established that this is (unfortunately) a bug in how OpenCV uses GTK. We can continue the discussion here though to help you out with Qt. |
This bug seems to have resurfaced with Ubuntu 18.04 / ROS Melodic, since they use the system OpenCV library. |
Inspired by this Stackoverflow entry, I managed to fix the crash by removing the call to A good workaround for the buggy GTK thread implementation is a I can prepare a PR if you want. |
PR would be appreciated. If only so others can compile and get it working again. Can you provide a minimal example of the bug without ROS also? I can try to follow up with OpenCV community. |
The minimal example would be #include <opencv2/highgui/highgui.hpp>
int main (int argc, char** argv)
{
cv::startWindowThread();
cv::waitKey(0);
return 0;
} Store as |
Thanks @roehling . Tested your PR, works like a charm. |
Hello Timo Roehling (@roehling) , |
Hi @AmeyHande
|
hi @kunaltyagi |
The tutorial seems to clone a full workspace. This means you should probably do something like this:
|
Thanks @roehling Its working thank you so much 💯 |
Hi @kunaltyagi, |
@vidyasudevan If the fix works manually but not on reboot, the most common reason is if your
|
Thanks for the reply
…On Mon, Dec 10, 2018 at 5:15 AM Kunal Tyagi ***@***.***> wrote:
@vidyasudevan <https://github.com/vidyasudevan> If the fix works manually
but not on reboot, the most common reason is if your
~/pilab_ws/devel/setup.bash (or related setup shell file) has not been
loaded.
1. Please ensure that your rc file (eg: ~/.bashrc) contains the source
~/pilab_ws/deve/setup.bash or . ~/pilab_ws/deve/setup.bash
2. It is not overshadowed by another source of some other workspace or
the root ROS setup script (/opt/ros/<distro>/setup.bash is the default
location)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#201 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWWBQ5dIqT5urHnNqPTYcGYINVYm6nRqks5u3bWVgaJpZM4IzaQj>
.
--
Regards,
Vidya
Research Assistant
Department of Mechanical Engineering
The Petroleum Institute
Abu Dhabi, UAE
|
@roehling |
This looks like it could be a version conflict with OpenCV. Did you install a different version than the default, or did you update your OpenCV without rebuilding the whole workspace? |
I'm not sure if it's a default version, I downloaded 3.4.5 version and then followed a video on YouTube which made a build using CMake software. After making the build, I just built the workspace by "make" command. I'm new at this so I'm not sure how it works though. Here's the link to that instruction video: |
The prebuilt ROS packages link against OpenCV 3.2.0, since that's the version that ships with in Ubuntu 18.04 (the "default" or "system" version for that Ubuntu). It is nearly impossible to mix and match different versions in the same source tree, as you just saw. Either you should stick with the system OpenCV or build ROS completely from source and be extra careful to never accidentally link against the wrong version. Unless you have some experience with that, I'd advise against it. |
Ohh, I did not know that. Thank you! I'll install 3.2.0 version. |
To add on to this issue, NVidia Jetson AGX Xavier module runs Ubuntu 18.04 with OpenCV 3.3.1. This may mean not installing / uninstalling OpenCV 3.3.1 and installing OpenCV 3.2. I do not know if the installed OpenCV 3.3.1 is a stock install or has any optimizations turned on. I will try to install OpenCV 3.2 to see if the issue referenced by @26atul05 is solved. |
After a number of procedures, the NVidia Jetson Xavier module can run the image_pipeline package successfully. I do not think this is the correct area to post the necessary steps. Perhaps the NVidia Jetson forum is a more suitable area. In short, OpenCV 3.3.1 was removed and OpenCV 3.2 was installed. Thanks @roehling for the info. |
This problem seems not to be fixed for Melodic on Ubuntu 18.04... |
Apparently, the fix is merged to the master branch but not yet released in a new version. |
not helped but only turns out
i posted details in opencv/opencv#15504 |
I'm not exactly sure what you mean by "not helped", but the code you quoted is supposed to be the smallest possible example program that still exhibits the bug. It's not intended as a fix. See e.g. here for a way to use this PR, or even better, get the ROS maintainer to release a new version to Melodic, so everyone can benefit. |
sorry, but dou you mean the fix is to removing the "cv::startWindowThread();" from the minimal example? i just want to figure out what's the minimal fix for the minimal bug example...thanks |
@vrabaud, thanks, its works for me when i change the command |
@roehling, your solution also worked with Jetson Nano and "image_transport Tutorials Subscribing To Images" example. Thanks |
Thank you, I have fixed my problem. |
Hi,
When I try to visualize an image using the image_view node and i get:
There were previous issues (#106) and (#153) but none seem to have a solution
Any clue?
My ROS version is Indigo on Arch Linux.
Thanks in advance.
The text was updated successfully, but these errors were encountered: