problem with native dll's.

Rein Klazes rklazes at
Fri Apr 20 09:23:59 CDT 2001


Since the cvs commits early this week or the last (I could be more
precise but that will take a while) I have noticed a problem with some
native dlls. 
If I start one app that uses such a dll and then another using the
same dll may crash. If this second app is started as the first process
it runs fine.
As an example eudora, using native commctrl/comctl32 crashes when it
loads these dlls:

| Unhandled exception: priviledged instruction
|  in 32-bit code (0x406e12b8).
| In 32-bit mode.
| 0x406e12b8 (GetTextColor+0x34 [dcvalues.c:177]): hlt	
| 177	DC_GET_VAL( COLORREF, GetTextColor, textColor )
| Wine-dbg>bt
| Backtrace:
| =>0 0x406e12b8 (GetTextColor+0x34(hdc=0x0) [dcvalues.c:177]) (ebp=405b6dc4)
|   1 0xbfebbd8d (COMCTL32.DLL.341+0x74) (ebp=405b6dd8)
|   2 0xbfebbceb (COMCTL32.DLL.EntryPoint+0x36) (ebp=405b6e04)
|   3 0x4008abe3 (MODULE_InitDLL+0x97(wm=0x40383d84, type=0x1, lpReserved=0x1) [module.c:115]) (ebp=405b6e24)
|   4 0x4008acf1 (MODULE_DllProcessAttach+0xd1(wm=0x40383d84, lpReserved=0x1) [module.c:182]) (ebp=405b6e48)
|   5 0x4008accd (MODULE_DllProcessAttach+0xad(wm=0x403838f4, lpReserved=0x1) [module.c:177]) (ebp=405b6e68)
|   6 0x4008accd (MODULE_DllProcessAttach+0xad(wm=0x4038302c, lpReserved=0x1) [module.c:177]) (ebp=405b6e88)
|   7 0x4008accd (MODULE_DllProcessAttach+0xad(wm=0x403826f8, lpReserved=0x1) [module.c:177]) (ebp=405b6ea8)
|   8 0x4008accd (MODULE_DllProcessAttach+0xad(wm=0x0, lpReserved=0x1) [module.c:177]) (ebp=405b6ec8)
|   9 0x400d288f (start_process+0x133 [process.c:373]) (ebp=405b6f30)
|   10 0x400d5f99 (SYSDEPS_DoCallOnStack+0x25(func=0x400d275c, arg=0x0) [sysdeps.c:173]) (ebp=405b6ff0)
|   11 0x400d603f (SYSDEPS_CallOnStack+0x2f) (ebp=bffff8d4)
|   12 0x400d60e2 (SYSDEPS_SwitchToThreadStack+0x8e(func=0x400d275c) [sysdeps.c:236]) (ebp=bffff908)
|   13 0x400d2c5d (PROCESS_InitWine+0x1a1(argc=0x5, argv=0xbffff9a4, win16_exe_name=0x804d5c0, win16_exe_file=0x804d6c4) [process.c:524]) (ebp=bffff924)
|   14 0x0804c164 (Letext [main.c]) (ebp=bffff93c)
|   15 0x4028116b (NTDLL.DLL.sqrt+0x3bc6b) (ebp=bffff978)
|   16 0x08049021 (_start+0x21) (ebp=00000000)

The ip register is pointing to some instruction byte, making it an
bogus opcode, "hlt" in this case:

| Wine-dbg>disass $eip-12,$eip+10
| 0x406e129c (GetTextColor+0x18 [dcvalues.c:177]): call	0x406bf664 (_init+0x67c)
| 0x406e12a1 (GetTextColor+0x1d [dcvalues.c:177]): addl	$4,%esp
| 0x406e12a4 (GetTextColor+0x20 [dcvalues.c:177]): testl	%eax,%eax
| 0x406e12a6 (GetTextColor+0x22 [dcvalues.c:177]): jz	0x406e12b4 (GetTextColor+0x30 [dcvalues.c:177])
| 0x406e12a8 (GetTextColor+0x24 [dcvalues.c:177]): movl	0x88(%eax),%edi
| 0x406e12ae (GetTextColor+0x2a [dcvalues.c:177]): pushl	%esi
| 0x406e12af (GetTextColor+0x2b [dcvalues.c:177]): call	0x406bfee4 (_init+0xefc)
| 0x406e12b4 (GetTextColor+0x30 [dcvalues.c:177]): movl	%edi,%eax
| 0x406e12b6 (GetTextColor+0x32 [dcvalues.c:177]): leal	0xfffffff4(%ebp),%esp
| 0x406e12b9 (GetTextColor+0x35 [dcvalues.c:177]): popl	%ebx
| 0x406e12ba (GetTextColor+0x36 [dcvalues.c:177]): popl	%esi
| 0x406e12bb (GetTextColor+0x37 [dcvalues.c:177]): popl	%edi
| 0x406e12bc (GetTextColor+0x38 [dcvalues.c:177]): leave	
| 0x406e12bd (GetTextColor+0x39 [dcvalues.c:177]): ret	$0x4
| 0x406e12c0 (GetViewportExt16 [dcvalues.c:182]): pushl	%ebp

Redoing the experiment (by starting and stopping all apps's) will give
crashes at slightly different places.

Has any one a suggestion?

Rein Klazes
rklazes at

More information about the wine-devel mailing list