[Bug 16883] New: .NET 3.0: WCF installer fails due bug in services.exe svcctl_GetServiceKeyNameW

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Jan 11 08:04:59 CST 2009


http://bugs.winehq.org/show_bug.cgi?id=16883

           Summary: .NET 3.0: WCF installer fails due bug in services.exe
                    svcctl_GetServiceKeyNameW
           Product: Wine
           Version: 1.1.12
          Platform: Other
               URL: http://www.microsoft.com/downloads/details.aspx?FamilyID
                    =10cc340b-f857-4a14-83f5-25634c3bf043
        OS/Version: other
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: -unknown
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: focht at gmx.net


Hello,

after getting past bug 16882 (WMI is needed) we resume where we left: bug 16878

---
1. clean WINEPREFIX
2. sh mywinetricks -q wmicore
3. sh winetricks -q dotnet20
4. download .NET 3.0 Framework installer from: http://download.microsoft.com
/download/4/d/a/4da3a5fa-ee6a-42b8-8bfa-ea5c4a458a7d/dotnetfx3setup.exe
(sha1sum: 
a566bcd2ffffc3842a95adc57f7df3f8cd11577f)
5. export _SFX_CAB_SHUTDOWN_REQUEST=1 (workaround, see bug 9158)
6. wine ./dotnetfx3setup.exe

It might take a while until all required packages are downloaded using BITS.

Note: If you need to redo steps, backup the directory "dotnetfx304506.30" from
"c:\\windows\\temp" to a different location, remove ~/.wine, copy
"dotnetfx304506.30" again to "c:\\windows\\temp" to prevent BITS from
downloading over and over again.

---

The WCF installer still fails:

"c:\\windows\\temp\\dd_dotnetfx3error.txt":

--- snip ---
[01/11/09,14:18:10] Windows Communication Foundation: [2] Error: Installation
failed for component Windows Communication Foundation. MSI returned error code
1603
[01/11/09,14:18:21] WapUI: [2] DepCheck indicates Windows Communication
Foundation is not installed.
--- snip ---

"c:\\windows\\temp\\dd_wcf_retMSI1CB9.txt":

--- snip ---
1: C:\windows\Microsoft.NET\Framework\v3.0\Windows Communication
Foundation\ServiceModelReg.exe /r /x /y /v 2:  
1: ERROR: Process returned non-0 value! CMDLINE:
C:\windows\Microsoft.NET\Framework\v3.0\Windows Communication
Foundation\ServiceModelReg.exe /r /x /y /v 2:  
1: Failed 2:
--- snip ---

--- snip ---
ServiceModelReg [14:18:09:203]: Starting tool
'C:\windows\system32\wbem\mofcomp.exe' with parameters
'"C:\windows\Microsoft.NET\Framework\v3.0\Windows Communication
Foundation\ServiceModel.mof"'.
ServiceModelReg [14:18:09:328]: Microsoft (R) 32-bit MOF Compiler Version
1.50.1085.0001
ServiceModelReg [14:18:09:329]: Copyright (c) Microsoft Corp. 1997-1999. All
rights reserved.
ServiceModelReg [14:18:09:423]: 
ServiceModelReg [14:18:09:425]: Parsing MOF file:
C:\windows\Microsoft.NET\Framework\v3.0\Windows Communication
Foundation\ServiceModel.mof
ServiceModelReg [14:18:09:446]: MOF file has been successfully parsed
ServiceModelReg [14:18:09:447]: Storing data in the repository...
ServiceModelReg [14:18:10:115]: An error occurred while creating object 3
defined on lines 20 - 24:
ServiceModelReg [14:18:10:116]: 0X80041002 Class, instance, or property
'HostingModel' was not found.
ServiceModelReg [14:18:10:122]: Compiler returned error 0x80041001
ServiceModelReg [14:18:10:122]: 
ServiceModelReg [14:18:10:122]: 
ServiceModelReg [14:18:10:124]: Tool 'C:\windows\system32\wbem\mofcomp.exe'
with parameters '"C:\windows\Microsoft.NET\Framework\v3.0\Windows Communication
Foundation\ServiceModel.mof"' exited with code '3'.
ServiceModelReg [14:18:10:166]: Warning: Failure executing
"C:\windows\system32\wbem\mofcomp.exe" with parameters
""C:\windows\Microsoft.NET\Framework\v3.0\Windows Communication
Foundation\ServiceModel.mof"": System.ApplicationException: Unexpected result 3
executing C:\windows\system32\wbem\mofcomp.exe with
"C:\windows\Microsoft.NET\Framework\v3.0\Windows Communication
Foundation\ServiceModel.mof"
   at System.ServiceModel.Install.InstallHelper.ExecuteWait(String program,
String parameters, Int32[] allowedExitCodes)
   at System.ServiceModel.Install.WmiInstallComponent.OnInstall(OutputLevel
outputLevel)
ServiceModelReg [14:18:10:231]: Error: WMI classes are not installed.
ServiceModelReg [14:18:10:233]: Repairing: Windows CardSpace (idsvc)
ServiceModelReg [14:18:10:251]: System.AccessViolationException: Attempted to
read or write protected memory. This is often an indication that other memory
is corrupt.
   at
