Dee Ayy
2008-Aug-25 01:36 UTC
[Wine] Please die if you wait "too long" RtlpWaitForCriticalSection
I'm receiving the following error in a custom app: err:ntdll:RtlpWaitForCriticalSection section 0x110048 "heap.c: main process heap section" wait timed out in thread 001a, blocked by 001c, retrying (60 sec) wine: Critical section 00110048 wait failed at address 0x7bc3ad00 (thread 001a), starting debugger... err:ntdll:RtlpWaitForCriticalSection section 0x110048 "heap.c: main process heap section" wait timed out in thread 001a, blocked by 001c, retrying (60 sec) err:seh:raise_exception Unhandled exception code c0000194 flags 0 addr 0x7bc3ad00 I hoped an upgrade to 1.1.3 would fix it but I still get the error. This post http://www.winehq.org/pipermail/wine-devel/2003-January/013670.html seems to confirm that it is just a thread that is waiting. And google reports that many professional apps also have this error. This is for a time dependent application. If the thread waits too long, say 5 seconds, then I'd really just appreciate if it would die rather than continue to wait. Can I tell the thread to die if it waits too long? And my time limit, not 60 sec? A scarier problem may be that any future thread will also fail if somehow some critical section is not being flagged as released/unlocked. How can I insure that it gets unlocked? In fact, how can I find out where this critical section is so that I might control locks? I would guess here that I need winedbg, but how would I debug my time-dependent app? Apparently I need to handle some exception? With gdb for C (even for a time dependent app), I compile with "cc -g", wait for a core dump, use gdb myApp core, then type "where". But the wine app is in C++. I don't know how important this is, but I could swear that my exe complained about ntdll.dll missing, so I dropped in the MS version in the exe directory and placated that. I found something yesterday that said the native ntdll.dll should never be used. So I removed it (or rather renamed it), and I don't get the complaint about ntdll that I thought I recalled a long while ago about needing it, but I still get the RtlpWaitForCriticalSection error. Thanks.
Dee Ayy
2008-Aug-27 05:37 UTC
[Wine] Please die if you wait "too long" RtlpWaitForCriticalSection
On Sun, Aug 24, 2008 at 8:36 PM, Dee Ayy <dee.ayy at gmail.com> wrote:> I'm receiving the following error in a custom app: > > err:ntdll:RtlpWaitForCriticalSection section 0x110048 "heap.c: main > process heap section" wait timed out in thread 001a, blocked by 001c, > retrying (60 sec)Ahh, the heap.c seems to be from ::HeapFree http://msdn.microsoft.com/en-us/library/aa366701(VS.85).aspx This is now a C++ question. What's wrong with this code? I'm only calling ::HeapFree if I have a valid pointer on which to call it, no? A window message is handled with this code, and I would expect that it is the only window message being processed at this time. If that is not the case, is there a way to "ensure serialized access" at this point? I did not write GetTradeRecords. For example, Java has a "synchronized" block level command that I could just enclose the code below into a code block. if (g_pTrades != NULL) ::HeapFree(hHeap, 0, g_pTrades); BriefUserInfo bui; ::ZeroMemory(&bui, sizeof(bui)); int g_nTrades = 0; std::string str; std::string symbol; g_pTrades = apiPumping.GetTradeRecords(&bui, &g_nTrades); ... if (g_pTrades != NULL) ::HeapFree(hHeap, 0, g_pTrades); //Mental note: Add more debug assertions.