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

Replace display error assert with warning, fallback and error #1282

Conversation

josephduchesne
Copy link
Contributor

Replace assert with warning, fallback and error so that when in release mode, librviz does not segfault with a misconfigured DISPLAY env.

In our use of librviz, RenderSystem::setupDummyWindowId() was segfaulting since display was not set correctly. This will provide warnings, fallback and a useful error in such cases.

…se mode, librviz does not segfault with a misconfigured DISPLAY env.

if (display == NULL) {
ROS_FATAL("Can't open default or :0 display. Try setting DISPLAY environment variable.");
std::runtime_error( "Can't open default or :0 display!\n");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to throw right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it has an extra whitespace between the ( and the ".

@josephduchesne
Copy link
Contributor Author

This PR should be good now.

@rhaschke rhaschke merged commit 5f454b8 into ros-visualization:kinetic-devel Mar 6, 2019
rhaschke pushed a commit that referenced this pull request Mar 6, 2019
…t with warning, fallback and error (#1282)

If DISPLAY environment variable is misconfigured, resulting in an invalid display pointer:
- try opening the default display :0
- if that fails too, bailout with a fatal error message
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

Successfully merging this pull request may close these issues.

3 participants