FIRST OCCURRENCE: Common Language Runtime escalation on critical resource

1

Recently we have this issue in active node which is part of failover cluster instance. The active node shutdown automatically and transfer all roles to the passive node. Upon checking the sql error log.

Error:
AppDomain 3 (XXX_XX.dbo[runtime].2) is marked for unload due to memory pressure.
AppDomain 2 (XXX.dbo[runtime].1) is marked for unload due to memory pressure.
AppDomain 3 (XXX_XX.dbo[runtime].2) unloaded
AppDomain 2 (XXX.dbo[runtime].1) unloaded.
AppDomain 5 (XXX.dbo[runtime].4) created.

See dump files created for more details:

   Current time is 16:31:17 06/19/17.                                                                               
=====================================================================                                            
       BugCheck Dump                                                                                             
=====================================================================                                            

This file is generated by Microsoft SQL Server                                                                   
version 11.0.5058.0                                                                                              
upon detection of fatal unexpected error. Please return this file,                                               
the query or program that produced the bugcheck, the database and                                                
the error log, and any other pertinent information with a Service Request.                                       


Computer type is Intel(R) Xeon(R) CPU E5-4607 v2 @ 2.60GHz.                                                      
Bios Version is HP     - 2                                                                                       
48 X64 level 8664, 2 Mhz processor (s).                                                                          
Windows NT 6.2 Build 9200 CSD .                                                                                  

