Ok, I see. You are running in gcc, i386 without any -march= compiler flag.
So gcc assumes that you want to compile for a plain old i386 (read this does
not even mean an i486). In this case gcc is limited to an instruction set
where no such atomic operations are available. In fact you could not even
programm a mutex with that i386 instruction set, as well as you could not
build any SMP machine using an i386.
Ahi Ahi Ahi!!
That means that I'm working without this optimization since the beginning?
And nevertheless OSG is so fast?
I specify in the advanced cmake options:
CMAKE_C_FLAGS -march=i486 -mtune=i486
CMAKE_CXX_FLAGS -march=i486 -mtune=i486
Then configure and generate, but the ./include/OpenThreads/Config file continues with
everything commented out. Have I missed something?
In this case, when we cannot assume any atomic operations. So we need to use
the previous mutex based behaviour.
But for that, the old mechnisms are still there. You need to ensure that
refcounting works in a threadsafe way using either the
OSG_THREAD_SAFE_REF_UNREF environment variable or by calling
OK, thanks. But for now I want only to contribute with my ignorance :-) to polish this OSG
functionality.
osg::Referenced::setThreadSafeReferenceCounting(true);
before *any* concurrently used osg::Referenced object is created.
Alternatively you can uncomment that ENFORCE_THREADSAFE define in
src/osg/Referenced.cpp that does change the default behaviour of referenced.
As soon as the build finishes, I will report back to you.
OK, now crashes in another place, see below. This run has been done before changing
march/mtune.
Are you running with the environment variable OSG_THREAD_SAFE_REF_UNREF set or
unset?
Unset
Greetings
MAthias
Thanks Mathias!
mario
$ gdb osgthirdpersonview
GNU gdb 6.6.50.20070726-cvs
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i586-suse-linux"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) r
Starting program: /local/OSG/OpenSceneGraph/bin/osgthirdpersonview
[Thread debugging using libthread_db enabled]
[New Thread 0xb6a21910 (LWP 22570)]
/local/OSG/OpenSceneGraph/bin/osgthirdpersonview: Could not find specified files. Trying
"cow.osg" instead.
[New Thread 0xb5f28b90 (LWP 22581)]
[New Thread 0xb5727b90 (LWP 22583)]
[New Thread 0xb4f26b90 (LWP 22584)]
[New Thread 0xb4725b90 (LWP 22585)]
Warning: deleting still referenced object 0x806cfd0 of type
'PN3osg10ReferencedE'
the final reference count was 1, memory corruption possible.
Warning: deleting still referenced object 0x806cfd0 of type
'PN3osg10ReferencedE'
the final reference count was 4294967295, memory corruption possible.
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb5727b90 (LWP 22583)]
0xb7f61635 in typeinfo for osg::Scissor () from
/local/OSG/OpenSceneGraph/lib/libosg.so.39
(gdb) where
#0 0xb7f61635 in typeinfo for osg::Scissor () from
/local/OSG/OpenSceneGraph/lib/libosg.so.39
#1 0xb7e6c5c4 in osg::Group::traverse (this=0x8056d50, [EMAIL PROTECTED])
at /local/OSG/OpenSceneGraph/src/osg/Group.cpp:62
#2 0xb7bd58c1 in osgUtil::CullVisitor::apply (this=0x8102668, [EMAIL
PROTECTED])
at /local/OSG/OpenSceneGraph/include/osg/NodeVisitor:181
#3 0xb7e6dbaa in osg::Group::accept (this=0x8056d50, [EMAIL PROTECTED])
at /local/OSG/OpenSceneGraph/include/osg/Group:38
#4 0xb7c679a2 in osgUtil::SceneView::cullStage (this=0x8101750, [EMAIL
PROTECTED],
[EMAIL PROTECTED], cullVisitor=0x8102668, rendergraph=0x8102488,
renderStage=0x81024d8,
viewport=0x814a9f0) at
/local/OSG/OpenSceneGraph/src/osgUtil/SceneView.cpp:926
#5 0xb7c633ea in osgUtil::SceneView::cull (this=0x8101750)
at /local/OSG/OpenSceneGraph/src/osgUtil/SceneView.cpp:792
#6 0xb7ad39c1 in osgViewer::Renderer::cull (this=0x8101530)
at /local/OSG/OpenSceneGraph/src/osgViewer/Renderer.cpp:302
#7 0xb7ad2afa in osgViewer::Renderer::operator() (this=0x8101530,
object=0x8100a18)
at /local/OSG/OpenSceneGraph/src/osgViewer/Renderer.cpp:624
#8 0xb7e96427 in osg::OperationThread::run (this=0x814b3d0)
at /local/OSG/OpenSceneGraph/src/osg/OperationThread.cpp:413
#9 0xb7f6b093 in OpenThreads::ThreadPrivateActions::StartThread
(data=0x814b3dc)
at /local/OSG/OpenSceneGraph/src/OpenThreads/pthreads/PThread.c++:170
#10 0xb7a22192 in start_thread () from /lib/libpthread.so.0
#11 0xb762202e in clone () from /lib/libc.so.6
(gdb)
--
Ing. Mario Valle
Data Analysis and Visualization Services | http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS) | Tel: +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org