PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

Jakob
Hi,

I try to run the PCLVisualizer example from the documentation:
using Visual Studio 2012 on Windows 7

I managed to build all mandatory dependencies
boost 1.53.0
VTK 5.8.0 (this was only possible after some changes mentioned here: http://sourceforge.net/p/viste/wiki/BuildWindowsVS2012/) - 6.0.0 has too many changes to work with PCL 1.7.0
flann 1.8.4
eigen 3.1.2

and i build PCL 1.7.0 (2013.07.23) from the gzipped source tarball using the dependencies. All this using CMake 2.8.10.1 and all for 32bit.

also used CMake+VS2012 to build the PCLVisualizer example in debug and in release mode. Both successful. In debug mode the program runs without problems, but the release build gives me this:

Unhandled exception at 0x514018B0 (pcl_visualization.dll) in pcl_visualizer_demo.exe: 0xC0000005: Access violation reading location 0x12BE2BEC.

To figure out where this comes from, i built the dependencies and PCL and the example project in release with debug.

This is the callstack:
  ntdll.dll!774915de() Unknown
  [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
> pcl_visualization.dll!vtkPolyData::ComputeBounds() Line 636 C++
  pcl_visualization.dll!vtkDataSet::GetBounds(double * bounds) Line 176 C++
  pcl_visualization.dll!vtkMapper::GetBounds() Line 105 C++
  pcl_visualization.dll!vtkActor::GetBounds() Line 318 C++
  pcl_visualization.dll!vtkFrustumCoverageCuller::Cull(vtkRenderer * ren, vtkProp * * propList, int & listLength, int & initialized) Line 98 C++
  pcl_visualization.dll!vtkRenderer::AllocateTime() Line 557 C++
  pcl_visualization.dll!vtkRenderer::Render() Line 336 C++
  pcl_visualization.dll!vtkRendererCollection::Render() Line 53 C++
  pcl_visualization.dll!pcl::visualization::PCLVisualizerInteractorStyle::OnTimer() Line 1039 C++
  pcl_visualization.dll!vtkSubjectHelper::InvokeEvent(unsigned long event, void * callData, vtkObject * self) Line 605 C++
  pcl_visualization.dll!vtkObject::InvokeEvent(unsigned long event, void * callData) Line 773 C++
  pcl_visualization.dll!vtkWin32RenderWindowInteractor::OnTimer(HWND__ * __formal, unsigned int timerId) Line 555 C++
  pcl_visualization.dll!vtkHandleMessage2(HWND__ * hWnd, unsigned int uMsg, unsigned int wParam, long lParam, vtkWin32RenderWindowInteractor * me) Line 826 C++
  pcl_visualization.dll!vtkHandleMessage(HWND__ * hWnd, unsigned int uMsg, unsigned int wParam, long lParam) Line 708 C++
  user32.dll!762762fa() Unknown
  user32.dll!76276d3a() Unknown
  user32.dll!76276ce9() Unknown
  user32.dll!762777c4() Unknown
  user32.dll!76277bca() Unknown
  pcl_visualization.dll!vtkWin32RenderWindowInteractor::Start() Line 129 C++
  pcl_visualization.dll!pcl::visualization::PCLVisualizer::spinOnce(int time, bool force_redraw) Line 449 C++
  pcl_visualizer_demo.exe!main(int argc, char * * argv) Line 378 C++
  pcl_visualizer_demo.exe!__tmainCRTStartup() Line 536 C
  kernel32.dll!76c433aa() Unknown
  ntdll.dll!774a9ef2() Unknown
  ntdll.dll!774a9ec5() Unknown

It is caused by the lines 635 to 636 of pcl_visualizer_demo.cpp:
          this->Points->GetPoint( pts[i], x );
          this->Bounds[0] = (x[0] < this->Bounds[0] ? x[0] : this->Bounds[0]);
I don't have a clue why this happens and how to fix it. I think its caused by some code optimizations during release build by VS2012 compiler!? Can anyone help me with this?
BTW: Going back to VS2010 is not an option for me. I want to use PCL in an existing VS2012 project AND I want to be able to run this project in release mode ;-)
Thanks!

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

Jakob
Nobody facing the same problem when trying to use PCL with VS2012? Cant believe that I'm the only one to try this!? Somone out there who is successfully running VS2012+PCL 1.7.0 or an older version?
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

Friedrich Politz
I think most people are using VS2010. I am using VS2012 for other projects but I exclusively installed 2010 for PCL..

As building and running PCL (-projects) with VS2012 is error prone most devs refrain from using it. I'd be happy to see PCL officially supporting VS2012. Especially because 2013 is already on its way..
Cheers,
Fred
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

Radu B. Rusu
Administrator
Is there an official bug report for PCL on VS2012? I remember having seen people that compile it and use it successfully from source.

Best,
Radu.

On Aug 12, 2013, at 9:51 AM, Friedrich Politz <[hidden email]> wrote:

> I think most people are using VS2010. I am using VS2012 for other projects
> but I exclusively installed 2010 for PCL..
>
> As building and running PCL (-projects) with VS2012 is error prone most devs
> refrain from using it. I'd be happy to see PCL officially supporting VS2012.
> Especially because 2013 is already on its way..
>
>
>
> -----
> Cheers,
> Fred
> --
> View this message in context: http://www.pcl-users.org/PCLVisualizer-VS2012-PCL1-7-0-Release-Mode-Problem-tp4028975p4029040.html
> Sent from the Point Cloud Library (PCL) Users mailing list mailing list archive at Nabble.com.
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

Friedrich Politz
I haven't filed one my own as my projects are running stable on VS2010. But I recall there was an error I couldn't fix last time I tried. If I have time for that I'll give it a shot next weekend.
Cheers,
Fred
RB
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

RB
In reply to this post by Radu B. Rusu
I have the same issue at runtime with either vtk 5.8 or 5.10.1
I'm not sure if it is related to pcl or it's a vtk exposed by compiling with VS2012.
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

baggepinnen
In reply to this post by Jakob
+1 for this issue.

I'm running fine under vs2012 PCL 1.7.0 when using the pcl_xx_debug.lib libraries, when switching to pcl_xx_release.lib however exceptions like the one described occur everywhere :(
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

Lars Glud
This post has NOT been accepted by the mailing list yet.
This post was updated on .
+1 for this issue

I have the same problem using the following:

vs2012 express compiling in 32 bit mode

with following libs:
boost 1.54
flann 1.8.4
Trunk PCL
VTK 6.0.0 (incl. kylelutz fixes for VTK 6, and some of my own since I got runtime errors, but thats another issue)


The exe files works fine in debug, but crashes in release (only tried the viewer example though)

regards, Lars
Vision System Engineer
Danrobotics A/S
DK
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

Anubis
This post has NOT been accepted by the mailing list yet.
Me too,

My config is:

VS2012 Express in 64Bit mode
Boost 1.54.0
FLANN 1.8.4
Eigen 3.2.0
VTK 5.10.1

The debug mode works fine, but in release mode it crashes.
I found out that the spin / spinonce function makes the problem. When it is called I get an access violation exception.
When I comment this line out I can not interact with the window, but it don't crashes.
When I don't add any pointcloud by addPointCloud it works with spin / spinonce ... but there is nothing to show. A way around this function is to add pointclouds by addModelFromPLYFile(...). Then the objects are loaded directly in vtk, but the problem is, that this function is only useful for meshes.

I think the problem is the fast speed of processing multiple threads in release mode. Is there a way to capsulate (by mutexes?) the thread that is started by spin / spinonce from the other threads?

regards Silvio
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

Anubis
This post has NOT been accepted by the mailing list yet.
Hi, it's me again,

i've find a way to avoid the crash, but in my application it is not really a solution. When I remove the pointcloud before the call of spinonce is done then there is no access violation. After that I add the pointcloud again.

#ifndef _DEBUG
    viewer.removePointCloud(*i);
#endif
    viewer.spinOnce();
#ifndef _DEBUG
    viewer.addPointCloud(pc, *i);
#endif

When I start the release build of the application the viewer don't crashes, but there is no visible pointcloud.
Could you please try this approach in your code and post your results?

regards Silvio
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

Jakob
I think thats exactly what should happen when you remove the cloud before it is rendered by calling spinOnce - the viewer has nothing to render and you will see nothing. As you say, not really a solution...you could than directly run your program without the viewer -.-
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

Anubis
This post has NOT been accepted by the mailing list yet.
Ahh, okay I thought spinonce is responsible for the event handling and not for rendering
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

Anubis
This post has NOT been accepted by the mailing list yet.
I solved the problem by using openscenegraph instead.
I used the code from
http://roboticcreatures.wordpress.com/2011/12/29/loading-3d-point-clouds-pcd-format-in-openscenegraph/
and modified it (also the rest of my code) and now it works very well.

It's not the best solution but, hey, I have a release pointcloud viewer ... goal reached!
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

kwaegel
Administrator
I have encountered similar problems, and I think I've figured out the problem.

When we have Vtk built in Debug or Release, and PCL in the same mode, everything works fine. If we try to mix build modes, I think we end up freeing memory across DLL boundaries and crashing.

Long and short of it, try making sure Vtk and PCL are built in the same Debug/Release mode. Ideally we could compile Vtk in both modes, but I'm not sure of the best way to do that yet.
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

kwaegel
Administrator
Here is another solution: http://www.vtk.org/pipermail/vtkusers/2012-April/073618.html

Target the VTK build directory, not the install directory.
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

kellp
In reply to this post by Anubis
Hi I saw that you managed to build pcl 1.7.0 with visual studio 2012. Can you tell me if you included OPENNI to build PCL. if yes which version did you used? from which website did u download it?
Thank you
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

kwaegel
Administrator
kellp wrote
Hi I saw that you managed to build pcl 1.7.0 with visual studio 2012. Can you tell me if you included OPENNI to build PCL. if yes which version did you used? from which website did u download it?
Thank you
My build notes list the version of OpenNI I use (2.x), and where to download it.

Unfortunately, OpenNI 2.x support was only recently added to PCL and does not work with the rest of the library (yet). Modifying a specific part of PCL to use it is pretty easy, though. The only place it's used right now is an example viewer app.
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer+VS2012+PCL1.7.0 Release Mode Problem

swaroop.capricorn
This post has NOT been accepted by the mailing list yet.
In reply to this post by Jakob
Hello,

I have a similar issue with release mode. I am able to run the release mode application built by cmake in the system (windows xp, 32bit, visual studio 2010) where I created this project without any problem. But, I transferred this application to another windows platform (windows 7, 64-bit) and when I run the application there, I get error "pcl_visualization_release.dll missing. try installing..".

I would be glad, If you could please tell, how can I solve this.

http://www.pcl-users.org/Problem-visual-studio-PCL-project-in-release-mode-td4037207.html

Thanks,
Jyothi