Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: SwitchToFiber call problem with cygwin_NT-5.2 ? test case below Date: Thu, 2 Dec 2004 18:31:29 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Rearick, Gabriele" To: "Rearick, Gabriele" , X-OriginalArrivalTime: 02 Dec 2004 23:31:30.0328 (UTC) FILETIME=[0D1C8180:01C4D8C7] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id iB2NVgu7023756 Hi all cygwin version: CYGWIN_NT-5.2 rearick3 1.5.12(0.116/4/2) 2004-11-10 08:34 amd64 unknown unknown Cygwin. I am uncertain if the platform above is an "officially supported" platform, but apparently the same problem behavior is exposed on officially supported environments, as it was indicated to me. The testcase below from Gengbin Zheng demonstrates a program hang/crash when envoking fibers (switchToFiber call). Might it be related to SP2 and/or version of win32api? cygcheck.out is attached. Can the issue be fixed or is there a fix already? thanks ------ name this file as fiber.c (note make it a C file, not C++) now compile it under VC++, it runs as expected. when compile with gcc: gcc -o fiber fiber.c It crashes at SwitchToFiber call. #include #include #include #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0400 #endif #if(_WIN32_WINNT >= 0x0400) typedef VOID (WINAPI *PFIBER_START_ROUTINE)( LPVOID lpFiberParameter ); typedef PFIBER_START_ROUTINE LPFIBER_START_ROUTINE; #endif #if(_WIN32_WINNT >= 0x0400) WINBASEAPI LPVOID WINAPI CreateFiber( DWORD dwStackSize, LPFIBER_START_ROUTINE lpStartAddress, LPVOID lpParameter ); WINBASEAPI VOID WINAPI DeleteFiber( LPVOID lpFiber ); WINBASEAPI LPVOID WINAPI ConvertThreadToFiber( LPVOID lpParameter ); WINBASEAPI VOID WINAPI SwitchToFiber( LPVOID lpFiber ); #endif /* _WIN32_WINNT >= 0x0400 */ /* thread entry */ VOID CALLBACK FiberSetUp(PVOID fiberData) { printf("HERE in fiber\n"); } int main() { LPVOID fiber; if (NULL==ConvertThreadToFiber(NULL)) { printf("ConvertThreadToFiber failed.\n"); exit(1); } fiber = CreateFiber(0, FiberSetUp, (void *) NULL); if (NULL == fiber) { printf("CreateFiber failed.\n"); exit(1); } printf("HERE before switch \n"); SwitchToFiber(fiber); } -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/