yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00557
[svn] r1468 - eudoxos
-
To:
yade-dev@xxxxxxxxxxxxxxxxxxx
-
From:
Janek Kozicki <janek_listy@xxxxx>
-
Date:
Wed, 20 Aug 2008 12:03:38 +0200
-
Face:
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEUBAQEtLS1KSkpRUVFXV1dYWFhjY2Nzc3N3d3eHh4eKioqdnZ24uLjLy8vc3NxVIagyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AIVEzgS1fgQtQAAAjRJREFUOMtt1DFv00AUAOAzFQNbjigSyoQaRaBMhKgLUyKXpVNNeUpk9vyDqFJhQ1kiBuaqAwJCqvPtSLY7RlTn5+5IdnYkkt/AOyfxXVLe5vf53Z1875kd34tOEax8djmj6GyjhB5bxz50GdsVZr9fqRjZwAtKOJw5Wqs2MMZ16ALHsaDncF7xAHix1oEFHAB8f+pRjcO4gfZDykcYzbiucRolOLUJ6kjA0xtVt+A6TySlM0RajIpK6DzwKZ/nOYbF/gclHMo1ZOHYY/+Ha+AWuM+3oMS4eeqYzZ8FiCltgUqI8cd2wwAVpJk+8LWYjBtnJdQpHQqJMd4Oxt4bU9ESiFGc5hkqaH74asAX4iabP5I5gZ+qjgGlJCqZa3h3lxhoeVcSE1qLQC4sqKOK9MGW9E3izFqqHokoztLFEgXg31sbZEKnWi2T74A4NxfVQqlkjKtcAWD+zcArFEES01dR0E/nnV0IgugmDd/2L84sOAouRBBHEc7gtc8teDkRlE0iNQPo2w3Xhh/D4TCIQ4LRLoTvgwjj6RRgavdurxYGMaIuGOyAW/PpNlCcU9/93AHenAWYjPoAwa+G3e3to/MgFNTAEKvKDjzuCzHTnY3qqdXtx24VijzQfZ0yewZ5cwRFQaa+mIYr1uI0I76+3W4xhlvoVRwOA0Fdl64HlJnxP6T8YpX/Lga4Wv4A3ErrU5oTfN7Mu/llXMl8RXEPji/lQkN3H7qXqgC2By47EXeU/7PJ/wPxRKMnuZwIeAAAAABJRU5ErkJggg==
------------------------------------------------------------------------
r1468 | eudoxos | 2008-08-14 19:17:50 +0200 (czw, 14 sie 2008) | 3 lines
Changed paths:
M /trunk/core/Omega.cpp
M /trunk/core/yade.cpp
1. Remove draw mutex when loading simulation introduced a few days ago (may throw boost::lock_error under some conditions)
2. Restore default signal handlers before exit from main; set SEGV handler to nullHandler since on i386 we (on lenny consistently) get crashes in some log4cxx destructor.
------------------------------------------------------------------------
Index: core/yade.cpp
===================================================================
--- core/yade.cpp (revision 1467)
+++ core/yade.cpp (revision 1468)
@@ -37,7 +37,7 @@
#endif
void nullHandler(int sig){
- cerr<<"nullHandler called"<<endl;
+ cerr<<"WARN: nullHandler, signal "<<(sig==SIGSEGV?"SEGV":"[other]")<<endl;
}
void
@@ -252,6 +252,8 @@
// Py_Finalize(); // FIXME: http://www.boost.org/libs/python/todo.html#pyfinalize-safety says this is unsafe with boost::python
#endif
#ifdef YADE_DEBUG
+ signal(SIGABRT,SIG_DFL); signal(SIGHUP,SIG_DFL); // default handlers
+ signal(SIGSEGV,nullHandler); // FIXME: this is to cover up crash that occurs in log4cxx on i386 sometimes
unlink(Omega::instance().gdbCrashBatch.c_str());
#endif
Index: core/Omega.cpp
===================================================================
--- core/Omega.cpp (revision 1467)
+++ core/Omega.cpp (revision 1468)
@@ -231,18 +231,20 @@
LOG_INFO("Loading file " + simulationFileName);
// FIXME: stop rendering during loading - may lead to crash
- boost::mutex::scoped_lock lock1(rootBody->transientInteractions->drawloopmutex);
- boost::mutex::scoped_lock lock2(rootBody->persistentInteractions->drawloopmutex);
+ {
+ //boost::mutex::scoped_lock lock1(rootBody->persistentInteractions->drawloopmutex);
+ //boost::mutex::scoped_lock lock2(rootBody->transientInteractions->drawloopmutex);
- if(algorithm::ends_with(simulationFileName,".xml") || algorithm::ends_with(simulationFileName,".xml.gz") || algorithm::ends_with(simulationFileName,".xml.bz2")){
- resetRootBody();
- IOFormatManager::loadFromFile("XMLFormatManager",simulationFileName,"rootBody",rootBody);
+ if(algorithm::ends_with(simulationFileName,".xml") || algorithm::ends_with(simulationFileName,".xml.gz") || algorithm::ends_with(simulationFileName,".xml.bz2")){
+ resetRootBody();
+ IOFormatManager::loadFromFile("XMLFormatManager",simulationFileName,"rootBody",rootBody);
+ }
+ else if(algorithm::ends_with(simulationFileName,".yade")){
+ resetRootBody();
+ IOFormatManager::loadFromFile("BINFormatManager",simulationFileName,"rootBody",rootBody);
+ }
+ else throw (yadeBadFile("Extension of file not recognized."));
}
- else if(algorithm::ends_with(simulationFileName,".yade")){
- resetRootBody();
- IOFormatManager::loadFromFile("BINFormatManager",simulationFileName,"rootBody",rootBody);
- }
- else throw (yadeBadFile("Extension of file not recognized."));
if( rootBody->getClassName() != "MetaBody") throw yadeBadFile("Wrong file format (rootBody is not a MetaBody!) ??");