← Back to team overview

yade-users team mailing list archive

A strange glibc error when modifying StandAloneEngine:PositionOrientationRecorder

 

Hi, all:

    I am currently making modification in file PositionOrientationRecorder.hpp 
and PositionOrientationRecorder.cpp and I am doing a very simple operation on 
PositionOrientationRecorder.hpp, which is add several variables:

public:
Real sumKinematicEnergy, deltaKinematicEnergy, prevKinematicEnergy;
Vector3r maxUnbalForce;

which will make the PositionOrientationRecorder.hpp look like:
///====================================================================
class PositionOrientationRecorder : public DataRecorder
{
	public :
		std::string outputFile;
		unsigned int interval;

		std::ofstream ofile;
                ///here in the previous version, it said FIXME???
        public:
                Real sumKEnergy, prevKEnergy;
                Vector3r maxUnbalForce;

		PositionOrientationRecorder ();
		~PositionOrientationRecorder ();
		virtual void action(Body* b);

	protected :
		virtual void postProcessAttributes(bool deserializing);
		void registerAttributes();
	REGISTER_CLASS_NAME(PositionOrientationRecorder);
	REGISTER_BASE_CLASS_NAME(DataRecorder);
};
///====================================================================
however after compile and install, use the filegenerator, select 
SDECSpheresPlane, generated a scene.xml file, YADE prompted a message "file 
scene.xml" generated successfully" but after I clicked OK bottom, the YADE 
crashes and gives a whole bunch of errors:

