farbrausch / fr_public

Farbrausch demo tools 2001-2011
3.37k stars 344 forks source link

WZ4 Bug: Can't unload wz4 process from system memory #27

Closed Skinnytorus closed 12 years ago

Skinnytorus commented 12 years ago

Hi, At last, I managed to compile the latest wz4 build. The problem is that wz4 process stays in the process list after I close the app and won't close even if I try to forcibly close it... Only reboot helps :)) The same goes for the initially released bin exe. I run Win7 64. Can it be fixed? Thank you.

rygorous commented 12 years ago

That shouldn't happen (and in fact doesn't happen here). Can you run a debug Wz4 build in the debugger and see where it gets stuck?

Skinnytorus commented 12 years ago

Do you mean that I should press F5 in VS and see what's going on after i quit the program? The GUI window quits OK, but the process stays in memory as if exit function does not affect the rest of the program. Though I managed to save wz4 process memory dump after I quit. Is it of any use?

Please, unerstand, I'm a total noob to programming :)) What do you mean mentioning 'debug build'? All my wz4 builds say that they are (DEBUG) in windows header :) Besides, the supplied exe behaves exactly in the same manner...

By the way wz3 doesn't have this issue (process unloads ok). Do you use the same exit procedure in wz4? Maybe access rights issues involved?...

rygorous commented 12 years ago

No, more likely some driver problem. Sigh. If you don't know how to use a debugger this is going to be difficult.

In VS, it should say "debug_dx9" somewhere below the menu bar. That's the solution configuration. You can select other configurations ("debugfast_dx9", "stripped_dx11" and so forth) but debug_dx9 is the right one to use for this. Press F5 to start with debugger attached. Then just exit. Then, from the "Debug" menu, click "Break" and sent me a screen shot of the "Call stack" window for the "main" thread (double-click on the right Thread in the "Threads" window to get this). That should at least get me started...

Skinnytorus commented 12 years ago

OK. Done. Here is the Call stack for debug_dx9.

Edit. Sorry. That is for the Main thread:

ntdll.dll!7767f8b1()    
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] 
ntdll.dll!7767f8b1()    
KernelBase.dll!75090a91()   
wdmaud.drv!6bfd3b57()   
wdmaud.drv!6bfd1d71()   
wdmaud.drv!6bfd14ab()   
winmm.dll!722af85c()    