Memory                               
MemoryLoad = 99%                     
Total Physical = 131037 MB           
Available Physical = 235 MB          
Total Page File = 162458 MB          
Available Page File = 23377 MB       
Total Virtual = 8388607 MB           
Available Virtual = 8115635 MB       
**Dump thread - spid = 0, EC = 0x0000001566B37F40                                                                
*                                                                                                                
* User initiated stack dump.  This is not a server exception dump.                                               
*                                                                                                                
***Stack Dump being sent to F:\MSSQL11.OHREP\MSSQL\LOG\SQLDump0010.txt                                           
* *******************************************************************************                                
*                                                                                                                
* BEGIN STACK DUMP:                                                                                              
*   06/19/17 16:31:19 spid 2320                                                                                  
*                                                                                                                
* FIRST OCCURRENCE: Common Language Runtime escalation on critical resource.                                     
*                                                                                                                
* Input Buffer 78 bytes -                                                                                        
*       ܧ     SELECT dbo.fn_Guid() AS guid                                                                       
*                                                                                                                
*                                                                                                                
*  MODULE                          BASE      END       SIZE                                                      
* sqlservr                       000007F761250000  000007F7612A9FFF  0005a000                                    
* ntdll                          000007FEA1FE0000  000007FEA219DFFF  001be000                                    
* KERNEL32                       000007FE9F6C0000  000007FE9F7F6FFF  00137000                                    
* KERNELBASE                     000007FE9F060000  000007FE9F153FFF  000f4000                                    
* ADVAPI32                       000007FEA1B40000  000007FEA1C1DFFF  000de000                                    
* MSVCR100                       000000005DD60000  000000005DE31FFF  000d2000                                    
* MSVCP100                       000000005DCC0000  000000005DD57FFF  00098000                                    
* sqlos                          000000005B130000  000000005B136FFF  00007000                                    
* NETAPI32                       000007FE9D4E0000  000007FE9D4F4FFF  00015000                                    
* pdh                            000007FE95DA0000  000007FE95DEBFFF  0004c000 
  • opends60 000000005B040000 000000005B047FFF 00008000
  • sqlmin 000007FE72000000 000007FE73F4CFFF 01f4d000
  • sqllang 000007FE6E2B0000 000007FE70342FFF 02093000
  • sqlTsEs 000007FE79FF0000 000007FE7A876FFF 00887000
  • sqldk 000007FE76240000 000007FE766C0FFF 00481000
  • msvcrt 000007FEA0250000 000007FEA02F4FFF 000a5000
  • sechost 000007FE9FDF0000 000007FE9FE37FFF 00048000
  • RPCRT4 000007FEA1C20000 000007FEA1D64FFF 00145000
  • netutils 000007FE9DA60000 000007FE9DA6DFFF 0000e000
  • srvcli 000007FE9E950000 000007FE9E973FFF 00024000
  • wkscli 000007FE9DAC0000 000007FE9DAD4FFF 00015000
  • USER32 000007FE9F400000 000007FE9F54BFFF 0014c000
  • ole32 000007FE9F800000 000007FE9F97DFFF 0017e000
  • OLEAUT32 000007FE9FE40000 000007FE9FF02FFF 000c3000
  • CRYPT32 000007FE9F1D0000 000007FE9F3A0FFF 001d1000
  • Secur32 000007FE99DC0000 000007FE99DCAFFF 0000b000
  • PSAPI 000007FE9FDC0000 000007FE9FDC6FFF 00007000
  • WS2_32 000007FEA01F0000 000007FEA0247FFF 00058000
  • USERENV 000007FE9F1B0000 000007FE9F1CEFFF 0001f000
  • AUTHZ 000007FE9E1A0000 000007FE9E1E6FFF 00047000
  • WINTRUST 000007FE9EFD0000 000007FE9F024FFF 00055000
  • WINMM 000007FE99ED0000 000007FE99EEFFFF 00020000
  • GDI32 000007FEA04D0000 000007FEA0610FFF 00141000
  • combase 000007FE9FC10000 000007FE9FDBFFFF 001b0000
  • MSASN1 000007FE9EEE0000 000007FE9EEF5FFF 00016000
  • NSI 000007FE9F550000 000007FE9F558FFF 00009000
  • profapi 000007FE9EF00000 000007FE9EF14FFF 00015000
  • WINMMBASE 000007FE99E90000 000007FE99EC2FFF 00033000
  • SSPICLI 000007FE9EAB0000 000007FE9EADCFFF 0002d000
  • cfgmgr32 000007FE9F160000 000007FE9F1AEFFF 0004f000
  • DEVOBJ 000007FE9F030000 000007FE9F051FFF 00022000
  • LOGONCLI 000007FE9E650000 000007FE9E683FFF 00034000
  • SAMCLI 000007FE9EDE0000 000007FE9EDF5FFF 00016000
  • SOPHOS~2 00000000591F0000 0000000059228FFF 00039000
  • CRYPTBASE 000007FE9EC90000 000007FE9EC99FFF 0000a000
  • bcryptPrimitives 000007FE9EC30000 000007FE9EC8BFFF 0005c000
  • instapi110 000007FE95B40000 000007FE95B4DFFF 0000e000
  • CLUSAPI 000007FE999D0000 000007FE99A2EFFF 0005f000
  • cryptdll 000007FE9E7F0000 000007FE9E803FFF 00014000
  • RESUTILS 000007FE94EE0000 000007FE94F7CFFF 0009d000
  • cscapi 000007FE95EA0000 000007FE95EB0FFF 00011000
  • sqlevn70 0000000059420000 000000005969AFFF 0027b000
  • CRYPTSP 000007FE9E7D0000 000007FE9E7E9FFF 0001a000
  • rsaenh 000007FE9E390000 000007FE9E3DAFFF 0004b000
  • imagehlp 000007FE9FDD0000 000007FE9FDE3FFF 00014000
  • ncrypt 000007FE9E8D0000 000007FE9E8F6FFF 00027000
  • bcrypt 000007FE9E900000 000007FE9E924FFF 00025000
  • NTASN1 000007FE9E890000 000007FE9E8C4FFF 00035000
  • gpapi 000007FE9E0F0000 000007FE9E10EFFF 0001f000
  • ntmarta 000007FE9E1F0000 000007FE9E21DFFF 0002e000
  • VERSION 000007FE9D0A0000 000007FE9D0A8FFF 00009000
  • msv1_0 000007FE9E5F0000 000007FE9E642FFF 00053000
  • kerberos 000007FE9E6F0000 000007FE9E7BEFFF 000cf000
  • schannel 000007FE9E420000 000007FE9E488FFF 00069000
  • MSCOREE 000007FE990D0000 000007FE9913EFFF 0006f000
  • mscoreei 000007FE99030000 000007FE990C8FFF 00099000
  • security 000007FE98F10000 000007FE98F12FFF 00003000
  • clbcatq 000007FE9FF10000 000007FE9FFA5FFF 00096000
  • sqlncli11 000000005A5B0000 000000005A902FFF 00353000
  • COMCTL32 000007FE97680000 000007FE97723FFF 000a4000
  • COMDLG32 000007FEA1910000 000007FEA19B0FFF 000a1000
  • SHLWAPI 000007FE9F3B0000 000007FE9F3FFFFF 00050000
  • SHELL32 000007FEA0620000 000007FEA1901FFF 012e2000
  • SHCORE 000007FE9D1C0000 000007FE9D254FFF 00095000
  • SQLNCLIR11 000000005A570000 000000005A5A7FFF 00038000
  • DPAPI 000007FE9DB50000 000007FE9DB57FFF 00008000
  • netbios 000007FE90300000 000007FE90309FFF 0000a000
  • clr 000007FE8CAF0000 000007FE8D45AFFF 0096b000
  • MSVCR110_CLR0400 000007FE8DDB0000 000007FE8DE81FFF 000d2000
  • mscorlib.ni 000007FE89C10000 000007FE8B209FFF 015fa000
  • SqlAccess 0000000055E40000 0000000055EACFFF 0006d000
  • clrjit 000007FE85D50000 000007FE85E80FFF 00131000
  • BatchParser 000000005AB70000 000000005AB9AFFF 0002b000
  • ftimport 00000000591A0000 00000000591C4FFF 00025000
  • MSFTE 000000005B340000 000000005B6EDFFF 003ae000
  • dbghelp 000000005B6F0000 000000005B885FFF 00196000
  • mswsock 000007FE9E690000 000007FE9E6EBFFF 0005c000
  • ntdsapi 000007FE9D500000 000007FE9D523FFF 00024000
  • DSPARSE 000007FE999C0000 000007FE999CAFFF 0000b000
  • DNSAPI 000007FE9E490000 000007FE9E52BFFF 0009c000
  • rasadhlp 000007FE997D0000 000007FE997D7FFF 00008000
  • IPHLPAPI 000007FE9AFA0000 000007FE9AFC9FFF 0002a000
  • WINNSI 000007FE9AF90000 000007FE9AF99FFF 0000a000
  • fwpuclnt 000007FE9AE20000 000007FE9AE80FFF 00061000
  • ncryptsslp 000007FE997B0000 000007FE997C8FFF 00019000
  • DSROLE 000007FE9D260000 000007FE9D268FFF 00009000
  • Sort00060101 000007FE97BB0000 000007FE97BC2FFF 00013000
  • Sort00001000 000007FE914A0000 000007FE91574FFF 000d5000
  • System.ni 000007FE88F40000 000007FE89C06FFF 00cc7000
  • System.Data 000007FE797F0000 000007FE79B0DFFF 0031e000
  • System.Transactions 000007FE8BAE0000 000007FE8BB28FFF 00049000
  • System.Security.ni 000007FE6B8A0000 000007FE6B98CFFF 000ed000
  • System.Xml.ni 000007FE83980000 000007FE84341FFF 009c2000
  • xpsqlbot 00000029D0C10000 00000029D0C17FFF 00008000
  • xpstar 00000029D0C30000 00000029D0C9FFFF 00070000
  • ATL100 00000029D0CB0000 00000029D0CDAFFF 0002b000
  • SQLSCM 00000029D0CE0000 00000029D0CEEFFF 0000f000
  • ODBC32 000007FE95820000 000007FE958DDFFF 000be000
  • xpstar 00000029D0F50000 00000029D0F74FFF 00025000
  • xplog70 00000029D0F80000 00000029D0F93FFF 00014000
  • BROWCLI 000007FE974A0000 000007FE974B1FFF 00012000
  • xplog70 00000029D0EC0000 00000029D0EC2FFF 00003000
  • COMRES 000007FE80F40000 000007FE8107DFFF 0013e000
  • XOLEHLP 000007FE811C0000 000007FE811D4FFF 00015000
  • MSDTCPRX 000007FE912F0000 000007FE913B8FFF 000c9000
  • MTXCLU 000007FE91580000 000007FE915E4FFF 00065000
  • ktmw32 000007FE9D090000 000007FE9D099FFF 0000a000
  • System 00000029D4C10000 00000029D4F61FFF 00352000
  • System.Security 00000029D3910000 00000029D3955FFF 00046000
  • System.Xml 00000029D52D0000 00000029D5563FFF 00294000
  • WLDAP32 000007FEA1F80000 000007FEA1FDDFFF 0005e000
  • SAMLIB 000007FE9A1F0000 000007FE9A20CFFF 0001d000
  • sqlvdi 0000000024DD0000 0000000024DF9FFF 0002a000
  • dbghelp 00000029CD430000 00000029CD5C5FFF 00196000
    • P1Home: 00000029E6094960: 0000000000000000 0000000000000007 0000000000C20000 0000000000000070 00000000 0000005E 000007FEA1FE5710
  • P2Home: 0000000000000042:
  • P3Home: 0000000000000000:
  • P4Home: 0000000000000000:
  • P5Home: 0000000000D202B8: 0107000801060007 0109000A01080009 010B000C010A000B 010D000E000C000D 010F0010 000E000F 0011001201100011
  • P6Home: 000007FE6E2BCBF8: 004D515E880FC085 53870FC73B489848 40A037840F004D51 C38B30247C8B4800 90C35B5E 38C48348 000007FE6F145F50
  • ContextFlags: 000000000010004F: 0007FE763FC2C000 0000000000000000 0000000000000000 0000000000000000 000000 0000000000 0000000000000000
  • MxCsr: 0000000000001FA0:
  • SegCs: 0000000000000033:
  • SegDs: 000000000000002B:
  • SegEs: 000000000000002B:
  • SegFs: 0000000000000053:
  • SegGs: 000000000000002B:
  • SegSs: 000000000000002B:
  • EFlags: 0000000000000202:
  • Rax: 0000000000000070:
  • Rcx: 000000000000005E:
  • Rdx: 000007FEA1FE5710: 4100000108C48148 9090C35B5E5E415F 9090909090909090 9090909090909090 44894C20 244C8944 5441575655531824
  • Rbx: 0000000000000000:
  • Rsp: 00000029E6094F10: 0000000000000000 0000000000000000 0000001566B37F40 00000029E60951A0 00000000 000042AC 0000000000000000
  • Rbp: 00000029E6097010: 0000000000000004 00000014AC32B1A0 0000000000000000 000007FE8CB4C56E 00000029 E60970F0 0000000000000000
  • Rsi: 0000001566B37F40: 0000001566B37F40 0000001566B37020 0000000000000000 0000000000000000 00000015 66B37F60 0000001566B37F60
  • Rdi: 00000029E60951A0: 0000000002F130D0 0000000000000000 0000000000000000 0000000000000000 00000000 00000000 0000000000000000
  • R8: 00000029E6094AF1: 3635313030303030 0030344637334236 0000000000000000 0000000000000000 00000000 00000000 0000000000000000

    • R9: 0000000000000002:
    • R10: 0000000000000000:
    • R11: 0000005400000100:
    • R12: 0000000000000001:
    • R13: 0000000000000001:
    • R14: 0000000000000000:
    • R15: 00000000000005BF:
    • Rip: 000007FE9F0A7B8C: 000000C0248C8B48 FFFB9954E8CC3348 C3000000D8C48148 CCD6EB0038246483 90909090 90909090 8D485508245C8948



    • Short Stack Dump
      000007FE9F0A7B8C Module(KERNELBASE+0000000000047B8C)
      000007FE6F43A01E Module(sqllang+000000000118A01E)
      000007FE6F43EF13 Module(sqllang+000000000118EF13)
      000007FE6EC405F4 Module(sqllang+00000000009905F4)
      000007FE6EC701AF Module(sqllang+00000000009C01AF)
      000007FE6EC6FDA0 Module(sqllang+00000000009BFDA0)
      000007FE8CE8DE05 Module(clr+000000000039DE05)
      000007FE8CE8DC72 Module(clr+000000000039DC72)
      000007FE8CE8E2DA Module(clr+000000000039E2DA)
      000007FE8CE9A78B Module(clr+00000000003AA78B)
      000007FE8CD344D1 Module(clr+00000000002444D1)
      000007FE8CAF1AFA Module(clr+0000000000001AFA)
      000007FE8CB4C4F3 Module(clr+000000000005C4F3)
      000007FE8CB4C56E Module(clr+000000000005C56E)
      000007FE8CB4F8B7 Module(clr+000000000005F8B7)
      000007FE8CB4F892 Module(clr+000000000005F892)
      000007FE8CB4FA3C Module(clr+000000000005FA3C)
      000007FE8CB4F917 Module(clr+000000000005F917)
      000007FE8CB4F109 Module(clr+000000000005F109)
      000007FE8CB51681 Module(clr+0000000000061681)
      000007FE2DC89FCD Module(UNKNOWN+0000000000000000)
      000007FE2DD747B8 Module(UNKNOWN+0000000000000000)
      000000290000000A Module(UNKNOWN+0000000000000000)

