[Bug 36487] Avast Free Antivirus fails to install, reporting 'HTMLayout.dll cannot be loaded to properly start GUI.' (EnumSystemLocalesEx fails to call user provided callback)

wine-bugs at winehq.org wine-bugs at winehq.org
Tue May 20 17:46:57 CDT 2014


https://bugs.winehq.org/show_bug.cgi?id=36487

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |Installer
             Status|UNCONFIRMED                 |NEW
          Component|-unknown                    |kernel32
            Summary|Avast Free Antivirus fails  |Avast Free Antivirus fails
                   |to install                  |to install, reporting
                   |                            |'HTMLayout.dll cannot be
                   |                            |loaded to properly start
                   |                            |GUI.' (EnumSystemLocalesEx
                   |                            |fails to call user provided
                   |                            |callback)
     Ever confirmed|0                           |1

--- Comment #2 from Anastasius Focht <focht at gmx.net> ---
Hello folks,

to make the bug useful selecting one issue on my own.

All recent AVAST installers show the same symptom: they display a message box,
stating "HTMLayout.dll cannot be loaded to properly start GUI. Therefore
process cannot continue." on startup.

Interestingly, this kind of error has also been reported for Windows.

"avast 2014 installer and HTMLayout.dll error" ->
http://forum.avast.com/index.php?topic=139396.0 

"HTMLayout.dll cannot be loaded" ->
https://answers.microsoft.com/en-us/windows/forum/windows8_1-performance/htmlayoutdll-cannot-be-loaded/7bb61d1b-4ceb-4a85-aedd-9adec09b2bea

The problem can be reproduced by re-running the sub-installer (unpacked).