System.ServiceModel.Install.NativeMethods.ChangeFailureActions(ServiceHandle
hService, Int32 dwInfoLevel, SERVICE_FAILURE_ACTIONS& lpInfo)
   at System.ServiceModel.Install.ServiceHandle.SetFailureActions(TimeSpan
resetPeriod, TimeSpan[] restartPeriods)
   at System.ServiceModel.Install.ServiceInstallComponent.OnInstall(OutputLevel
outputLevel)
   at
System.ServiceModel.Install.InfoCardServiceInstallComponent.OnInstall(OutputLevel
outputLevel)
   at System.ServiceModel.Install.ServiceInstallComponent.Reinstall(OutputLevel
outputLevel)
   at Microsoft.Tools.ServiceModel.ServiceModelReg.PerformAction(ActionItem
actionItem, Nullable`1 confirmUninstall)
   at Microsoft.Tools.ServiceModel.ServiceModelReg.Run(String[] args)
   at Microsoft.Tools.ServiceModel.ServiceModelReg.TryRun(String[] args)
=== Verbose logging stopped: 1/11/2009  14:18:10 ===
--- snip ---

Ok, lets leave the WMI failures aside (despite having native WMI core
installed) and see how far it goes.

That infocard service (re)install looks bugged:

--- snip ---
0035:trace:service:OpenSCManagerW ((null),(null),0x00000001)
0035:trace:service:sc_handle_alloc sc_handle type=0 -> 0x18ef38
0013:trace:service:svcctl_OpenSCManagerW ((null), (null), 1)
0035:trace:service:OpenSCManagerW returning 0x18ef38 (access : 0x00000001)
0035:CALL MSVCR80.memcpy() ret=79e808d5
0035:RET  MSVCR80.memcpy() retval=0017b820 ret=79e808d5
0035:trace:service:GetServiceKeyNameW 0x18ef38 L"" 0x88e170 0x33f1f0
0014:trace:service:svcctl_GetServiceKeyNameW (L"idsvc", 256)
0035:CALL MSVCR80.memcpy() ret=79e808d5
0035:RET  MSVCR80.memcpy() retval=00a4333c ret=79e808d5
0035:CALL MSVCR80.memcpy() ret=79e808d5
0035:RET  MSVCR80.memcpy() retval=0017b820 ret=79e808d5
0035:trace:service:GetServiceDisplayNameW 0x18ef38 L"idsvc" 0x17b820 0x33f1f0
0013:trace:service:svcctl_GetServiceDisplayNameW (L"idsvc", 1)
0035:CALL MSVCR80.memcpy() ret=79e808d5
0035:RET  MSVCR80.memcpy() retval=00a4333c ret=79e808d5
0035:CALL MSVCR80.memset(0033f0c4,00000000,0000002c,0033f0bc) ret=79eef4cb
0035:RET  MSVCR80.memset() retval=0033f0c4 ret=79eef4cb
0035:CALL MSVCR80.memcpy() ret=79e770f8
0035:RET  MSVCR80.memcpy() retval=0033f02c ret=79e770f8
0035:CALL MSVCR80.memset(0033ea2c,00000000,0000001c,0033ea70) ret=79e7d873
0035:RET  MSVCR80.memset() retval=0033ea2c ret=79e7d873
0035:CALL MSVCR80.memcpy() ret=79e808d5
0035:RET  MSVCR80.memcpy() retval=0017b820 ret=79e808d5
0035:CALL MSVCR80.memcpy() ret=79e808d5
0035:RET  MSVCR80.memcpy() retval=00a4363c ret=79e808d5
0035:CALL MSVCR80.memcpy() ret=79e770f8
0035:RET  MSVCR80.memcpy() retval=0033f10c ret=79e770f8
0035:CALL MSVCR80.memcmp(008647a8,032e66b9,00000012) ret=79efee2f
0035:RET  MSVCR80.memcmp() retval=00000000 ret=79efee2f
0035:trace:seh:raise_exception code=e0434f4d flags=1 addr=0x7b844f54
ip=0x7b844fd7 tid=0035
0035:trace:seh:raise_exception  info[0]=80131509
0035:trace:seh:raise_exception  eax=7b82cc91 ebx=7b8c3940 ecx=00000000
edx=0033f0f0 esi=0033f0f0 edi=e0434f4d
0035:trace:seh:raise_exception  ebp=0033f0b8 esp=0033f054 cs=0023 ds=002b
es=002b fs=0063 gs=006b flags=00000246
0035:trace:seh:call_stack_handlers calling handler at 0x79f9a3c8 code=e0434f4d
flags=1
0035:CALL
MSVCR80._except_handler4_common(7a381240,79e717fb,0033f064,0033f108,0033ecf0,0033eb90)
ret=79f9a3e7
0035:RET  MSVCR80._except_handler4_common() retval=00000001 ret=79f9a3e7
0035:trace:seh:call_stack_handlers handler at 0x79f9a3c8 returned 1
0035:trace:seh:call_stack_handlers calling handler at 0x7a3197d4 code=e0434f4d
flags=1 
--- snip ---

If we dump the corresponding SCM entry:

--- snip ---
000d:trace:service:scmdatabase_load_services Loading service L"idsvc"
000d:trace:service:load_service_config Image path           =
L"\"C:\\windows\\Microsoft.NET\\Framework\\v3.0\\Windows Communication
Foundation\\infocard.exe\""
000d:trace:service:load_service_config Group                = (null)
000d:trace:service:load_service_config Service account name = L"LocalSystem"
000d:trace:service:load_service_config Display name         = L"Windows
CardSpace"
000d:trace:service:load_service_config Service dependencies : (none)
000d:trace:service:load_service_config Group dependencies   : (none) 
--- snip ---

That GetServiceKeyNameW() API failure seems to be ok because the app passes the
key name itself "idsvc" and not the service display name.
The following GetServiceDisplayNameW() also fails, leading to app
error/exception.

If you look closer, you see svcctl_GetServiceDisplayNameW (L"idsvc", 1) ->
buffer length "1" passed.
This is clearly not what the app intended.
The app reuses the length parameter from GetServiceKeyNameW(), passing it again
into GetServiceDisplayNameW() but Wine changed it to "1" which seems incorrect.

--- snip programs/services/rpc.c ---
DWORD svcctl_GetServiceKeyNameW(
    SC_RPC_HANDLE hSCManager,
    LPCWSTR lpServiceDisplayName,
    WCHAR *lpBuffer,
    DWORD cchBufSize,
    DWORD *cchLength)
{
...
    entry = scmdatabase_find_service_by_displayname(manager->db,
lpServiceDisplayName);
    if (entry != NULL)
    { 
...
    else
    {
        *cchLength = 1;
        err = ERROR_SERVICE_DOES_NOT_EXIST;
    }

    scmdatabase_unlock(manager->db);

    if (err != ERROR_SUCCESS && cchBufSize > 0)
        lpBuffer[0] = 0;

    return err;
}
--- snip programs/services/rpc.c --

This doesn't look right, a conformance test case should reveal the correct
behaviour.
I already verified this with a patch.

Regards


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
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