Here is the eventlog error:

The computer has rebooted from a bugcheck. 
The bugcheck was: 0x0000007a (0xfffff8a019eda6c0, 0xffffffffc000026e, 0x000000097e44b8c0, 0xfffff880196d8060). 
A dump was saved in: C:\Windows\MEMORY.DMP. 
Report Id: 061917-61343-01                       

Here is the function code:

CREATE FUNCTION [dbo].[fn_Guid]() 
RETURNS [uniqueidentifier] WITH EXECUTE AS CALLER 
AS EXTERNAL NAME 
[Gcs.Sys.Data.DatabaseAssembly].[UserDefinedFunctions].[NewS‌​equentialId]

Does anyone encountered this?

Thanks, Joel

sql-server
sql-server-2012
asked on Stack Overflow Jun 20, 2017 by Joel • edited Jun 20, 2017 by Steve Ford

1 Answer

1

It looks like you may have a memory bug in your CLR function [Gcs.Sys.Data.DatabaseAssembly].[UserDefinedFunctions].[NewS‌​equentialId]. I'm not sure why you are using a CLR function to get a new sequential GUID rather than the built in NEWSEQUENTIALID() SQL Server function:

Why not use:

SELECT NEWSEQUENTIALID() AS Guid
answered on Stack Overflow Jun 20, 2017 by Steve Ford

User contributions licensed under CC BY-SA 3.0