2.5.5 x64 net-4.0 crash

Bug #597265 reported by Jamie Clayton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NUnit V2
Invalid
Undecided
Unassigned

Bug Description

Running x64 based unit tests on x64 Windows Server 2008 R2. Get the following crash from VS2010 automating Nunit.exe.
Testing Office 2010 Excel reading with x64 drivers. Running a single test works ok. Running a set of Excel tests causes the application crash. I suspect MS bug in the x64 data drivers, but this is the offending nunit test.

' Sheet Name and Row/Column Reference
        Console.WriteLine(String.Format(cNunitMessage, "Sheet Name and Row/Column Reference"))
        objDS = objExcel.GetDataSet(System.IO.Path.Combine(GetCurrentPath, "TestData\WithDataInSheet1.xlsx"), "Sheet1$B2:D10")
        If objDS.Tables.Count = 0 Then
            Assert.Fail("No data returned")
        End If

If I run the nunit test by itself it works as expected. If I run all the tests in the nunit class it fails and crashes Nunit. The crash sends a lot of information to Microsoft.

Tags: confirm
Revision history for this message
Jamie Clayton (jamie-clayton) wrote :
Revision history for this message
Jamie Clayton (jamie-clayton) wrote :

I also tried the "C:\Program Files (x86)\NUnit 2.5.5\bin\net-2.0\nunit-console.exe" C:\Data\Customers\Jenasys\SharedComponents\JDDataDLL\Development\JDData.Nunit\bin\x64\Debug\JDData.Nunit.dll in the VS2010 Command Prompt on the x64 Windows 2008 R2 Server.

The result was a request to switch on the VS 2010 Fusion log and I got the following errors. It looks like the x64 assembly resolution for nunit code is expecting GAC entries rather than references to the installation directory (C:\Program Files (x86)\NUnit 2.5.5\***)

