From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29395 invoked by alias); 12 Jun 2009 13:00:52 -0000 Received: (qmail 29380 invoked by uid 22791); 12 Jun 2009 13:00:50 -0000 X-SWARE-Spam-Status: No, hits=1.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtpout.sgsi.ucl.ac.be (HELO smtp4.sgsi.ucl.ac.be) (130.104.5.77) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Jun 2009 13:00:46 +0000 Received: from mail.sgsi.ucl.ac.be (mmp-2-1.sipr-dc.ucl.ac.be [10.1.3.2]) by smtp4.sgsi.ucl.ac.be (Postfix) with ESMTP id 27814F2226 for ; Fri, 12 Jun 2009 15:00:44 +0200 (CEST) Received: from 81.243.241.161 (SquirrelMail authenticated user druiz) by mmp.sipr-dc.ucl.ac.be with HTTP; Fri, 12 Jun 2009 15:00:36 +0200 (CEST) Message-ID: In-Reply-To: <58344da04430a2f0b57d52a9e514b98d.squirrel@mmp.sipr-dc.ucl.ac.be> References: <58344da04430a2f0b57d52a9e514b98d.squirrel@mmp.sipr-dc.ucl.ac.be> Date: Fri, 12 Jun 2009 13:00:00 -0000 Subject: working release test failed in debug mode From: "Diego Ruiz" To: pthreads-win32@sourceware.org User-Agent: SquirrelMail/1.4.17 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SGSI-MailScanner-ID: 27814F2226.00000 X-SGSI-MailScanner: Found to be clean X-SGSI-SpamCheck: n'est pas un polluriel, SpamAssassin (not cached, score=-3.399, requis 5, autolearn=not spam, ALL_TRUSTED -1.80, BAYES_00 -1.60) X-SGSI-From: ruiz@tele.ucl.ac.be X-SGSI-Spam-Status: No X-IsSubscribed: yes Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org X-SW-Source: 2009/txt/msg00028.txt.bz2 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 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).