*** glibc detected *** yade: double free or corruption (!prev): 0x0a2227c8 ***
======= Backtrace: =========
/lib/libc.so.6[0x3eb424]
/lib/libc.so.6(__libc_free+0x77)[0x3eb95f]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x353669]
/usr/local/lib/yade/yade-package-dem/libPositionOrientationRecorder.so(_ZN27Po
sitionOrientationRecorderD0Ev+0x1ad)[0x58695bf]/usr/local/lib/yade/yade-packag
e-dem/libSDECSpheresPlane.so(_ZN5boost14checked_deleteI27PositionOrientationRe
corderEEvPT_+0x1e)[0x2c5ecde]
/usr/local/lib/yade/yade-package-dem/libSDECSpheresPlane.so(_ZNK5boost15checke
d_deleterI27PositionOrientationRecorderEclEPS1_+0x1e)[0x2c5ed02]
/usr/local/lib/yade/yade-package-dem/libSDECSpheresPlane.so(_ZN5boost6detail20
sp_counted_base_implIP27PositionOrientationRecorderNS_15checked_deleterIS2_EEE
7disposeEv+0x29)[0x2c9b809]
yade(_ZN5boost6detail15sp_counted_base7releaseEv+0x73)[0x80aa423]
yade(_ZN5boost6detail12shared_countD1Ev+0x1d)[0x80aa461]
yade(_ZN5boost10shared_ptrI6EngineED1Ev+0x15)[0x80c9d65]
yade(_ZN9__gnu_cxx15__mt_alloc_baseIN5boost10shared_ptrI6EngineEEE7destroyEPS4
_+0x11)[0x80d0127]
yade(_ZSt8_DestroyIPN5boost10shared_ptrI6EngineEESaIS3_EEvT_S6_T0_+0x17)[0x80d
0143]
yade(_ZNSt6vectorIN5boost10shared_ptrI6EngineEESaIS3_EED1Ev+0x33)[0x80d068b]
yade(_ZN8MetaBodyD0Ev+0x10c)[0x80e42ec]
yade(_ZN5boost14checked_deleteI8MetaBodyEEvPT_+0x1e)[0x80cf672]
yade(_ZNK5boost15checked_deleterI8MetaBodyEclEPS1_+0x11)[0x80cf689]
yade(_ZN5boost6detail20sp_counted_base_implIP8MetaBodyNS_15checked_deleterIS2_
EEE7disposeEv+0x1c)[0x80d2272]
yade(_ZN5boost6detail15sp_counted_base7releaseEv+0x73)[0x80aa423]
yade(_ZN5boost6detail12shared_countD1Ev+0x1d)[0x80aa461]
yade(_ZN5boost10shared_ptrI8MetaBodyED1Ev+0x15)[0x80cf335]
yade(_ZN13FileGeneratorD2Ev+0x96)[0x80cd278]
/usr/local/lib/yade/yade-package-dem/libSDECSpheresPlane.so(_ZN16SDECSpheresPl
aneD0Ev+0x2d)[0x2c402d5]
/usr/local/lib/yade/yade-package-dem/libSDECSpheresPlane.so(_ZN5boost14checked
_deleteI16SDECSpheresPlaneEEvPT_+0x1e)[0x2c5dba0]
/usr/local/lib/yade/yade-package-dem/libSDECSpheresPlane.so(_ZNK5boost15checke
d_deleterI16SDECSpheresPlaneEclEPS1_+0x1e)[0x2c5dbc4]
/usr/local/lib/yade/yade-package-dem/libSDECSpheresPlane.so(_ZN5boost6detail20
sp_counted_base_implIP16SDECSpheresPlaneNS_15checked_deleterIS2_EEE7disposeEv+
0x29)[0x2c9be21]
yade(_ZN5boost6detail15sp_counted_base7releaseEv+0x73)[0x80aa423]
yade(_ZN5boost6detail12shared_countD1Ev+0x1d)[0x80aa461]
yade(_ZN5boost10shared_ptrI13FileGeneratorED1Ev+0x15)[0x80cf497]
/usr/local/lib/yade/yade-guis/libQtGUI.so(_ZN15QtFileGenerator17pbGenerateClic
kedEv+0x735)[0x9df8e5]
/usr/local/lib/yade/yade-guis/libQtGUI.so(_ZN25QtFileGeneratorController9qt_in
vokeEiP8QUObject+0x96)[0xa6b8d2]
/usr/lib/qt-3.3/lib/libqt-mt.so.3(_ZN7QObject15activate_signalEP15QConnectionL
istP8QUObject+0x16e)[0x4b37db4]
/usr/lib/qt-3.3/lib/libqt-mt.so.3(_ZN7QObject15activate_signalEi+0x6e)[0x4b382
74]
/usr/lib/qt-3.3/lib/libqt-mt.so.3(_ZN7QButton7clickedEv+0x2c)[0x4eb412e]
/usr/lib/qt-3.3/lib/libqt-mt.so.3(_ZN7QButton17mouseReleaseEventEP11QMouseEven
t+0xb9)[0x4bd7a03]
/usr/lib/qt-3.3/lib/libqt-mt.so.3(_ZN7QWidget5eventEP6QEvent+0x3a1)[0x4b76127]
/usr/lib/qt-3.3/lib/libqt-mt.so.3(_ZN12QApplication14internalNotifyEP7QObjectP
6QEvent+0x97)[0x4ad308d]
/usr/lib/qt-3.3/lib/libqt-mt.so.3(_ZN12QApplication6notifyEP7QObjectP6QEvent+0
x6bb)[0x4ad3fef]
/usr/lib/qt-3.3/lib/libqt-mt.so.3(_ZN9QETWidget19translateMouseEventEPK7_XEven
t+0x8bc)[0x4a6a706]
/usr/lib/qt-3.3/lib/libqt-mt.so.3(_ZN12QApplication15x11ProcessEventEP7_XEvent
+0x5fb)[0x4a68eb3]
/usr/lib/qt-3.3/lib/libqt-mt.so.3(_ZN10QEventLoop13processEventsEj+0x238)[0x4a
7cfc8]
/usr/lib/qt-3.3/lib/libqt-mt.so.3(_ZN10QEventLoop9enterLoopEv+0xad)[0x4aeb74b]
/usr/lib/qt-3.3/lib/libqt-mt.so.3(_ZN10QEventLoop4execEv+0x26)[0x4aeb656]
/usr/lib/qt-3.3/lib/libqt-mt.so.3(_ZN12QApplication4execEv+0x1f)[0x4ad2a59]
/usr/local/lib/yade/yade-guis/libQtGUI.so(_ZN5QtGUI3runEiPPc+0x127)[0x9e7e47]
yade(main+0x812)[0x810f386]
/lib/libc.so.6(__libc_start_main+0xc6)[0x39cde6]
yade(__gxx_personality_v0+0xb1)[0x80a7fa9]
===Aborted

I tried several times and after commented the std::ofstream ofile, it seems I 
can add more variables to the class, however, seems after adding 7 variables, 
the program will crash anyway, but if you add less than 7 variables, the glic 
error will not occur.
I have met this problem several times and I am not sure it is due to the QT 
GUI or any other problems, although I don't know whether this error is 
repeatable for others but any kind of help is welcome!

Thanks a lot!

 

_______________________________________________
Yade-users mailing list
Yade-users@xxxxxxxxxxxxxxxx
http://lists.berlios.de/mailman/listinfo/yade-users



Follow ups