After managing to compile my code under Linux and run my application I notice that 80% of
the time I get a segfault. I investigated further with gdb and here is the gdb output:
Program received signal SIGSEGV, Segmentation fault.
0xb6688de4 in OpenGl_Workspace::AspectFace(unsigned int) ()
from /home/Author/Downloads/occ/occ-build-cmake/lin32/gcc/lib/libTKOpenGl.so
asking for the backtrace:
(gdb) bt
#0 0xb6688de4 in OpenGl_Workspace::AspectFace(unsigned int) ()
from /home/Author/Downloads/occ/occ-build-cmake/lin32/gcc/lib/libTKOpenGl.so
#1 0xb6686083 in OpenGl_Workspace::ResetAppliedAspect() ()
from /home/Author/Downloads/occ/occ-build-cmake/lin32/gcc/lib/libTKOpenGl.so
#2 0xb668752c in OpenGl_Workspace::Activate() ()
from /home/Author/Downloads/occ/occ-build-cmake/lin32/gcc/lib/libTKOpenGl.so
#3 0xb6684dec in OpenGl_Window::Init() ()
from /home/Author/Downloads/occ/occ-build-cmake/lin32/gcc/lib/libTKOpenGl.so
#4 0xb66856f8 in OpenGl_Window::Resize(CALL_DEF_WINDOW const&) ()
from /home/Author/Downloads/occ/occ-build-cmake/lin32/gcc/lib/libTKOpenGl.so
#5 0xb6659bb4 in OpenGl_GraphicDriver::ClipLimit(Graphic3d_CView const&, unsigned int) ()
from /home/Author/Downloads/occ/occ-build-cmake/lin32/gcc/lib/libTKOpenGl.so
#6 0xb68bba78 in Visual3d_View::SetWindow(Handle_Aspect_Window const&) ()
from /home/Author/Downloads/occ/occ-build-cmake/lin32/gcc/lib/libTKV3d.so
#7 0xb68573a9 in V3d_View::SetWindow(Handle_Aspect_Window const&) ()
from /home/Author/Downloads/occ/occ-build-cmake/lin32/gcc/lib/libTKV3d.so
#8 0x08065b87 in QtoccViewWidget::QtoccViewWidget(Handle_AIS_InteractiveContext, QWidget*) ()
#9 0x08061c58 in MainWindow::setupContainerWidget() ()
#10 0x0806191c in MainWindow::MainWindow(QWidget*) ()
#11 0x08060d0c in main ()
11-9 are calls made by my program, but 8-0 are calls made by openCASCADE. Looking at my code, I don't seem to do anything wrong. Has anyone else come across something similar?
Note that on windows the application runs 100% ok.
Discussion
2 archived replies
Posts are displayed in their archived order.
01Author
For further help, the code that I use is:
#if defined WIN32
Aspect_Handle aWindowHandle = (Aspect_Handle )winId();
Handle(WNT_Window) hWnd = new WNT_Window (aWindowHandle);
#elif defined LIN
Window aWindowHandle = (Window )winId();
Handle(Aspect_DisplayConnection) aDispConnection = myContext->CurrentViewer()->Driver()->GetDisplayConnection();
Handle(Xw_Window) hWnd = new Xw_Window (aDispConnection, aWindowHandle);
#else
#error Supported platforms are Windows(WIN32) and Linux(LIN)
#endif
myView->SetWindow(hWnd);
02Commenter-1
Hello
I had the same problem. For me, the problem was that I overrode the sizeHint() method from Qt. Commenting it out fixed the problem.