public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: "Diego Ruiz" <ruiz@tele.ucl.ac.be>
To: pthreads-win32@sourceware.org
Subject: working release test failed in debug mode
Date: Fri, 12 Jun 2009 13:00:00 -0000	[thread overview]
Message-ID: <af21ac78fa4748bfeac2b4bf04b37830.squirrel@mmp.sipr-dc.ucl.ac.be> (raw)
In-Reply-To: <58344da04430a2f0b57d52a9e514b98d.squirrel@mmp.sipr-dc.ucl.ac.be>


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).







       reply	other threads:[~2009-06-12 13:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <58344da04430a2f0b57d52a9e514b98d.squirrel@mmp.sipr-dc.ucl.ac.be>
2009-06-12 13:00 ` Diego Ruiz [this message]
2009-06-12 16:09   ` Geoff McLane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=af21ac78fa4748bfeac2b4bf04b37830.squirrel@mmp.sipr-dc.ucl.ac.be \
    --to=ruiz@tele.ucl.ac.be \
    --cc=pthreads-win32@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).