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

rviz_qt segfaults on startup on OS X (ros-pkg ticket #5289) #461

Closed
hershwg opened this issue Sep 19, 2012 · 1 comment
Closed

rviz_qt segfaults on startup on OS X (ros-pkg ticket #5289) #461

hershwg opened this issue Sep 19, 2012 · 1 comment
Labels

Comments

@hershwg
Copy link
Member

hershwg commented Sep 19, 2012

When I run rviz_qt, after applying the workaround at #5144, on OS X I get (from gdb):

{{{
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
Ogre::RenderSystem::attachRenderTarget (this=0x108763568, target=@0x0) at /Users/william/ros/visualization_common/ogre/build/ogre_src_v1-7-3/OgreMain/src/OgreRenderSystem.cpp:242
242 assert( target.getPriority() < OGRE_NUM_RENDERTARGET_GROUPS );
(gdb) bt
#0 Ogre::RenderSystem::attachRenderTarget (this=0x108763568, target=@0x0) at /Users/william/ros/visualization_common/ogre/build/ogre_src_v1-7-3/OgreMain/src/OgreRenderSystem.cpp:242
#1 0x000000010d7225e5 in Ogre::GLRenderSystem::_createRenderWindow (this=0x108763568, name=@0x7fff5fbfdf00, width=1, height=1, fullScreen=false, miscParams=0x7fff5fbfde90) at /Users/william/ros/visualization_common/ogre/build/ogre_src_v1-7-3/RenderSystems/GL/src/OgreGLRenderSystem.cpp:1011
#2 0x00000001002058dc in Ogre::Root::createRenderWindow (this=0x108752dd8, name=<value temporarily unavailable, due to optimizations>, width=<value temporarily unavailable, due to optimizations>, height=<value temporarily unavailable, due to optimizations>, fullScreen=<value temporarily unavailable, due to optimizations>, miscParams=<value temporarily unavailable, due to optimizations>) at /Users/william/ros/visualization_common/ogre/build/ogre_src_v1-7-3/OgreMain/src/OgreRoot.cpp:1199
#3 0x0000000100d88370 in ogre_tools::RenderSystem::makeRenderWindow (this=0x7fff5fbfdf30, window_id=0, width=1606410032, height=1606410032) at render_system.cpp:200
#4 0x0000000100d894af in ogre_tools::RenderSystem::RenderSystem (this=0x106009200) at render_system.cpp:62
#5 0x0000000100d89594 in ogre_tools::RenderSystem::get () at render_system.cpp:49
#6 0x0000000101d4c958 in rviz::VisualizationFrame::initialize (this=0x106005b90, display_config_file=@0x7fff5fbfee90, fixed_frame=@0x7fff5fbfee80, target_frame=@0x7fff5fbfee88, splash_path=@0x7fff5fbfee78, verbose=false) at visualization_frame.cpp:188
#7 0x0000000101d6879d in rviz::VisualizerApp::init (this=0x7fff5fbff0a8, argc=2, argv=0x7fff5fbff148) at visualizer_app.cpp:189
#8 0x000000010000e18a in main (argc=2, argv=0x7fff5fbff148) at main.cpp:39

}}}

This is because it is trying to use the carbon interface, when it should be using the cocoa interface. This shouldn't be the case given this code starting at line 184 of render_system.cpp:

{{{
// Set the macAPI for Ogre based on the Qt implementation

ifdef QT_MAC_USE_COCOA

params["macAPI"] = "cocoa";
params["macAPICocoaUseNSView"] = "true";

else

params["macAPI"] = "carbon";

endif

}}}

This define is never true, which doesn't make sense given that QT_MAC_USE_COCOA is a compile time flag.

After further investigation it turns out that you need to include:

{{{

include <QtCore/qglobal.h>

}}}

For that define to be set properly.

Patch is for visualization_experimental 830568a7d2a9.

trac data:

@hershwg
Copy link
Member Author

hershwg commented Sep 19, 2012

[hersh] sweet, thanks for all this nice work!

Fixed in r187.

@hershwg hershwg closed this as completed Sep 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant