This is the mail archive of the pthreads-win32@sourceware.org mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

working release test failed in debug mode


Hello,

I manage to test a very small example in release mode. However the same
example crashes in debug mode.

Thanks for any help or idea
Diego

Ps: I am new to windows. I need to port my application from ubuntu to
visual studio.


Microsoft Visual Studio 2005
New project -> WIN32 -> WIN32 Console application (name Hello)

?	Added #include <pthread.h> to stdafx.h
?	Changed Hello.cpp:
#include "stdafx.h"

 pthread_mutex_t mutex_bigbag   = PTHREAD_MUTEX_INITIALIZER;

/*! This program test compilation with the pthread library on windows */
int _tmain(int argc, _TCHAR* argv[])
{

    printf("hello\n");
    getchar();
    getchar();

    pthread_mutex_lock( &mutex_bigbag );

    pthread_mutex_unlock(&mutex_bigbag);

    return 0;
}

?	QueueUserAPCEx:
- Copy the driver and reboot as explained in the README file of directory
- Copying the dll  (QuserEx.dll, QuserEx.lib) in working directory of
solution (release, debug)
- Copying the lib in an usefull_libs directory
- using "net start alertdrv" in command prompt (cmd) in administrator mode

?	pthreads.2:
- programs-> Visual studio -> visual studio tools -> VS command prompt
- cd directory of pthreads.2
- nmake clean VCE-inlined
- copy the created dll in working directory of solution (release, debug)
- copy of the library in usefull_libs directory

?	Test 1 in realease mode
- Added path to inlcludes (pthread.h)
- Added path to library in linker (usefull_libs)
- Added library dependency in linker (pthreadVCE2.lib quserex.lib)
- Compilation OK (0 errors, 0 warnings)
- Test OK (prints hello and wait for char in terminal)

?	Test in debug mode

- Added path to inlcludes (pthread.h)
- Added path to library in linker (usefull_libs)
- Added library dependency in linker (pthreadVCE2.lib quserex.lib)
- Compilation OK (0 errors, 0 warnings)
- Test KO:

'Hello.exe': Loaded 'C:\Users\ruiz\Documents\Visual Studio
2005\Projects\Tests\Hello\debug\Hello.exe', Symbols loaded.
'Hello.exe': Loaded 'C:\WINDOWS\System32\ntdll.dll', No symbols loaded.
'Hello.exe': Loaded 'C:\WINDOWS\System32\kernel32.dll', No symbols loaded.
'Hello.exe': Loaded 'C:\Users\ruiz\Documents\Visual Studio
2005\Projects\Tests\Hello\debug\pthreadVCE2.dll', Symbols loaded.
'Hello.exe': Loaded 'C:\Users\ruiz\Documents\Visual Studio
2005\Projects\Tests\Hello\debug\msvcr80.dll', No symbols loaded.
'Hello.exe': Loaded 'C:\WINDOWS\System32\msvcrt.dll', No symbols loaded.
'Hello.exe': Loaded 'C:\WINDOWS\System32\wsock32.dll', No symbols loaded.
'Hello.exe': Loaded 'C:\WINDOWS\System32\ws2_32.dll', No symbols loaded.
'Hello.exe': Loaded 'C:\WINDOWS\System32\advapi32.dll', No symbols loaded.
'Hello.exe': Loaded 'C:\WINDOWS\System32\rpcrt4.dll', No symbols loaded.
'Hello.exe': Loaded 'C:\WINDOWS\System32\nsi.dll', No symbols loaded.
'Hello.exe': Loaded
'C:\WINDOWS\winsxs\x86_microsoft.vc80.debugcrt_1fc8b3b9a1e18e3b_8.0.50727.762_none_24c8a196583ff03b\msvcr80d.dll',
Symbols loaded.
'Hello.exe': Loaded 'C:\WINDOWS\System32\user32.dll', No symbols loaded.
'Hello.exe': Loaded 'C:\WINDOWS\System32\gdi32.dll', No symbols loaded.
'Hello.exe': Loaded 'C:\WINDOWS\System32\imm32.dll', No symbols loaded.
'Hello.exe': Loaded 'C:\WINDOWS\System32\msctf.dll', No symbols loaded.
'Hello.exe': Loaded 'C:\WINDOWS\System32\lpk.dll', No symbols loaded.
'Hello.exe': Loaded 'C:\WINDOWS\System32\usp10.dll', No symbols loaded.
'Hello.exe': Loaded 'C:\WINDOWS\System32\APSHook.dll', Binary was not
built with debug information.
First-chance exception at 0x77943387 in Hello.exe: 0xC0000005: Access
violation writing location 0x00000014.
R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contact the application's support team for more information.
Windows has triggered a breakpoint in Hello.exe.

This may be due to a corruption of the heap, and indicates a bug in
Hello.exe or any of the DLLs it has loaded.

The output window may have more diagnostic information
First-chance exception at 0x77909cac in Hello.exe: 0xC0000142: DLL
Initialization Failed.
Unhandled exception at 0x77909cac in Hello.exe: 0xC0000142: DLL
Initialization Failed.
Hello.exe has triggered a breakpoint
First-chance exception at 0x769e8f21 in Hello.exe: 0xC0000005: Access
violation reading location 0x769e8f21.


 *** A stack buffer overrun occurred in "c:\users\ruiz\documents\visual
studio 2005\projects\tests\hello\debug\Hello.exe" :

This is usually the result of a memory copy to a local buffer or structure
where the size is not properly calculated/checked.
If this bug ends up in the shipping product, it could be a severe security
hole.
The stack trace should show the guilty function (the function directly
above __report_gsfailure).
 *** enter .exr 779C9320 for the exception record
 *** then kb to get the faulting stack

Windows has triggered a breakpoint in Hello.exe.

This may be due to a corruption of the heap, and indicates a bug in
Hello.exe or any of the DLLs it has loaded.

The output window may have more diagnostic information
Windows has triggered a breakpoint in Hello.exe.

This may be due to a corruption of the heap, and indicates a bug in
Hello.exe or any of the DLLs it has loaded.

The output window may have more diagnostic information
The program '[5584] Hello.exe: Native' has exited with code -1073740791
(0xc0000409).








Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]