From: querybuilder@gmail.com   
      
   We are in the process of migrating our SQL 2008 R2 Enterprise Edition   
   environment to a new SQL Server 2012 Enterprise Edition.   
      
   Both current and the new environments are Active / Passive SQL cluster and I   
   have been running a CLR function on the existing environment which I am trying   
   to migrate.   
      
   The function returns fine most of the time, but at intermittent times, its   
   giving me the following error:   
      
      
   Msg 6522, Level 16, State 1, Line 3   
   A .NET Framework error occurred during execution of user-defined routine or   
   aggregate "":   
   System.ApplicationException: ********** CLR FUNCTION FAILED   
   ********** ---> System.Data.SqlClient.SqlException:   
   System.Data.SqlClient.SqlException:   
    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception,   
   Boolean breakConnection, Action`1 wrapCloseInAction)   
    at System.Data.SqlClient.SqlDataReaderSmi.InternalRead(Boolean   
   ignoreNonFatalErrors)   
    at System.Data.SqlClient.SqlDataReaderSmi.Read()   
    at UserDefinedFunctions.(SqlInt32 Parameter1)   
   System.ApplicationException:   
    at UserDefinedFunctions.(SqlInt32 Parameter1)   
   .   
      
   This is at random scenarios. When I run this multiple times, I get this error.   
      
   We have tried the following:   
   Developed the CLR on multiple VS environments such as 2010, 2013 and tried in   
   32 bit as well as 64 bit compatibility levels.   
      
   We have played with PERMISSION_SET to be SAFE EXTERNAL_ACCESS and also   
   switched the trustworthy Property on the database.   
      
   Its running fine on all other environments (including the DR environment of   
   the 2012 Server but the Primary server is causing the above failure.   
      
   Here is the SQL Server dump log:   
      
   2015-06-15 11:24:10.97 spid96 ***Stack Dump being sent to H   
   \SQLVS1DB\MSSQL11.CCSQL301NJ\MSSQL\LOG\SQLDump0471.txt   
   2015-06-15 11:24:10.97 spid96 SqlDumpExceptionHandler: Process 8528   
   generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is   
   terminating this process.   
   2015-06-15 11:24:10.97 spid96 * ***************************   
   ***************************************************   
   2015-06-15 11:24:10.97 spid96 *   
   2015-06-15 11:24:10.97 spid96 * BEGIN STACK DUMP:   
   2015-06-15 11:24:10.97 spid96 * 06/15/15 11:24:10 spid 8528   
   2015-06-15 11:24:10.97 spid96 *   
   2015-06-15 11:24:10.97 spid96 *   
   2015-06-15 11:24:10.97 spid96 * Exception Address = 000007F9C5870E66   
   Module(sqllang+0000000000060E66)   
   2015-06-15 11:24:10.97 spid96 * Exception Code = c0000005   
   EXCEPTION_ACCESS_VIOLATION   
   2015-06-15 11:24:10.97 spid96 * Access Violation occurred reading   
   address 0000000000000000   
   2015-06-15 11:24:10.97 spid96 * Input Buffer 416 bytes -   
   2015-06-15 11:24:10.97 spid96 * SELECT * FROM f   
   bl_gvs.dbo.fnGetCase_Users(406159) SELECT *   
   2015-06-15 11:24:10.97 spid96 * FROM (21)   
   2015-06-15 11:24:10.97 spid96 *   
   2015-06-15 11:24:10.97 spid96 *   
   2015-06-15 11:24:10.97 spid96 * MODULE    
   BASE END SIZE   
   2015-06-15 11:24:10.97 spid96 * sqlservr    
   000007F74A110000 000007F74A14DFFF 0003e000   
   2015-06-15 11:24:10.97 spid96 * ntdll    
   000007F9DE0F0000 000007F9DE2ACFFF 001bd000   
   2015-06-15 11:24:10.97 spid96 * KERNEL32    
   000007F9DDD80000 000007F9DDEB6FFF 00137000   
   2015-06-15 11:24:10.97 spid96 * KERNELBASE    
   000007F9DB060000 000007F9DB153FFF 000f4000   
   2015-06-15 11:24:10.97 spid96 * ADVAPI32    
   000007F9DB510000 000007F9DB5EDFFF 000de000   
   2015-06-15 11:24:10.97 spid96 * MSVCR100    
   0000000076CF0000 0000000076DC1FFF 000d2000   
   2015-06-15 11:24:10.97 spid96 * MSVCP100    
   0000000076C20000 0000000076CB7FFF 00098000   
   2015-06-15 11:24:10.97 spid96 * sqlos    
   0000000076230000 0000000076236FFF 00007000   
   2015-06-15 11:24:10.97 spid96 * NETAPI32    
   000007F9D96B0000 000007F9D96C4FFF 00015000   
   2015-06-15 11:24:10.97 spid96 * pdh    
   000007F9D2650000 000007F9D269BFFF 0004c000   
   2015-06-15 11:24:10.97 spid96 * opends60    
   00000000761F0000 00000000761F7FFF 00008000   
   2015-06-15 11:24:10.97 spid96 * sqlmin    
   000007F9C78A0000 000007F9C97E0FFF 01f41000   
   2015-06-15 11:24:10.97 spid96 * sqllang    
   000007F9C5810000 000007F9C789BFFF 0208c000   
   2015-06-15 11:24:10.97 spid96 * sqlTsEs    
   000007F9C4F80000 000007F9C5806FFF 00887000   
   2015-06-15 11:24:10.97 spid96 * sqldk    
   000007F9CA6A0000 000007F9CAB18FFF 00479000   
   2015-06-15 11:24:10.97 spid96 * msvcrt    
   000007F9DDF20000 000007F9DDFC4FFF 000a5000   
   2015-06-15 11:24:10.97 spid96 * sechost    
   000007F9DDED0000 000007F9DDF17FFF 00048000   
   2015-06-15 11:24:10.97 spid96 * RPCRT4    
   000007F9DB750000 000007F9DB894FFF 00145000   
   2015-06-15 11:24:10.97 spid96 * netutils    
   000007F9D9840000 000007F9D984DFFF 0000e000   
   2015-06-15 11:24:10.97 spid96 * srvcli    
   000007F9DAB20000 000007F9DAB43FFF 00024000   
   2015-06-15 11:24:10.97 spid96 * wkscli    
   000007F9D9820000 000007F9D9834FFF 00015000   
   2015-06-15 11:24:10.97 spid96 * USER32    
   000007F9DB5F0000 000007F9DB73BFFF 0014c000   
   2015-06-15 11:24:10.97 spid96 * ole32    
   000007F9DD430000 000007F9DD5ADFFF 0017e000   
   2015-06-15 11:24:10.97 spid96 * OLEAUT32    
   000007F9DBB20000 000007F9DBBE2FFF 000c3000   
   2015-06-15 11:24:10.97 spid96 * Secur32    
   000007F9D6280000 000007F9D628AFFF 0000b000   
   2015-06-15 11:24:10.97 spid96 * PSAPI    
   000007F9DDEC0000 000007F9DDEC6FFF 00007000   
   2015-06-15 11:24:10.97 spid96 * WS2_32    
   000007F9DCF10000 000007F9DCF67FFF 00058000   
   2015-06-15 11:24:10.97 spid96 * USERENV    
   000007F9DB3F0000 000007F9DB40EFFF 0001f000   
   2015-06-15 11:24:10.97 spid96 * AUTHZ    
   000007F9DA2C0000 000007F9DA306FFF 00047000   
      
   [continued in next message]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|