PDA

View Full Version : glibc detected



raghvendramisra
26th May 2008, 05:16
Hi all,
in my application i use a main window. on selecting a page from the menu option i am opening database in the init().
I developed this application in cantos and the ported it to fedora4.

now there when i executed the application it once showed error message as
"***glibc detected*** ./dbm:double free or corruption(:prev)........."

what is the reason for this?????????

Also i am facing a strange problem now.

When i run the application and select the page from menu option, the page comes correctly and functionality is also right. But this happens only for two times i.e every third time when i open the page from menu option the application close and shows segmentation fault.

plz help me find what is the problem.

ChristianEhrlicher
26th May 2008, 06:50
You do a 'delete' somewhere but the class/struct was already deleted. Use a debugger to trace down which object you delete twice.

jpn
26th May 2008, 11:16
It could also be a child widget allocated on the stack. Remember that child widgets (actually all QObjects that have a parent) are deleted by their parent.

raghvendramisra
27th May 2008, 04:59
Actually when i commented the Qdatabase code then this problem is not persisting.

The code related to database in my application is in the init() and onClose() which is called on pressing the close button.


QSqlDatabase* db ;
void offline::init()
{

db = QSqlDatabase::addDatabase( QMYSQL3 );
db->setDatabaseName( Database_dbm );
db->open();


}


void offline::onClose() //called on pressing close button
{
db->close();
close();
}

raghvendramisra
27th May 2008, 05:01
*************************

I used gdb to debugg the problem and the message i got on selecting the page third time from the menu option the was

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208789312 (LWP 2834)]
0xb7b8cf04 in my_strcasecmp_8bit () from /usr/lib/mysql/libmysqlclient.so.14


The backtrace is.........................................


0xb7b8cf04 in my_strcasecmp_8bit () from /usr/lib/mysql/libmysqlclient.so.14
#1 0xb7b84862 in get_charset_number () from
/usr/lib/mysql/libmysqlclient.so.14
#2 0xb7b848af in get_charset_by_csname () from
/usr/lib/mysql/libmysqlclient.so.14
#3 0xb7b9dfc4 in mysql_real_connect () from
/usr/lib/mysql/libmysqlclient.so.14
#4 0xb7c973f8 in QMYSQLDriver:: open () from
/usr/lib/qt-3.3/plugins/sqldrivers/libqsqlmysql.so
#5 0xb7c97900 in QMYSQLOpenExtension:: open () from
/usr/lib/qt-3.3/plugins/sqldrivers/libqsqlmysql.so
#6 0x4acf9d56 in QSqlDriver:: open () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#7 0x4ace8ab0 in QSqlDatabase:: open () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#8 0x0805e402 in offline:: init (this=Error accessing memory address
0xbfdad0a4: No such process.
) at .ui/.. /source/offline.ui.h:74
#9 0x0806556f in offline (this=Error accessing memory address 0xbfdad130: No
such process.
) at .ui/offline.cpp: 464
#10 0x08050240 in MainWnd:: offLineForm (this=Error accessing memory address
0xbfdad6c8: No such process.
) at .ui/../source/MainWnd.ui.h:118
#11 0x080ff274 in MainWnd:: qt_invoke (this=Error accessing memory address
0xbfdad6e0: No such process.
) at .moc/moc_MainWnd.cpp: 93
#12 0x4aa5cd17 in QObject:: activate_signal () from
/usr/lib/qt-3.3/lib/libqt-mt.so.3
#13 0x4aa5d274 in QObject:: activate_signal () from
/usr/lib/qt-3.3/lib/libqt-mt.so.3
#14 0x4adf3399 in QAction:: activated () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#15 0x4abae44f in QAction:: internalActivation () from
/usr/lib/qt-3.3/lib/libqt-mt.so.3
#16 0x4adf355d in QAction::qt_invoke () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#17 0x4aa5cdb4 in QObject::activate_signal () from
/usr/lib/qt-3.3/lib/libqt-mt.so.3
#18 0x4add1796 in QSignal:: signal () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#19 0x4aa7a633 in QSignal:: activate () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#20 0x4ab71582 in QPopupMenu::mouseReleaseEvent () from
/usr/lib/qt-3.3/lib/libqt-mt.so.3
#21 0x4aa9b127 in QWidget:: event () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#22 0x4a9f808d in QApplication:: internalNotify () from
/usr/lib/qt-3.3/lib/libqt-mt.so.3
#23 0x4a9f8fef in QApplication:: notify () from
/usr/lib/qt-3.3/lib/libqt-mt.so.3
#24 0x4a98fb0d in QETWidget:: translateMouseEvent () from
/usr/lib/qt-3.3/lib/libqt-mt.so.3
#25 0x4a98deb3 in QApplication:: x11ProcessEvent () from
/usr/lib/qt-3.3/lib/libqt-mt.so.3
#26 0x4a9a1fc8 in QEventLoop:: processEvents () from
/usr/lib/qt-3.3/lib/libqt-mt.so.3
#27 0x4aa1074b in QEventLoop:: enterLoop () from
/usr/lib/qt-3.3/lib/libqt-mt.so.3
#28 0x4aa10656 in QEventLoop:: exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#29 0x4a9f7a59 in QApplication:: exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#30 0x08050151 in main (argc=Error accessing memory address 0xbfdae038: No
such process.
) at source/main.cpp:11


I am unable to identify where i am making a mistake.

Plz help me to find it.
Regards

Raghvendra

raghvendramisra
28th May 2008, 03:29
Am i clear with my problem???????????

no one replied for the possible solution..........
plz look into it

Regards
Raghvendra