Segfault in Handle_Standard_Transient::EndScope

I'm on a 64-bit system.
I'm getting a segmentation fault when I run qtgeom (from QtOCC, http://sourceforge.net/projects/qtocc/ ). I am not certain where the problem is.

$ gdb ./qtgeom
GNU gdb 6.8-debian
This GDB was configured as "x86_64-linux gnu"...
(gdb) r
Starting program: /home/mark/projects/qtgeom/qtgeom
[Thread debugging using libthread_db enabled]
[New Thread 0x7f6ccad2f730 (LWP 4667)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f6ccad2f730 (LWP 4667)]
0x00007f6cca90de25 in Handle_Standard_Transient::EndScope (this=0x8606d8)
at ../../../src/Standard/Handle_Standard_Transient.cxx:56
56 if ( Standard::IsReentrant() ?
(gdb) bt
#0 0x00007f6cca90de25 in Handle_Standard_Transient::EndScope (this=0x8606d8)
at ../../../src/Standard/Handle_Standard_Transient.cxx:56
#1 0x00007f6cca90df11 in Handle_Standard_Transient::Assign (this=0x8606d8, anItem=0x20008ad8)
at ../../../src/Standard/Handle_Standard_Transient.cxx:32
#2 0x00007f6cbc021e48 in GEOM_Engine (this=0x8606d0) at ./inc/Handle_GEOM_Application.hxx:78
#3 0x00007f6cbba50e37 in GEOMImpl_Gen (this=0x8606d8) at ./src/GEOMImpl/GEOMImpl_Gen.cpp:85
#4 0x0000000000425974 in QoccApplication (this=0x7fffd2e8df00, argc=@0x7fffd2e8defc, argv=0x7fffd2e8e028,
_internal=263171) at src/qocc/qoccapplication.cpp:60
#5 0x0000000000424836 in main (argc=1, argv=0x7fffd2e8e028) at src/main/main.cpp:52

Compare #3 with #4 - the length of "this" changes.
I added -m64 to CFLAGS, CXXFLAGS, and FFLAGS in the makefile for salome-geom, thinking that maybe that was the problem. After 'make clean && make && make install', I still get the problem though. I'm sure that qtgeom is using the recompiled libs.

I found http://www.opencascade.org/org/forum/thread_15494/ , but I get the segfault whether OCC is compiled with --enable-production=yes or --enable-production=no.

Any ideas?
Mark

Samit Basu's picture

I had the same problem with the qt sample for opencascade. The fix is to add -D_OCC64 when compiling the application.

Samit