Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Assertion Failed

Back to Forum: Tech Off
  • User profile image

    Anybody can help explaining this to me?


    I have created a very simple .NET console application connecting to two different databases located on a same server. The code looks like.


    SqlConnection conn = new SqlConnection();

    conn.ConnectionString = @”server=(local);Integrated Security=SSPI;database=db1”;



    SqlConnection conn2 = new SqlConnection();

    Conn2.ConnectionString = @”server=(local);Integrated Security=SSPI;database=db2”;







    Very frequently I get:



    Assertion Failed!
    Program: ....\DBConnCobsole.exe
    File: ..\..\nt\ssock\src\ntssockc.c
    Line: 957

    Expression: 0 == pConnectionObject->fCallCheck

    For Information on how your program can cause an assertion failure,
    please see the VC++ Documentation.
    (Press Retry to Debug the Application - JIT Must be enabled)



    If the first connection is closed before opening the second one, the error never appears.


    If the connection pooling is explicitly disabled on connection level using a string like “Pooling=false;server=(local);Integrated Security=SSPI;database=db1” and the same for the second connection, the error never appears.


    Any thoughts?

  • User profile image
    Mike Dimmick

    Ensure you're using .NET Framework 1.1 SP1 and at least MDAC 2.7 SP1 Refresh (plus the MS04-003 update). You can check your MDAC version using the MDAC Component Checker. Note that the database supplied with this tool may be slightly inaccurate, and some components may be updated if you install a SQL Server service pack. Nevertheless it should detect the correct MDAC version.

    If the problem persists, run the program under a native debugger, such as WinDBG. Set up WinDBG (and Visual Studio) to download debugging symbols from the public symbol server by setting the _NT_SYMBOL_PATH environment variable. I've set mine to "C:\Windows;C:\Windows\System32;SRV*C:\WebSymbols*"

    When the problem occurs, click Retry. The debugger should stop and produce a 0:000> prompt (the second set of numbers varies depending on which thread the error occurred on). Now take a stack trace with the kb command. The managed stack will probably help too; to take this, run the following debugger commands:

    .loadby sos mscorwks
    (this loads the sos.dll managed debugging extension from the directory the .NET Framework loaded from)
    !clrstack -a
    (performs a managed stack dump showing locals parameters and registers)

  • User profile image

    This is why we don't need emoticons taking over the forum!

    Just a thought, implement  [space] emoticon [space] or just remove it altogether.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.