Hi Emanuele,

After poking around a bit, there seems to be a logical problem in Wine's
GDI code.  From the backtrace, SelectObject on this object calls
BRUSH_SelectObject, which uses a bitmap and eventually GetDIBits,
which tries to CreateCompatibleDC (or sometimes DeleteDC instead).
However, SelectObject always calls GDI_GetObjPtr, which calls
_EnterSysLevel and not _LeaveSysLevel.  But the CreateCompatibleDC
complains and dies if you have had an _EnterSysLevel and not a
_LeaveSysLevel.

It might be that BRUSH_SelectObject really should use a different set of
"internal" functions that won't complain about locking.  Or maybe
DeleteDC and CreateCompatibleDC should just increment the recursion level
instead of erroring out.  I don't know, so I'm forwarding to wine-devel
for greater insight.

- Walter

Here's a summary of the relevant part of my backtrace again:

1 _CheckNotSysLevel (complains!)
2 GDI_CheckNotLock
3 DeleteDC
4 GetDIBits
5 MFDRV_CreateBrushIndirect
6 MFDRV_SelectBrush
7 BRUSH_SelectObject
8 SelectObject - calls GDI_GetObjPtr, which does _EnterSysLevel.



On Thu, 28 Oct 2004, Emanuele Gissi wrote:

> Hi,
> I really did my best to understand how I can help improving Wine, but I did
> not succed.
>
> Well, everything started when I installed a win application on my Debian 3.1,
> Wine 2004.07.16 deb (clean install, no dlls).
>
> The application is ALOHA (http://www.epa.gov/ceppo/cameo/aloha.htm)
> It's a free application from US-Environment Protection Agency used for
> chemical emergency planning (I am an officer firefighter).
>
> On Wine it has a problem that prevents its wide use.
> After having entered all the needed data (or loading the included prova.alo
> example in "planning mode"), Wine crashes when tring to show the chemical
> footprint result.
>
> The application works perfectly on Codeweavers Crossover Office 3.0.1 (trial).
> And I am ready to buy it (as they support the free Wine, I think.)
>
> But I would like to understand why it does not work on Wine!
>
> The included log finishes with this:
> [...]
> warn:heap:HEAP_ValidateInUseArena Heap 40360000: invalid in-use arena magic
> for 403bd120
> warn:heap:HEAP_ValidateInUseArena Heap 40360000: invalid in-use arena magic
> for 403b46f0
> warn:heap:HEAP_ValidateInUseArena Heap 40360000: invalid in-use arena magic
> for 403b6948
> warn:heap:HEAP_ValidateInUseArena Heap 40360000: invalid in-use arena magic
> for 403b1570
> warn:heap:HEAP_ValidateInUseArena Heap 40360000: invalid in-use arena magic
> for 403b11c0
> warn:gdi:GDI_GetObjPtr Invalid handle (nil)
> warn:gdi:GDI_GetObjPtr Invalid handle (nil)
> warn:gdi:GDI_GetObjPtr Invalid handle (nil)
> err:syslevel:_CheckNotSysLevel Holding lock 0x408f15e0 level 3
> wine: Unhandled exception (thread 0009), starting debugger...
>
> 1) What should I do next time I encounter a similar problem with an app? That
> is: how to use winedbg?
> 2) Why does ALOHA work on Crossover and not on Wine?
> 3) Which are the main differences between Crossover and Wine?
> 4) Does Codewaver really contribute back to Wine?
>
> I thank you in advance.
>
> (Please, CC: me as I am not on the list for now)
> --
> Ing. Emanuele Gissi - Ispettore Antincendio
> Comando Provinciale dei Vigili del Fuoco di Ravenna
> viale Randi, 25 - 48100 Ravenna - Italia
> tel: 0544 281.501 - fax: 0544 281.531
>

Reply via email to