Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 444
  • Last Modified:

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 :-)
0
davinder101
Asked:
davinder101
  • 5
  • 3
  • 2
  • +1
1 Solution
 
AndyAinscowCommented:
>>memory leak detection tools

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.
0
 
irfan_omairCommented:
you can easily find call stack, can you post your call stack when it crashes
0
 
davinder101Author Commented:
      qgifd4.dll!10003686()       
       [Frames below may be incorrect and/or missing, no symbols loaded for qgifd4.dll]      
>      QtCored4.dll!qAtomicSetPtr<QByteArray::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::operator=(const QByteArray & other={...})  Line 795 + 0x8 bytes      C++
       qgifd4.dll!10007b68()       
       qgifd4.dll!10004845()       
       ntdll.dll!7c9101db()       
       QtGuid4.dll!QImageReader::read(QImage * image=0x0013d4bc)  Line 977 + 0x21 bytes      C++
       QtGuid4.dll!QImageReader::read()  Line 921 + 0xc bytes      C++
       QtGuid4.dll!QImage::fromData(const unsigned char * data=0x03d93f78, int size=59904, const char * format=0x00000000)  Line 4123 + 0x3a bytes      C++
       QtGuid4.dll!QImage::loadFromData(const unsigned char * data=0x03d93f78, int len=59904, const char * format=0x00000000)  Line 4087 + 0x15 bytes      C++
       StellarPhoenixPhotoRecovery.exe!QFileView::GetItemPreview(void * DosDir=0x01a1f638)  Line 1884      C++
       StellarPhoenixPhotoRecovery.exe!QFileView::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=10, void * * _a=0x0013dae8)  Line 157 + 0x11 bytes      C++
       QtCored4.dll!QMetaObject::activate(QObject * sender=0x01280f80, int from_signal_index=11, int to_signal_index=11, void * * argv=0x0013dae8)  Line 3066 + 0x46 bytes      C++
       QtCored4.dll!QMetaObject::activate(QObject * sender=0x01280f80, const QMetaObject * m=0x0071b8fc, int local_signal_index=0, void * * argv=0x0013dae8)  Line 3125 + 0x15 bytes      C++
       StellarPhoenixPhotoRecovery.exe!QRawRecoveryThread::GetFilePreview(void * _t1=0x01a1f638)  Line 117 + 0x15 bytes      C++
       StellarPhoenixPhotoRecovery.exe!QRawRecoveryThread::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=0, void * * _a=0x00fcc028)  Line 91 + 0x11 bytes      C++
       QtCored4.dll!QMetaCallEvent::placeMetaCall(QObject * object=0x01280f80)  Line 522      C++
       QtCored4.dll!QObject::event(QEvent * e=0x02082c90)  Line 1107 + 0x14 bytes      C++
       QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver=0x01280f80, QEvent * e=0x02082c90)  Line 3541 + 0x11 bytes      C++
       QtGuid4.dll!QApplication::notify(QObject * receiver=0x01280f80, QEvent * e=0x02082c90)  Line 3100 + 0x10 bytes      C++
       QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver=0x01280f80, QEvent * event=0x02082c90)  Line 516      C++
       QtCored4.dll!QCoreApplication::sendEvent(QObject * receiver=0x01280f80, QEvent * event=0x02082c90)  Line 185 + 0x39 bytes      C++
       QtCored4.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver=0x00000000, int event_type=0, QThreadData * data=0x00f17e78)  Line 1102 + 0xd bytes      C++
       QtCored4.dll!QCoreApplication::sendPostedEvents(QObject * receiver=0x00000000, int event_type=-1)  Line 987 + 0x11 bytes      C++
       QtCored4.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Line 432 + 0x24 bytes      C++
       QtGuid4.dll!QGuiEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Line 975 + 0x15 bytes      C++
       QtCored4.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Line 126      C++
       QtCored4.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Line 171 + 0x2d bytes      C++
       QtCored4.dll!QCoreApplication::exec()  Line 744 + 0x15 bytes      C++
       QtGuid4.dll!QApplication::exec()  Line 3039      C++
       StellarPhoenixPhotoRecovery.exe!main(int argc=1, char * * argv=0x00f16870)  Line 30 + 0x6 bytes      C++
       StellarPhoenixPhotoRecovery.exe!WinMain(HINSTANCE__ * instance=0x00400000, HINSTANCE__ * prevInstance=0x00000000, char * __formal=0x00181f4d, int cmdShow=1)  Line 103 + 0x12 bytes      C++
       StellarPhoenixPhotoRecovery.exe!__tmainCRTStartup()  Line 578 + 0x35 bytes      C
       StellarPhoenixPhotoRecovery.exe!WinMainCRTStartup()  Line 403      C
       kernel32.dll!7c817077()       
       StellarPhoenixPhotoRecovery.exe!__strrev()  + 0x1b2a9 bytes      
       StellarPhoenixPhotoRecovery.exe!Ui_FileViewDialog::setupUi(QDialog * FileViewDialog=0x005c003a)  Line 80 + 0x7 bytes      C++
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
irfan_omairCommented:
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?
0
 
davinder101Author Commented:
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.  
0
 
davinder101Author Commented:
thanks andy for replying but answer did't help me much. :-(
0
 
AndyAinscowCommented:
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.
0
 
irfan_omairCommented:
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.
0
 
luufCommented:
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.



0
 
davinder101Author Commented:
Hi guys
               sorry for replying late, here i'm posting the portion of code where it's geting crashed for some images(i found crash for some of gif images).when i blocked the gif images it's working fine.  i'm using Qt 4.3.4. And i can't post more code becase of company policy. So please do needful.

if(pBuff != NULL)
image.loadFromData(pBuff+nbyte,SizeToRead,(const char*)qstrdup(strFormat.toLatin()));

            
0
 
davinder101Author Commented:
tryrvsvsvsv  sttrte
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now