Crash on GNU/Linux

I am working in a portable qt4+occ application that we develop and test on windows and gnu/linux (ubuntu feisty and breezy). I have tested it also on my laptop. Instalation should be correct in all of them because examples and QtOcc work.

In the breezy version it works without any error, in the feisty one it hangs on V3d_View destroy and in my laptop it crashes when calling:
if( defaultdevice.IsNull() )
defaultdevice = new Graphic3d_GraphicDevice( getenv(aDisplay) );

This line is taken from the examples so it should work. It hangs on the GraphicDevice constructor.

Does anyone have an idea about how to face this?

Thanks,
Aleix Pol

P Dolbey's picture

I'd be 99% convinced its your environment variables, particularly CSF_GraphicsShr. It should point to the location of your libTKOpenGl.so shared library.

If your using qtocc, check you've got the latest version from sourceforge at http://sourceforge.net/projects/qtocc . This has removed "delete myView" from the widget destructor, if thats still in your version.

Actually there's a bug (fixed in CVS). In qoccviewwidget.cpp, method viewPrecision change
Standard_Real pixWidth = X2 - X1;
to
Standard_Real pixWidth = std::abs( X2 - X1 );

Regards
Pete

apol's picture

Hi Pete!
As I said, QtOcc works without problems, so I don't understand why it would be needed the CSF_GraphicsShr variable when running our project (we have always CASROOT defined).

Do you think that if we don't delete the View it will be fine?

Thanks,
Aleix

P Dolbey's picture

The error on defaultdevice = ... is invariably down to environment variables, and this if set always needs to point to a valid object. The app may run without without this var at all, using default locations, but I wouldn't advise it.

And as I said, I don't explicilty delete the view any more - as an OCC Handle smart pointer it should auto delete when the widget object goes out of scope and the view has zero references.. I do still delete other objects like the QRubberBand.

Pete