Tech Off Thread

3 posts

Assertion Failed

Back to Forum: Tech Off
  • User profile image
    Vassil

    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”;

    conn.Open();

     

    SqlConnection conn2 = new SqlConnection();

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

    Conn2.Open();

     

    conn.Close();

    Conn2.Close();

     

     

    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*http://msdl.microsoft.com/download/symbols"

    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
    crashnull

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

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

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.