PDA

View Full Version : Unhandled exception in qatomic



NewGuy
22nd July 2006, 10:52
've decided to make a text searching utility in Qt as an excercise. I have a problem however. I've just reformatted my computer, and I took a backup of my Visual Studio projects. Now when I try to exit my application by the X in the upper right corner I get this message for Visual Studio:
"Unhandled exception at 0x004044e9 in Qt Text Searcher.exe: 0xC0000005: Access violation writing location 0xfeeefeee."
Visual Studio also says CX0030: Error: Expression cannot be evaluated

Visual Studio then points me to the following line in qatomic.h:
"{ return _InterlockedDecrement(reinterpret_cast<volatile long *>(ptr)); }"

How can I help this? To my knowing I have not used any Atomic counters (I am not even sure what it is)

wysota
22nd July 2006, 11:09
Did you recompile your application after reformatting? Also check if all examples bundled with Qt work ok.

NewGuy
22nd July 2006, 17:34
Yes I did recompile. The examples bundled with works fine

jacek
22nd July 2006, 17:53
Could you post the backtrace?

NewGuy
22nd July 2006, 19:11
backtrace? I can upload the whole project if that would help. It's about 9 MB large

wysota
22nd July 2006, 19:21
No, we definitely prefer a backtrace, it'll only be few lines long :)

NewGuy
22nd July 2006, 21:45
Ah well then, what is a backtrace? :)

wysota
23rd July 2006, 00:09
A backtrace is... a backtrace :) Also called a call stack or stack trace or whatever. It is a list of function calls that led to the crash. A debugger produces it.

NewGuy
23rd July 2006, 12:13
Hmm I guess this is a backtrace then :)

'Qt Text Searcher.exe': Loaded 'H:\My Documents\Visual Studio 2005\Projects\Qt Text Searcher\debug\Qt Text Searcher.exe', Symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\Qt\4.1.1\bin\QtCored4.dll', Symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc 8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcp80d.dll', Symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc 8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcr80d.dll', Symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\Qt\4.1.1\bin\QtGuid4.dll', Symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\comdlg32.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\shell32.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\imm32.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\winmm.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\winspool.drv', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\msctf.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols loaded.
'Qt Text Searcher.exe': Unloaded 'C:\WINDOWS\system32\version.dll'
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\msctfime.ime', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\usp10.dll', No symbols loaded.
'Qt Text Searcher.exe': Loaded 'C:\WINDOWS\system32\xpsp2res.dll', Binary was not built with debug information.
'Qt Text Searcher.exe': Loaded 'C:\Program Files\Internet Download Manager\idmmkb.dll', Binary was not built with debug information.
First-chance exception at 0x00404559 in Qt Text Searcher.exe: 0xC0000005: Access violation writing location 0xfeeefeee.
Unhandled exception at 0x00404559 in Qt Text Searcher.exe: 0xC0000005: Access violation writing location 0xfeeefeee.
The program '[2600] Qt Text Searcher.exe: Native' has exited with code 0 (0x0).

[EDIT] What the hell?!? Why does the application load Internet Download Manager?

jpn
23rd July 2006, 12:33
In VS2005: "Debug->Windows->Call Stack", select all, copy and paste here.. ;)

wysota
23rd July 2006, 12:36
Hmm I guess this is a backtrace then :)

No, it's not :) This is a log of loading symbols from imported libraries into the debugger.

jacek
23rd July 2006, 14:03
What the hell?!? Why does the application load Internet Download Manager?
Maybe it's some kind of trojan or spyware? Try AdAware (http://www.lavasoft.com/software/adaware/).

NewGuy
23rd July 2006, 14:45
Right, this should be a backtrace then :)

> Qt Text Searcher.exe!q_atomic_decrement(volatile int * ptr=0xfeeefeee) Line 137 + 0x9 bytes C++

Qt Text Searcher.exe!QBasicAtomic::deref() Line 71 + 0x10 bytes C++

Qt Text Searcher.exe!QVector<char *>::~QVector<char *>() Line 72 + 0x1b bytes C++

Qt Text Searcher.exe!WinMain(HINSTANCE__ * instance=0xfeeefeee, HINSTANCE__ * prevInstance=0xfeeefeee, char * __formal=0xfeeefeee, int cmdShow=-17891602) Line 104 + 0xe bytes C++
feeefeee()

jacek
23rd July 2006, 15:04
Right, this should be a backtrace then
Yes, that's it.

The problem occurs in QVector<char *> destructor that is invoked from main() on line 104. Do you know which QVector<char *> this might be? Maybe you are deleting something twice?

pioneer_fei
23rd July 2013, 10:49
I may be find the solution,or not.

Goto C:\WINDOWS\system32,and change the name of xpsp2res.dll to others for invalid the xps services.
And clear the windows memory using "360åŠ é€Ÿçƒ".

In Visual Studio 2010, press F5.
All is fine.