Solved

debugging crash in windows application

Posted on 2011-02-28
11
404 Views
Last Modified: 2012-05-11
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
Comment
Question by:davinder101
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 34999401
>>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
 
LVL 7

Expert Comment

by:irfan_omair
ID: 34999751
you can easily find call stack, can you post your call stack when it crashes
0
 

Author Comment

by:davinder101
ID: 35006258
      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
 
LVL 7

Expert Comment

by:irfan_omair
ID: 35007971
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
 

Author Comment

by:davinder101
ID: 35017698
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:davinder101
ID: 35017714
thanks andy for replying but answer did't help me much. :-(
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 35017817
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
 
LVL 7

Expert Comment

by:irfan_omair
ID: 35020486
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
 

Expert Comment

by:luuf
ID: 35109696
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
 

Accepted Solution

by:
davinder101 earned 0 total points
ID: 35178342
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
 

Author Closing Comment

by:davinder101
ID: 37589125
tryrvsvsvsv  sttrte
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Problem: You created a new custom form in Outlook for your contacts (added fields, deleted fields, changed the layout of fields, whatever) and made it the default form for contacts. The good news is that all new contacts will utilize the new form. T…
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now