*** Assembly Binder Log Entry (29/06/2010 @ 10:56:22 AM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll
Running under executable C:\Program Files (x86)\NUnit 2.5.5\bin\net-2.0\nunit-console.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = SRV\Administrator
LOG: DisplayName = nunit.core, Version=2.5.5.10112, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
 (Fully-specified)
LOG: Appbase = file:///C:/Data/Customers/Jenasys/SharedComponents/JDDataDLL/Development/JDData.Nunit/bin/x64/Debug
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = C:\Users\Administrator.000\AppData\Local\Temp\3\nunit20\ShadowCopyCache\7840_634134057817565659
LOG: AppName = Tests_322645823
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Data\Customers\Jenasys\SharedComponents\JDDataDLL\Development\JDData.Nunit\bin\x64\Debug\JDData.Nunit.dll.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Post-policy reference: nunit.core, Version=2.5.5.10112, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Data/Customers/Jenasys/SharedComponents/JDDataDLL/Development/JDData.Nunit/bin/x64/Debug/nunit.core.DLL.
LOG: Attempting download of new URL file:///C:/Data/Customers/Jenasys/SharedComponents/JDDataDLL/Development/JDData.Nunit/bin/x64/Debug/nunit.core/nunit.core.DLL.
LOG: Attempting download of new URL file:///C:/Data/Customers/Jenasys/SharedComponents/JDDataDLL/Development/JDData.Nunit/bin/x64/Debug/nunit.core.EXE.
LOG: Attempting download of new URL file:///C:/Data/Customers/Jenasys/SharedComponents/JDDataDLL/Development/JDData.Nunit/bin/x64/Debug/nunit.core/nunit.core.EXE.
LOG: All probing URLs attempted and failed.

Revision history for this message
Charlie Poole (charlie.poole) wrote : Re: [Bug 597265] [NEW] 2.5.5 x64 net-4.0 crash

Could you clarify just what you mean by "VS2010 automating Nunit..exe"?

On Tue, Jun 22, 2010 at 6:34 AM, Jamie Clayton
<email address hidden> wrote:
> Public bug reported:
>
> Running x64 based unit tests on x64 Windows Server 2008 R2. Get the following crash from VS2010 automating Nunit.exe.
> Testing Office 2010 Excel reading with x64 drivers. Running a single test works ok. Running a set of Excel tests causes the application crash. I suspect MS bug in the x64 data drivers, but this is the offending nunit test.
>
>
> '   Sheet Name and Row/Column Reference
>        Console.WriteLine(String.Format(cNunitMessage, "Sheet Name and Row/Column Reference"))
>        objDS = objExcel.GetDataSet(System.IO.Path.Combine(GetCurrentPath, "TestData\WithDataInSheet1.xlsx"), "Sheet1$B2:D10")
>        If objDS.Tables.Count = 0 Then
>            Assert.Fail("No data returned")
>        End If
>
> If I run the nunit test by itself it works as expected. If I run all the
> tests in the nunit class it fails and crashes Nunit. The crash sends a
> lot of information to Microsoft.
>
> ** Affects: nunitv2
>     Importance: Undecided
>         Status: New
>
> --
> 2.5.5 x64 net-4.0 crash
> https://bugs.launchpad.net/bugs/597265
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
>

Revision history for this message
Charlie Poole (charlie.poole) wrote : Re: [Bug 597265] Re: 2.5.5 x64 net-4.0 crash

This is the normal search sequence for any .NET assembly. When .NET
tries to load nunit.core into
the test domain, it will always fail. NUnit supplies the assembly in
response to that failure.

Charlie

On Mon, Jun 28, 2010 at 6:09 PM, Jamie Clayton
<email address hidden> wrote:
> I also tried the "C:\Program Files (x86)\NUnit 2.5.5\bin\net-2.0\nunit-
> console.exe"
> C:\Data\Customers\Jenasys\SharedComponents\JDDataDLL\Development\JDData.Nunit\bin\x64\Debug\JDData.Nunit.dll
> in the VS2010 Command Prompt on the x64 Windows 2008 R2 Server.
>
> The result was a request to switch on the VS 2010 Fusion log and I got
> the following errors. It looks like the x64 assembly resolution for
> nunit code is expecting GAC entries rather than references to the
> installation directory (C:\Program Files (x86)\NUnit 2.5.5\***)
>
> *** Assembly Binder Log Entry  (29/06/2010 @ 10:56:22 AM) ***
>
> The operation failed.
> Bind result: hr = 0x80070002. The system cannot find the file specified.
>
> Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll
> Running under executable  C:\Program Files (x86)\NUnit 2.5.5\bin\net-2.0\nunit-console.exe
> --- A detailed error log follows.
>
> === Pre-bind state information ===
> LOG: User = SRV\Administrator
> LOG: DisplayName = nunit.core, Version=2.5.5.10112, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
>  (Fully-specified)
> LOG: Appbase = file:///C:/Data/Customers/Jenasys/SharedComponents/JDDataDLL/Development/JDData.Nunit/bin/x64/Debug
> LOG: Initial PrivatePath = NULL
> LOG: Dynamic Base = NULL
> LOG: Cache Base = C:\Users\Administrator.000\AppData\Local\Temp\3\nunit20\ShadowCopyCache\7840_634134057817565659
> LOG: AppName = Tests_322645823
> Calling assembly : (Unknown).
> ===
> LOG: This bind starts in default load context.
> LOG: Using application configuration file: C:\Data\Customers\Jenasys\SharedComponents\JDDataDLL\Development\JDData.Nunit\bin\x64\Debug\JDData.Nunit.dll.config
> LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
> LOG: Post-policy reference: nunit.core, Version=2.5.5.10112, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
> LOG: GAC Lookup was unsuccessful.
> LOG: Attempting download of new URL file:///C:/Data/Customers/Jenasys/SharedComponents/JDDataDLL/Development/JDData.Nunit/bin/x64/Debug/nunit.core.DLL.
> LOG: Attempting download of new URL file:///C:/Data/Customers/Jenasys/SharedComponents/JDDataDLL/Development/JDData.Nunit/bin/x64/Debug/nunit.core/nunit.core.DLL.
> LOG: Attempting download of new URL file:///C:/Data/Customers/Jenasys/SharedComponents/JDDataDLL/Development/JDData.Nunit/bin/x64/Debug/nunit.core.EXE.
> LOG: Attempting download of new URL file:///C:/Data/Customers/Jenasys/SharedComponents/JDDataDLL/Development/JDData.Nunit/bin/x64/Debug/nunit.core/nunit.core.EXE.
> LOG: All probing URLs attempted and failed.
>
> --
> 2.5.5 x64 net-4.0 crash
> https://bugs.launchpad.net/bugs/597265
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
>

Revision history for this message
Jamie Clayton (jamie-clayton) wrote :

Charlie,
"VS2010 automating Nunit.exe" - Nunit Library project -> Debug Tab -> Start External Application -> C:\Program Files (x86)\NUnit 2.5.5\bin\net-2.0\nunit.exe. I then add Command Line Arguments -> Nunit_LibraryName.dll

Hope that makes sense.
I've also got a cross post with Microsoft forums on this issue. http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/37b04b99-9b54-462d-9ec7-29ba64f1e735/?prof=required
Thanks for your help.

Revision history for this message
Jamie Clayton (jamie-clayton) wrote :

The Microsoft windows 2008 R2 APP Crash report contains the following.
Problem signature:
  Problem Event Name: APPCRASH
  Application Name: nunit-agent.exe
  Application Version: 2.5.5.10112
  Application Timestamp: 4bd0d2b8
  Fault Module Name: msxml6.dll
  Fault Module Version: 6.30.7600.16385
  Fault Module Timestamp: 4a5bdfc8
  Exception Code: c0000005
  Exception Offset: 00000000000016d1
  OS Version: 6.1.7600.2.0.0.272.7
  Locale ID: 3081
  Additional Information 1: 3cfc
  Additional Information 2: 3cfc6c6d14bdc651a9c8274b1b406d59
  Additional Information 3: edd5
  Additional Information 4: edd5622e8ad533d3357f6496dc3c65f4

Revision history for this message
Jamie Clayton (jamie-clayton) wrote :

I've got a code work around.

Following Blake Niemyjski, from CodeSmith Tools I did the following.
a) Changed the platform to "Any CPU".
b) Removed any specific .net edition reference paths.
c) Modified the MS Office 14 excel automation code to follow the "USING Blocks". See code difference attached. This would ensure that opening excel documents multiple times doesn't cause the issue.
d) Removed all the nunit-agent.exe processors on the x64 Server (6)

