davinder101
asked on
debugging crash in windows application
I'm working with vs2005 IDE and Qt lib for my c/c++ application, my application is crashing at some point which i'm not able to figure out (the exact line).I do't have any performance tool or memory leak detection tools. So can any one help me to figure out this that how can i debug my application to fix this problem..thanks in advance :-)
you can easily find call stack, can you post your call stack when it crashes
ASKER
qgifd4.dll!10003686()
[Frames below may be incorrect and/or missing, no symbols loaded for qgifd4.dll]
> QtCored4.dll!qAtomicSetPtr <QByteArra y::Data *>(QByteArray::Data * volatile * ptr=0x67261310, QByteArray::Data * newval=0x67261310) Line 160 + 0x10 bytes C++
QtCored4.dll!QBasicAtomic: :deref() Line 76 + 0x10 bytes C++
QtCored4.dll!QByteArray::o perator=(c onst QByteArray & other={...}) Line 795 + 0x8 bytes C++
qgifd4.dll!10007b68()
qgifd4.dll!10004845()
ntdll.dll!7c9101db()
QtGuid4.dll!QImageReader:: read(QImag e * image=0x0013d4bc) Line 977 + 0x21 bytes C++
QtGuid4.dll!QImageReader:: read() Line 921 + 0xc bytes C++
QtGuid4.dll!QImage::fromDa ta(const unsigned char * data=0x03d93f78, int size=59904, const char * format=0x00000000) Line 4123 + 0x3a bytes C++
QtGuid4.dll!QImage::loadFr omData(con st unsigned char * data=0x03d93f78, int len=59904, const char * format=0x00000000) Line 4087 + 0x15 bytes C++
StellarPhoenixPhotoRecover y.exe!QFil eView::Get ItemPrevie w(void * DosDir=0x01a1f638) Line 1884 C++
StellarPhoenixPhotoRecover y.exe!QFil eView::qt_ metacall(Q MetaObject ::Call _c=InvokeMetaMethod, int _id=10, void * * _a=0x0013dae8) Line 157 + 0x11 bytes C++
QtCored4.dll!QMetaObject:: activate(Q Object * sender=0x01280f80, int from_signal_index=11, int to_signal_index=11, void * * argv=0x0013dae8) Line 3066 + 0x46 bytes C++
QtCored4.dll!QMetaObject:: activate(Q Object * sender=0x01280f80, const QMetaObject * m=0x0071b8fc, int local_signal_index=0, void * * argv=0x0013dae8) Line 3125 + 0x15 bytes C++
StellarPhoenixPhotoRecover y.exe!QRaw RecoveryTh read::GetF ilePreview (void * _t1=0x01a1f638) Line 117 + 0x15 bytes C++
StellarPhoenixPhotoRecover y.exe!QRaw RecoveryTh read::qt_m etacall(QM etaObject: :Call _c=InvokeMetaMethod, int _id=0, void * * _a=0x00fcc028) Line 91 + 0x11 bytes C++
QtCored4.dll!QMetaCallEven t::placeMe taCall(QOb ject * object=0x01280f80) Line 522 C++
QtCored4.dll!QObject::even t(QEvent * e=0x02082c90) Line 1107 + 0x14 bytes C++
QtGuid4.dll!QApplicationPr ivate::not ify_helper (QObject * receiver=0x01280f80, QEvent * e=0x02082c90) Line 3541 + 0x11 bytes C++
QtGuid4.dll!QApplication:: notify(QOb ject * receiver=0x01280f80, QEvent * e=0x02082c90) Line 3100 + 0x10 bytes C++
QtCored4.dll!QCoreApplicat ion::notif yInternal( QObject * receiver=0x01280f80, QEvent * event=0x02082c90) Line 516 C++
QtCored4.dll!QCoreApplicat ion::sendE vent(QObje ct * receiver=0x01280f80, QEvent * event=0x02082c90) Line 185 + 0x39 bytes C++
QtCored4.dll!QCoreApplicat ionPrivate ::sendPost edEvents(Q Object * receiver=0x00000000, int event_type=0, QThreadData * data=0x00f17e78) Line 1102 + 0xd bytes C++
QtCored4.dll!QCoreApplicat ion::sendP ostedEvent s(QObject * receiver=0x00000000, int event_type=-1) Line 987 + 0x11 bytes C++
QtCored4.dll!QEventDispatc herWin32:: processEve nts(QFlags <enum QEventLoop::ProcessEventsF lag> flags={...}) Line 432 + 0x24 bytes C++
QtGuid4.dll!QGuiEventDispa tcherWin32 ::processE vents(QFla gs<enum QEventLoop::ProcessEventsF lag> flags={...}) Line 975 + 0x15 bytes C++
QtCored4.dll!QEventLoop::p rocessEven ts(QFlags< enum QEventLoop::ProcessEventsF lag> flags={...}) Line 126 C++
QtCored4.dll!QEventLoop::e xec(QFlags <enum QEventLoop::ProcessEventsF lag> flags={...}) Line 171 + 0x2d bytes C++
QtCored4.dll!QCoreApplicat ion::exec( ) Line 744 + 0x15 bytes C++
QtGuid4.dll!QApplication:: exec() Line 3039 C++
StellarPhoenixPhotoRecover y.exe!main (int argc=1, char * * argv=0x00f16870) Line 30 + 0x6 bytes C++
StellarPhoenixPhotoRecover y.exe!WinM ain(HINSTA NCE__ * instance=0x00400000, HINSTANCE__ * prevInstance=0x00000000, char * __formal=0x00181f4d, int cmdShow=1) Line 103 + 0x12 bytes C++
StellarPhoenixPhotoRecover y.exe!__tm ainCRTStar tup() Line 578 + 0x35 bytes C
StellarPhoenixPhotoRecover y.exe!WinM ainCRTStar tup() Line 403 C
kernel32.dll!7c817077()
StellarPhoenixPhotoRecover y.exe!__st rrev() + 0x1b2a9 bytes
StellarPhoenixPhotoRecover y.exe!Ui_F ileViewDia log::setup Ui(QDialog * FileViewDialog=0x005c003a) Line 80 + 0x7 bytes C++
[Frames below may be incorrect and/or missing, no symbols loaded for qgifd4.dll]
> QtCored4.dll!qAtomicSetPtr
QtCored4.dll!QBasicAtomic:
QtCored4.dll!QByteArray::o
qgifd4.dll!10007b68()
qgifd4.dll!10004845()
ntdll.dll!7c9101db()
QtGuid4.dll!QImageReader::
QtGuid4.dll!QImageReader::
QtGuid4.dll!QImage::fromDa
QtGuid4.dll!QImage::loadFr
StellarPhoenixPhotoRecover
StellarPhoenixPhotoRecover
QtCored4.dll!QMetaObject::
QtCored4.dll!QMetaObject::
StellarPhoenixPhotoRecover
StellarPhoenixPhotoRecover
QtCored4.dll!QMetaCallEven
QtCored4.dll!QObject::even
QtGuid4.dll!QApplicationPr
QtGuid4.dll!QApplication::
QtCored4.dll!QCoreApplicat
QtCored4.dll!QCoreApplicat
QtCored4.dll!QCoreApplicat
QtCored4.dll!QCoreApplicat
QtCored4.dll!QEventDispatc
QtGuid4.dll!QGuiEventDispa
QtCored4.dll!QEventLoop::p
QtCored4.dll!QEventLoop::e
QtCored4.dll!QCoreApplicat
QtGuid4.dll!QApplication::
StellarPhoenixPhotoRecover
StellarPhoenixPhotoRecover
StellarPhoenixPhotoRecover
StellarPhoenixPhotoRecover
kernel32.dll!7c817077()
StellarPhoenixPhotoRecover
StellarPhoenixPhotoRecover
are u using some image in ur code ? can u comment that part and see if it is still crashing?
can u share ur code sply the one crashing?
can u share ur code sply the one crashing?
ASKER
thanks for replying irfan, yes i'm loding some images at runtime to show their preview. i got some idea that crashing happened for gif images when i blocked gif part of code it's still crashing.
ASKER
thanks andy for replying but answer did't help me much. :-(
Output window - if NO memory leaks are posted there when your app exits then you don't have any memory leaks in code.
ps. Memory leaks usually don't result in a crash.
ps. Memory leaks usually don't result in a crash.
Okay we can still find where is the problem.
When it crashes can you follow the stack trace, can you post your code of QRawRecoveryThread ??
are you also doing something with FileDialog or FileView can you post that code too?.
You know what Best is if you can share your code or similar small example if due to some company popritery code isue you can not share original code.
i am sure I can help you.
When it crashes can you follow the stack trace, can you post your code of QRawRecoveryThread ??
are you also doing something with FileDialog or FileView can you post that code too?.
You know what Best is if you can share your code or similar small example if due to some company popritery code isue you can not share original code.
i am sure I can help you.
Looking at the code, it reminds me of some issues I had when creating a qt app mixed with GraphicsMagick.
Are you sure you aren't sending a NULL or invalid pointer into QImage?
Also if you are using the QFileView, I recommend changing to QFileSystemModel, subclassing it and catching the "data" requests for images, then create thumbs there. If you want it to not interfere with your main app, you have to thread out either the filesystemmodel and the thumb generator or only the thumbgenerator.
If you thread out the thumbgenerator, you have a scenario like this:
QFileSystemModel:: data -> requests image -> sends request to thread -> thread sets data on filesystem model when thumb is ready.
Are you sure you aren't sending a NULL or invalid pointer into QImage?
Also if you are using the QFileView, I recommend changing to QFileSystemModel, subclassing it and catching the "data" requests for images, then create thumbs there. If you want it to not interfere with your main app, you have to thread out either the filesystemmodel and the thumb generator or only the thumbgenerator.
If you thread out the thumbgenerator, you have a scenario like this:
QFileSystemModel:: data -> requests image -> sends request to thread -> thread sets data on filesystem model when thumb is ready.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
tryrvsvsvsv sttrte
If you use Visual C for developing then you do have a tool - run your app in DEBUG build and look at the output window when you close the app. Any memory leaks will be displayed there.