werkkzeug4.exe!sMidiHandlerWin::~sMidiHandlerWin() Line 192 + 0x24 bytes C++ werkkzeug4.exe!sMidiHandlerWin::`scalar deleting destructor'() + 0x2b bytes C++ werkkzeug4.exe!sExitMidi() Line 224 + 0x36 bytes C++ werkkzeug4.exe!sSetRunlevel(int priority) Line 192 + 0x10 bytes C++ werkkzeug4.exe!MsgProc(HWND * win, unsigned int msg, unsigned int wparam, long lparam) Line 1903 + 0xa bytes C++ user32.dll!754162fa()
user32.dll!75416d3a()
user32.dll!75416ce9()
user32.dll!75416de8()
user32.dll!75416e44()
ntdll.dll!7767010a()
user32.dll!75419a6a()
werkkzeug4.exe!WinMain(HINSTANCE
* inst, HINSTANCE * formal, HINSTANCE * formal, HINSTANCE * formal) Line 2677 + 0xe bytes C++ 90900004()

rygorous commented 12 years ago

On 4/30/2012 10:02 PM, Skinnytorus wrote:

OK. Done. Here is the Call stack for debug_dx9.

ntdll.dll!7767fd71()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!7767fd71()
KernelBase.dll!750931bb()
KernelBase.dll!75093a8b()

werkkzeug4.exe!sSleep(int ms) Line 3477 + 0xc bytes C++ werkkzeug4.exe!sPollInput(sThread * thread, void * data) Line 211 + 0x7 bytes C++ werkkzeug4.exe!sThreadTrunk(void * ptr) Line 3488 + 0x15 bytes C++ kernel32.dll!7565339a()
ntdll.dll!77699ef2()
ntdll.dll!77699ec5()

Hmm no, that's not the main thread, that's the input thread :) You need to double-click on the main thread (usually the first one in the list) in the "Threads" window first.

Skinnytorus commented 12 years ago

Do you need my debug output?

Skinnytorus commented 12 years ago

I've edited my call stack comment. Now it's Main. Please take a look.

rygorous commented 12 years ago

On 4/30/2012 10:28 PM, Skinnytorus wrote:

Do you need my debug output?

Can't hurt.

-Fabian

Skinnytorus commented 12 years ago

So, here it is.

'werkkzeug4.exe': Loaded 'E:\Temp\FR_SVN\altona_wz4\wz4\werkkzeug4\debug_dx9_Win32\werkkzeug4.exe', Symbols loaded. 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\avifil32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\msacm32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\msvfw32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\secur32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\wininet.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\normaliz.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\iertutil.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\urlmon.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\psapi.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\glu32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\opengl32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\ddraw.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\dciman32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\dsound.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\powrprof.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\dinput8.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\comdlg32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\d3d9.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\d3d8thk.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\D3DX9_43.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\D3DCompiler_43.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\apphelp.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\guard32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\fltLib.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Unloaded 'C:\Windows\SysWOW64\apphelp.dll' [mem] initialize memory leak tracker [mem] MEMORY MAP: [mem] 01: 00000000..00000000 (0b) 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Program Files (x86)\Common Files\microsoft shared\ink\tiptsf.dll', Cannot find or open the PDB file [sys] init 0x01 EventQueue [sys] init 0x10 GarbageCollector [sys] init 0x11 Message [sys] init 0x11 StringPool [sys] init 0x18 Math [sys] init 0x20 FileHandlers [sys] init 0x28 RootFileHandler [sys] init 0x30 Input 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\clbcatq.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\oleacc.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\nvd3dum.dll', Cannot find or open the PDB file [gfx] init d3d 1280 x 768 [gfx] caps.AdapterName NVIDIA GeForce GTX 590 [gfx] caps.Flags 00000002 [gfx] caps.MaxMultisampleLevel 8 [gfx] caps.ShaderProfile 0103 [gfx] caps.Texture2D 0000001ca801fffe [gfx] caps.TextureCube 00000010a801fffe [gfx] caps.TextureRT 00000000000017fa [gfx] caps.VertexTex2D 00000000000007e2 [gfx] caps.VertexTexCube 00000000000007e2 [dev] register raw input: 1 [sys] init 0x80 StealingTaskScheduler [sys] init 0x80 GlobalBlobHeap [sys] init 0x81 midi 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\MMDevAPI.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\propsys.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\wdmaud.drv', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\ksuser.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\avrt.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\AudioSes.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\msacm32.drv', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\midimap.dll', Cannot find or open the PDB file [midi] midi in 0 = "Delta AP MIDI" [midi] midi in 1 = "Automap MIDI" [midi] midi in 2 = "Automap Propellerhead" [midi] midi in 3 = "Automap HUI" [midi] midi in 4 = "Pro24DSP MIDI" [midi] midi out 0 = "Microsoft GS Wavetable Synth" [midi] midi out 1 = "Delta AP MIDI" [midi] midi out 2 = "Automap MIDI" [midi] midi out 3 = "Automap Propellerhead" [midi] midi out 4 = "Automap HUI" [midi] midi out 5 = "Pro24DSP MIDI" [sys] init 0x88 GDI [sys] init 0xa0 DirectInput 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\hid.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\wintrust.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\crypt32.dll', Cannot find or open the PDB file 'werkkzeug4.exe': Loaded 'C:\Windows\SysWOW64\msasn1.dll', Cannot find or open the PDB file [sys] init 0xa0 JoypadManager [sys] init 0xa1 DirectInputJoypad [sys] init 0xb0 Sound [sys] init 0xc0 LayoutPool [sys] init 0xc0 sRTMan flush resources 0 img 1 fonts 0 text [file] open file for read [file] failed to open file <> for read [file] File not Found <> [gfx] init d3d 1920 x 1028 [gfx] restoring device [gfx] caps.AdapterName NVIDIA GeForce GTX 590 [gfx] caps.Flags 00000002 [gfx] caps.MaxMultisampleLevel 8 [gfx] caps.ShaderProfile 0103 [gfx] caps.Texture2D 0000001ca801fffe [gfx] caps.TextureCube 00000010a801fffe [gfx] caps.TextureRT 00000000000017fa [gfx] caps.VertexTex2D 00000000000007e2 [gfx] caps.VertexTexCube 00000000000007e2 [file] failed to open file <c:/svn/farbrausch/wz4frwiki/presets/Wz4Mesh_Cube_default.preset> for read [file] File not Found <c:/svn/farbrausch/wz4frwiki/presets/Wz4Mesh_Cube_default.preset> [file] open file <E:\Temp\FR_SVN\altona_wz4\wz4\werkkzeug4/config_wz4> for write The thread 'Win32 Thread' (0x91c) has exited with code 0 (0x0). The thread 'Win32 Thread' (0x1030) has exited with code 0 (0x0). The thread 'Win32 Thread' (0x1074) has exited with code 0 (0x0). The thread 'Win32 Thread' (0x4c4) has exited with code 0 (0x0). [sys] exit 0xc0 LayoutPool [sys] exit 0xc0 sRTMan [sys] exit 0xb0 Sound The thread 'Win32 Thread' (0xf58) has exited with code 0 (0x0). [sys] exit 0xa1 DirectInputJoypad [sys] exit 0xa0 DirectInput [sys] exit 0xa0 JoypadManager [sys] exit 0x88 GDI [sys] exit 0x81 midi The program '[1612] werkkzeug4.exe: Native' has exited with code 0 (0x0).

rygorous commented 12 years ago

Hm. It gets stuck in ntdll trying to close MIDI driver handles. Awesome. I definitely can't remote-debug this easily. However, I can just disable MIDI support (which is not wired up right now anyway) and work around this issue entirely - which I just did with the last checkin (binaries included). Try whether this fixes your problem.

Skinnytorus commented 12 years ago

huge thanks, ryg. Now it 'unloads' like a charm. in fact, MIDI support is not the only thing wz4 was built for, is it? :)