Re-ran the Nunit tests and Nunit didn't crash.

Following recommendations from Blake Niemyjski, @ CodeSmith Tools, I did the following.
1. Changed the Project platform(s) to "Any CPU".
2. Removed any specific .net edition reference paths.
3. Modified the MS Office 14 excel automation code to follow the "USING Blocks". See code difference attached.
4. Removed all the nunit-agent.exe processors on the x64 Server (6)
5. Confirmed the Nunit process was running without **32 tag in Task Manager.

Re-ran the Nunit tests and Nunit didn't crash.

Revision history for this message
Jamie Clayton (jamie-clayton) wrote :

Found a typo in the code change that when fixed causes Nunit to crash again. Looks like the command statement is the trouble maker.

Debug.Print(myCommand)
Using command As New System.Data.OleDb.OleDbCommand(myCommand, connection)
   ' Create a data adapter to store the inforamtion
      Using myDA As New System.Data.OleDb.OleDbDataAdapter
          With myDA
              .SelectCommand = command
              .Fill(dset, My.Resources.DataSetTableName)
          End With
      End Using
End Using

Revision history for this message
Jamie Clayton (jamie-clayton) wrote :

I'm going to try using VS 2010 unit testing to see how that product performs this task. Will let you know my findings.

Revision history for this message
Jamie Clayton (jamie-clayton) wrote :

VS 2010 MS Test also crashes with the same unit tests. :) It also seems to do it at the same location as the Nunit crash.

Application Name: QTAgent.exe
  Application Version: 10.0.30319.1
  Application Timestamp: 4ba20efa
  Fault Module Name: msxml6.dll
  Fault Module Version: 6.30.7600.16385
  Fault Module Timestamp: 4a5bdfc8
  Exception Code: c0000005
  Exception Offset: 00000000000016d1
  OS Version: 6.1.7600.2.0.0.272.7
  Locale ID: 3081
  Additional Information 1: 3cfc
  Additional Information 2: 3cfc6c6d14bdc651a9c8274b1b406d59
  Additional Information 3: edd5
  Additional Information 4: edd5622e8ad533d3357f6496dc3c65f4

Looks like it's an MS bug in x64. Reading excel files individually seems to pass unit tests, but if you have a class that reads excel files and you re-use that to read multiple excel files the application crashes in Windows x64, but doesn't in a x86 environment.

Revision history for this message
Charlie Poole (charlie.poole) wrote :

Are you creating the object used to read excel files separately for
each test or just once for
the test fixture? Normally, you should try to create it only once (in
your setup) and make sure
it is destroyed in teardown. If you are not doing this, give it a try.

The stack seems to indicate that the excel server is not available for
connection. If this is
happening with the second test to run, then you may want to set up the
connection only
once (in testfixturesetup) and maintain it through all the tests. Try
it this way as well.

I assume you have arranged to be running in the STA, since this involves COM.

Charlie

On Tue, Jun 29, 2010 at 11:43 PM, Jamie Clayton
<email address hidden> wrote:
> VS 2010 MS Test also crashes with the same unit tests. :) It also seems
> to do it at the same location as the Nunit crash.
>
> Application Name:    QTAgent.exe
>  Application Version:    10.0.30319.1
>  Application Timestamp:    4ba20efa
>  Fault Module Name:    msxml6.dll
>  Fault Module Version:    6.30.7600.16385
>  Fault Module Timestamp:    4a5bdfc8
>  Exception Code:    c0000005
>  Exception Offset:    00000000000016d1
>  OS Version:    6.1.7600.2.0.0.272.7
>  Locale ID:    3081
>  Additional Information 1:    3cfc
>  Additional Information 2:    3cfc6c6d14bdc651a9c8274b1b406d59
>  Additional Information 3:    edd5
>  Additional Information 4:    edd5622e8ad533d3357f6496dc3c65f4
>
> Looks like it's an MS bug in x64.  Reading excel files individually
> seems to pass unit tests, but if you have a class that reads excel files
> and you re-use that to read multiple excel files the application crashes
> in Windows x64, but doesn't in a x86 environment.
>
> --
> 2.5.5 x64 net-4.0 crash
> https://bugs.launchpad.net/bugs/597265
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
>

tags: added: confirm
Revision history for this message
Charlie Poole (charlie.poole) wrote :

Based on the discussion, this seems to be a .NET issue. I'm closing it as "Invalid" (wish there were a better category)

Changed in nunitv2:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.