Wireshark-bugs: [Wireshark-bugs] [Bug 3272] New: Windows (deveoplment) Buildbot images have a ru

Date: Sun, 22 Feb 2009 08:09:15 -0800 (PST)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3272

           Summary: Windows (deveoplment) Buildbot images have a runtime
                    dependency on Microsoft.VC90.CRT in WinSxS folder
           Product: Wireshark
           Version: 1.1.x (Experimental)
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Major
          Priority: Medium
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: jyoung@xxxxxxx


Build Information:
Version 1.1.3-SVN-27507 (SVN Rev 27507)

Copyright 1998-2009 Gerald Combs <gerald@xxxxxxxxxxxxx> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled with GTK+ 2.14.7, with GLib 2.18.4, with WinPcap (version unknown),
with libz 1.2.3, without POSIX capabilities, with libpcre 7.0, with SMI 0.4.8,
with c-ares 1.6.0, with Lua 5.1, with GnuTLS 2.6.4, with Gcrypt 1.4.4, with MIT
Kerberos, with GeoIP, with PortAudio V19-devel (built Feb 22 2009), with
AirPcap.

Running on Windows XP Service Pack 2, build 2600, with WinPcap version 4.0.2
(packet.dll version 4.0.0.1040), based on libpcap version 0.9.5, GnuTLS 2.6.4,
Gcrypt 1.4.4, without AirPcap.

Built using Microsoft Visual C++ 9.0 build 30729

Wireshark is Open Source Software released under the GNU General Public
License.

Check the man page and http://www.wireshark.org for more information.
--
Hello,

Recent Windows (development) buildbot packages when run on a system that does
_NOT_ have Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) (a.k.a
Microsoft.VC90.CRT) installed in the Window's WinSxS folder will result in a
series of pop-up windows with a message similar to the following for each and
every DLL file found in the plugins folder:

> Wireshark
> 
> (-) Couldn't load module C:\Program Files\Wireshark\plugins\1.1.3-SVN-27478\wimaxasncp.dll: 
>     This application has failed to start because the application
>     configuration is incorrect. Reinstalling the application may fix 
>     this problem.
> 
>           [ OK ]

Each of these pop-up windows results in three (3) separate messages to be
logged to the Windows Event Viewer's System Error Records:

> Date: 3009-02-19  Source: SideBySide
> Time: 03:04:54    Category: None
> Type: Error       Event ID: 32
> User: N/A
> Computer: Laptop
> 
> Dependent Assembly Microsoft.VC90.CRT could not be found and Last 
> Error was The referenced assembly is not installed on your system.
> .
> 
> For more information, see Help and Support Center at 
> http://go.microsoft.com/fwlink/events.asp.

===

> Date: 3009-02-19  Source: SideBySide
> Time: 03:04:54    Category: None
> Type: Error       Event ID: 59
> User: N/A
> Computer: Laptop
> 
> Resolve Partial Assembly failed for Microsoft.VC90.CRT. Reference error 
> message: The referenced assembly is not installed on your system.
> .
> 
> For more information, see Help and Support Center at 
> http://go.microsoft.com/fwlink/events.asp.

===

> Date: 3009-02-19  Source: SideBySide
> Time: 03:04:54    Category: None
> Type: Error       Event ID: 59
> User: N/A
> Computer: Laptop
> 
> Generate Activation Context failed for C:\Program Files\Wireshark\plugins
> \1.1.3-SVN-27478\agentx.dll. Reference error message: The operation 
> completed successfully.
> .
> 
> For more information, see Help and Support Center at 
> http://go.microsoft.com/fwlink/events.asp.

The last Wireshark (development) buildbot package that can successfully load
the plugins without having Microsoft.VC90.CRT explicitly installed in the
WinSxS folder is Version 1.1.3-SVN-27356 (SVN Rev 27356).  

It looks like the WinSxS dependency was introduced with Revision 27357 and has
been present in development buildbot packages since:

> Author: ulfl 
> Date: Mon Feb 2 23:09:36 2009 UTC (2 weeks, 5 days ago) 
> Log Message: add missing mt.exe calls, to include manifest files into 
> exe / dll files 

Since the Microsoft.VC90.CRT files (A manifest file and three MSV*.DLL files)
are included in Wireshark's program file folder, it appears that Wireshark
_MAY_ be intended to be packaged as a "private assembly".

See:

  Visual C++ How to: Deploy using XCopy
  http://msdn.microsoft.com/en-us/library/ms235291.aspx 

The msdn link above states that for private assemblies the runtime files should
also be copied to "\bin and to \bin\MyLibrary" folders.  I read the "\bin" to
mean Wireshark's program file folder (where Wireshark.exe is installed) and
"\bin\MyLibrary" to mean the plugins folder.

When I copied the Microsoft.VC90.CRT files to the plugins folder I no longer
had any pop-up windows for the Wireshark plugin DLL files, but instead ended up
with three different pop-up windows, one for each of the Microsoft.VC90.CRT
runtime DLL files. :-(

The msdn link cited above has a Community Content comment entitled "Installing
Microsoft.VC90.CRT as private assembly in several folders is not a good idea!"
which goes on to warn of "more than one instance (*) of the runtime-library in
memory if you embed a manifest in a DLL."  The comment proposes "build the
extension DLL without a manifest. (/manifest:no as linker option)."

With the Microsoft.VC90.CRT copied to the plugins folder, the Dependency Walker
tool (http://www.dependencywalker.com/) confirmed that Wireshark did have more
than one instance of the runtime-library MSVCR90.DLL in memory.  One was from
C:\Program Files\Wireshark folder the other from the C:\Program
Files\Wireshark\plugins\1.1.3-SVN-27507 folder.  

If instead of copying Microsoft.VC90.CRT files to the plugins folder I simply
install the Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) package
(version 9.0.30729.17 of the vcredist_x86.exe) then the recent Wireshark
(development) packages start up without any pop-up messages.

Interestingly if the Redistributable package is installed (i.e. within the
WinSxS folder) Wireshark no longer appears to use the Microsoft.VC90.CRT files
installed within its own Program files folder.  In other words Wireshark
appears to be using the Visual C++ library DLLs as "shared assemblies".  

The dependency walker confirms that only one instance of MSVCR90.DLL is in
memory:

 
c:\windows\winsxs\wx86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963e\MSVCR90.DLL

I also confirmed that with the redistributable package installed, I was able to
successfully startup Wireshark even after deleting the Microsoft.VC90.CRT files
from the Wireshark program folder.

Given all the information and mis-information that seems to surround the issue
of DLLs and manifests (embeded versus external) etc I'm not sure what (if any)
the best "fix" to this problem would be.   

The workaround for my affected machines is to simply install the Microsoft
Visual C++ 2008 SP1 Redistributable Package (x86).  But I'm not sure everyone
will be happy with that as a solution.


-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.