Win32/64: run pavuk without args --> crash
Brought to you by:
stoecker
pavuk reports crash with access to a pointer value 0x00000010 (clearly a bad pointer) after printing the help text.
Turns out it crashes within the pthreadWin32 library, but somehow this doesn't look like a pthread problem to me. Running pavuk with a URL to grab does not crash the app at the end.
:-(
@#$%^&*( now can I assign this bug or what?! (Bloody SF)
Problem is due to PTW32_STATIC_LIB define in the project settings, while those same projects use the DLL version of the pthreadsW32 library. Whoops.
PTW32_STATIC_LIB define removed from the project settings: no more crash.
So that means the pthredWin32 'static use' exit/cleanup code is called before we destroy those semaphores (because that's where pavuk crashes: while destroying running_sem)
Fixed by two changes: removed the PTW32_STATIC_LIB define in all MSVC2005 project files as those use the DLL version of the pthread-win32 lib anyway.
Also moved the pthread cleanup calls, needed for when compiling with the static lib, AFTER the mt_cleanup() call, which, under the hood, would call several pthread APIs to cleanup semaphores.