--- snip ---
$ WINEDEBUG=+tid,+seh,+relay,+nls wine ./instup.exe /sfx /edition:1 /prod:ais
>>log.txt 2>&1
...
0023:Call KERNEL32.LoadLibraryExA(1038c500 "HTMLayout.dll",00000000,00000000)
ret=1031af62 
...
0023:Call KERNEL32.GetLastError() ret=00f68464
0023:Ret  KERNEL32.GetLastError() retval=00000000 ret=00f68464
0023:Call KERNEL32.EnumSystemLocalesEx(00f6cc72,00000003,00000000,00000000)
ret=00f6db38
0023:trace:nls:GetLocaleInfoW (lcid=0x401,lctype=0x5c,0x33dbc8,256)
0023:trace:nls:GetLocaleInfoW (lcid=0x401,lctype=0x5c,0x33dbc8,256) returning 6
L"ar-SA"
0023:trace:nls:GetLocaleInfoW (lcid=0x401,lctype=0x71,0x33dbc4,2)
0023:trace:nls:GetLocaleInfoW (lcid=0x401,lctype=0x71,0x33dbc4,2) returning
number 0
...
0023:trace:nls:GetLocaleInfoW (lcid=0x500a,lctype=0x5c,0x33dbc8,256)
0023:trace:nls:GetLocaleInfoW (lcid=0x500a,lctype=0x5c,0x33dbc8,256) returning
6 L"es-PR"
0023:trace:nls:GetLocaleInfoW (lcid=0x500a,lctype=0x71,0x33dbc4,2)
0023:trace:nls:GetLocaleInfoW (lcid=0x500a,lctype=0x71,0x33dbc4,2) returning
number 0
0023:Ret  KERNEL32.EnumSystemLocalesEx() retval=00000001 ret=00f6db38
0023:Call KERNEL32.IsValidLocaleName(0033e76c L"English") ret=00f6dc45
0023:trace:nls:parse_locale_name L"English"
0023:trace:nls:GetLocaleInfoW (lcid=0x401,lctype=0x5c,0x33dac4,128)
0023:trace:nls:GetLocaleInfoW (lcid=0x401,lctype=0x5c,0x33dac4,128) returning 6
L"ar-SA"
0023:trace:nls:GetLocaleInfoW (lcid=0x401,lctype=0x59,0x33dac4,128)
0023:trace:nls:GetLocaleInfoW (lcid=0x401,lctype=0x59,0x33dac4,128) returning 3
L"ar"
...
0023:trace:nls:GetLocaleInfoW (lcid=0x500a,lctype=0x5c,0x33dac4,128)
0023:trace:nls:GetLocaleInfoW (lcid=0x500a,lctype=0x5c,0x33dac4,128) returning
6 L"es-PR"
0023:trace:nls:GetLocaleInfoW (lcid=0x500a,lctype=0x59,0x33dac4,128)
0023:trace:nls:GetLocaleInfoW (lcid=0x500a,lctype=0x59,0x33dac4,128) returning
3 L"es"
0023:trace:nls:IsValidLocaleName found lcid 409 for L"English", matches 0
0023:Ret  KERNEL32.IsValidLocaleName() retval=00000000 ret=00f6dc45
0023:Call KERNEL32.InterlockedDecrement(008d1860) ret=00f679dd
0023:Ret  KERNEL32.InterlockedDecrement() retval=00000000 ret=00f679dd
0023:Call KERNEL32.InterlockedDecrement(0107da28) ret=00f67a57
0023:Ret  KERNEL32.InterlockedDecrement() retval=00000001 ret=00f67a57
0023:Call ntdll.RtlFreeHeap(00110000,00000000,008d1860) ret=00f5b4bf
0023:Ret  ntdll.RtlFreeHeap() retval=00000001 ret=00f5b4bf
0023:Call ntdll.RtlFreeHeap(00110000,00000000,008d1848) ret=00f5b4bf
0023:Ret  ntdll.RtlFreeHeap() retval=00000001 ret=00f5b4bf
0023:trace:seh:raise_exception code=c0000005 flags=0 addr=0xdde5ac ip=00dde5ac
tid=0023
0023:trace:seh:raise_exception  info[0]=00000000
0023:trace:seh:raise_exception  info[1]=00000000
0023:trace:seh:raise_exception  eax=00000000 ebx=00000000 ecx=71a45bd7
edx=00110064 esi=00000001 edi=0033ec1c
0023:trace:seh:raise_exception  ebp=0033e888 esp=0033e880 cs=0023 ds=002b
es=002b fs=0063 gs=006b flags=00210246
0023:trace:seh:call_stack_handlers calling handler at 0xf5ca60 code=c0000005
flags=0
...
0023:trace:seh:call_stack_handlers handler at 0xf5ca60 returned 1
0023:trace:seh:call_stack_handlers calling handler at 0x7bc9ed20 code=c0000005
flags=0
0023:trace:seh:__regs_RtlUnwind code=c0000005 flags=2
0023:trace:seh:__regs_RtlUnwind calling handler at 0x7bc82539 code=c0000005
flags=2
0023:trace:seh:__regs_RtlUnwind handler at 0x7bc82539 returned 1
0023:trace:seh:__regs_RtlUnwind calling handler at 0xf5ca60 code=c0000005
flags=2
0023:trace:seh:__regs_RtlUnwind handler at 0xf5ca60 returned 1
0023:exception in PE entry point
(proc=0xf5e262,module=0xdb0000,reason=PROCESS_ATTACH,res=(nil))
...
0023:Ret  KERNEL32.LoadLibraryExA() retval=00000000 ret=1031af62
...
0023:Call KERNEL32.GetLastError() ret=1031af6e
0023:Ret  KERNEL32.GetLastError() retval=000003e6 ret=1031af6e
0023:Call KERNEL32.RaiseException(c06d007e,00000000,00000001,0033ec98)
ret=1031afa1
0023:trace:seh:raise_exception code=c06d007e flags=0 addr=0x7b83ac57
ip=7b83ac57 tid=0023
0023:trace:seh:raise_exception  info[0]=0033ec5c
0023:trace:seh:raise_exception  eax=7b826c7d ebx=7b8bb000 ecx=0033ec5c
edx=0033eba4 esi=0033ec50 edi=0033ec10
0023:trace:seh:raise_exception  ebp=0033ebe8 esp=0033eb84 cs=0023 ds=002b
es=002b fs=0063 gs=006b flags=00200283
0023:trace:seh:call_stack_handlers calling handler at 0x102e2340 code=c06d007e
flags=0
...
0023:Call user32.MessageBoxW(00000000,103b1578 L"HTMLayout.dll cannot be loaded
to properly start GUI. Therefore process cannot continue.",00000000,00000010)
ret=101a262c 
--- snip ---

It seems the installer tries to figure out the locale name from language.

Language: 'English'

EnumSystemLocalesEx -> flags = 0x03 (LOCALE_WINDOWS | LOCALE_SUPPLEMENTAL)

--- snip ---
#define LOCALE_ALL                  0x00
#define LOCALE_WINDOWS              0x01
#define LOCALE_SUPPLEMENTAL         0x02
#define LOCALE_ALTERNATE_SORTS      0x04
#define LOCALE_REPLACEMENT          0x08
#define LOCALE_NEUTRALDATA          0x10
#define LOCALE_SPECIFICDATA         0x20
--- snip ---

Wine's locale enumerator doesn't call the user provided callback which later
causes the exception while still in dll init.

Source:
http://source.winehq.org/git/wine.git/blob/32da6626f562146c0fd1d8550c60995359b2a0da:/dlls/kernel32/locale.c#l2379

--- snip ---
2379 static BOOL CALLBACK enum_locale_ex_proc( HMODULE module, LPCWSTR type,
2380                               LPCWSTR name, WORD lang, LONG_PTR lparam )
2381 {
2382     struct enum_locale_ex_data *data = (struct enum_locale_ex_data
*)lparam;
2383     WCHAR buffer[256];
2384     DWORD neutral;
2385     unsigned int flags;
2386
2387     GetLocaleInfoW( MAKELCID( lang, SORT_DEFAULT ), LOCALE_SNAME |
LOCALE_NOUSEROVERRIDE,
2388                     buffer, sizeof(buffer) / sizeof(WCHAR) );
2389     if (!GetLocaleInfoW( MAKELCID( lang, SORT_DEFAULT ),
2390             LOCALE_INEUTRAL | LOCALE_NOUSEROVERRIDE |
LOCALE_RETURN_NUMBER,
2391             (LPWSTR)&neutral, sizeof(neutral) / sizeof(WCHAR) ))
2392         neutral = 0;
2393     flags = LOCALE_WINDOWS;
2394     flags |= neutral ? LOCALE_NEUTRALDATA : LOCALE_SPECIFICDATA;
2395     if (data->flags && ~(data->flags & flags)) return TRUE;
2396     return data->proc( buffer, flags, data->lparam );
2397 }
--- snip ---

Second condition in Line 2395 is incorrect (bitwise vs. logical 'not'),
assembly code for proof:

--- snip ---
7B851664     8B45 F4         MOV EAX,DWORD PTR SS:[EBP-0C]
7B851667     8B40 04         MOV EAX,DWORD PTR DS:[EAX+4]
7B85166A     2345 F0         AND EAX,DWORD PTR SS:[EBP-10]
7B85166D     83F8 FF         CMP EAX,-1
7B851670     74 07           JE SHORT 7B851679
7B851672     B8 01000000     MOV EAX,1
7B851677     EB 24           JMP SHORT 7B85169D
--- snip ---

Besides this, I'd just filter out the harmless unsupported flags (such as
LOCALE_SUPPLEMENTAL, Vista+ custom locales in this case) and still call the app
provided callback.

I tested a fix (user provided callback gets called) and it lets the installer
successfully initialize and finish the installation.

$ wine --version
wine-1.7.19-47-g704d169

Regards

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list