none
[bug] Bulk Insert SQL Server 2017 CU16 / Access Violation exception error RRS feed

  • Question

  • After updating our SQL Server 2017 instances to CU16, we have problems using the Bulk Insert command.
    The problem was noticed in SSIS ETL processes. Suddenly "fast load" for Ole Db targets didn't work anymore. On closer inspection, we noticed that the Bulk Insert command from a simple CSV file leads to the same behavior.

    Even though the Bulk Insert command, or SSIS ETLs with "fast load" Ole Db targets, worked before, we checked if it might be a permission problem.
    As administrator (local Windows administrator and SQL Server sysadmin) the error also occurred. Nevertheless we gave the service account of the SQL Server temporary local administrator rights and sysadmin rights on the SQL Server, because the bulk insert can lead to a delegation of the rights: 
    "If a user uses a SQL Server login, the security profile of the SQL Server process account is used. A login using SQL Server authentication cannot be authenticated outside of the Database Engine. Therefore, when a BULK INSERT command is initiated by a login using SQL Server authentication, the connection to the data is made using the security context of the SQL Server process account (the account used by the SQL Server Database Engine service)."

    However, this scenario does not really apply to us because we do not use SQL Server logins and only use Windows authentication.

    Symptoms
    When the Bulk Insert command 

    BULK INSERT DB.dbo.some_table FROM 'C:\some_file.csv'WITH ( FORMAT='CSV');

    is used, the process is aborted.

    Msg 596, Level 21, State 1, Line 0
    Execution cannot continue because the session has KILL status.
    Msg 0, Level 20, State 0, Line 0
    A severe error occurred on the current command.  The results, if any, should be discarded.

    a dump file is created which refers to an Access Violation exception error:

    SqlDumpExceptionHandler: Process 69 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is 
    terminating this process.                                                                                        
    * *******************************************************************************                                
    *                                                                                                                
    * BEGIN STACK DUMP:                                                                                              
    *   09/13/19 14:37:34 spid 69                                                                                    
    *                                                                                                                
    *                                                                                                                
    *   Exception Address = 00007FFCAC119D06 Module(sqlmin+0000000000929D06)                                         
    *   Exception Code    = c0000005 EXCEPTION_ACCESS_VIOLATION                                                      
    *   Access Violation occurred reading address 0000000000000000                                                   
    * Input Buffer 208 bytes -                                                                                       
    *             BULK INSERT some_table  FROM 'D:\some_file.csv'  WITH ( FORMAT='CSV');                                                                              
    *                                                                                                                
    *                                                                                                                
    *  MODULE                          BASE      END       SIZE                                                      
    * sqlservr                       00007FF791DA0000  00007FF791E1EFFF  0007f000                                    
    * ntdll                          00007FFCBAD80000  00007FFCBAF6CFFF  001ed000                                    
    * KERNEL32                       00007FFCB9400000  00007FFCB94B2FFF  000b3000                                    
    * KERNELBASE                     00007FFCB7590000  00007FFCB7822FFF  00293000                                    
    * ADVAPI32                       00007FFCBACA0000  00007FFCBAD42FFF  000a3000                                    
    * msvcrt                         00007FFCB88E0000  00007FFCB897DFFF  0009e000                                    
    * sechost                        00007FFCB8F70000  00007FFCB900DFFF  0009e000                                    
    * RPCRT4                         00007FFCB92C0000  00007FFCB93E1FFF  00122000                                    
    * ole32                          00007FFCB9160000  00007FFCB92B4FFF  00155000                                    
    * combase                        00007FFCB8980000  00007FFCB8CABFFF  0032c000                                    
    * ucrtbase                       00007FFCB7BF0000  00007FFCB7CE9FFF  000fa000                                    
    * bcryptPrimitives               00007FFCB7AD0000  00007FFCB7B4DFFF  0007e000                                    
    * GDI32                          00007FFCB90A0000  00007FFCB90C8FFF  00029000                                    
    * gdi32full                      00007FFCB78E0000  00007FFCB7A78FFF  00199000                                    
    * msvcp_win                      00007FFCB7B50000  00007FFCB7BEFFFF  000a0000                                    
    * USER32                         00007FFCB94C0000  00007FFCB9656FFF  00197000                                    
    * win32u                         00007FFCB7DA0000  00007FFCB7DBFFFF  00020000                                    
    * NETAPI32                       00007FFCB04A0000  00007FFCB04B6FFF  00017000                                    
    * pdh                            00007FFCB2C20000  00007FFCB2C6CFFF  0004d000                                    
    * SQLOS                          00007FFCAEEB0000  00007FFCAEEB6FFF  00007000                                    
    * sqlmin                         00007FFCAB7F0000  00007FFCAE9ECFFF  031fd000                                    
    * sqlTsEs                        00007FFCAADD0000  00007FFCAB6FEFFF  0092f000                                    
    * OLEAUT32                       00007FFCB8D70000  00007FFCB8E33FFF  000c4000                                    
    * CRYPT32                        00007FFCB7DC0000  00007FFCB7F9AFFF  001db000                                    
    * MSASN1                         00007FFCB6E20000  00007FFCB6E31FFF  00012000                                    
    * WS2_32                         00007FFCB90D0000  00007FFCB913CFFF  0006d000                                    
    * opends60                       00007FFCAEE70000  00007FFCAEE78FFF  00009000                                    
    * sqldk                          00007FFCA8140000  00007FFCA863BFFF  004fc000                                    
    * sqllang                        00007FFCA8640000  00007FFCAADC1FFF  02782000                                    
    * qds                            00007FFCA8010000  00007FFCA813DFFF  0012e000                                    
    * svl                            00007FFCA7FE0000  00007FFCA800DFFF  0002e000                                    
    * MSVCP120                       00007FFCAFA00000  00007FFCAFAA5FFF  000a6000                                    
    * MSVCR120                       00007FFCB0600000  00007FFCB06EEFFF  000ef000                                    
    * Secur32                        00007FFCB15E0000  00007FFCB15EBFFF  0000c000                                    
    * WINHTTP                        00007FFCB2930000  00007FFCB2A21FFF  000f2000                                    
    * ODBC32                         00007FFCAF040000  00007FFCAF0F3FFF  000b4000                                    
    * WINMM                          00007FFCB0310000  00007FFCB0333FFF  00024000                                    
    * secforwarder                   00007FFCAEEA0000  00007FFCAEEA9FFF  0000a000                                    
    * bcrypt                         00007FFCB7A80000  00007FFCB7AA5FFF  00026000                                    
    * WINTRUST                       00007FFCB7D40000  00007FFCB7D98FFF  00059000                                    
    * WINMMBASE                      00007FFCB02B0000  00007FFCB02DCFFF  0002d000                                    
    * cfgmgr32                       00007FFCB7CF0000  00007FFCB7D39FFF  0004a000                                    
    * XOLEHLP                        00007FFCAEE80000  00007FFCAEE96FFF  00017000                                    
    * ncrypt                         00007FFCB6850000  00007FFCB6875FFF  00026000                                    
    * NETUTILS                       00007FFCB63B0000  00007FFCB63BDFFF  0000e000                                    
    * USERENV                        00007FFCB6CA0000  00007FFCB6CC7FFF  00028000                                    
    * profapi                        00007FFCB6D70000  00007FFCB6D93FFF  00024000                                    
    * DPAPI                          00007FFCB5350000  00007FFCB5359FFF  0000a000                                    
    * AUTHZ                          00007FFCB5EE0000  00007FFCB5F2AFFF  0004b000                                    
    * dhcpcsvc                       00007FFCB3310000  00007FFCB332BFFF  0001c000                                    
    * XmlLite                        00007FFCB0B40000  00007FFCB0B79FFF  0003a000                                    
    * NSI                            00007FFCB93F0000  00007FFCB93F7FFF  00008000                                    
    * NTASN1                         00007FFCB6810000  00007FFCB684BFFF  0003c000                                    
    * SSPICLI                        00007FFCB6C70000  00007FFCB6C9EFFF  0002f000                                    
    * SAMCLI                         00007FFCB32F0000  00007FFCB3307FFF  00018000                                    
    * WININET                        00007FFCA6EB0000  00007FFCA7390FFF  004e1000                                    
    * LOGONCLI                       00007FFCB63C0000  00007FFCB63FFFFF  00040000                                    
    * psapi                          00007FFCB8D60000  00007FFCB8D67FFF  00008000                                    
    * kernel.appcore                 00007FFCB6E00000  00007FFCB6E10FFF  00011000                                    
    * instapi140                     00007FFCA6370000  00007FFCA6382FFF  00013000                                    
    * CRYPTSP                        00007FFCB7AB0000  00007FFCB7AC6FFF  00017000                                    
    * rsaenh                         00007FFCB61A0000  00007FFCB61D2FFF  00033000                                    
    * CRYPTBASE                      00007FFCB6750000  00007FFCB675BFFF  0000c000                                    
    * imagehlp                       00007FFCB9140000  00007FFCB915CFFF  0001d000                                    
    * gpapi                          00007FFCB5AF0000  00007FFCB5B11FFF  00022000                                    
    * wkscli                         00007FFCB3470000  00007FFCB3486FFF  00017000                                    
    * cscapi                         00007FFCA5DC0000  00007FFCA5DD1FFF  00012000                                    
    * sqlevn70                       00000201A5160000  00000201A546EFFF  0030f000                                    
    * CLUSAPI                        00007FFCAEEC0000  00007FFCAEFC5FFF  00106000                                    
    * DNSAPI                         00007FFCB62E0000  00007FFCB63A5FFF  000c6000                                    
    * IPHLPAPI                       00007FFCB62A0000  00007FFCB62DCFFF  0003d000                                    
    * RESUTILS                       00007FFCAF150000  00007FFCAF1EDFFF  0009e000                                    
    * VERSION                        00007FFCB16B0000  00007FFCB16B9FFF  0000a000                                    
    * hkruntime                      00007FFCA3E70000  00007FFCA4140FFF  002d1000                                    
    * dbghelp                        0000000068D50000  0000000068EE5FFF  00196000                                    
    * hkcompile                      00007FFCA3D00000  00007FFCA3E61FFF  00162000                                    
    * SHLWAPI                        00007FFCB8650000  00007FFCB86A1FFF  00052000                                    
    * hkengine                       00007FFCA35F0000  00007FFCA3CFAFFF  0070b000                                    
    * ncryptprov                     00007FFCB1610000  00007FFCB1669FFF  0005a000                                    
    * msv1_0                         00007FFCB6500000  00007FFCB6576FFF  00077000                                    
    * NtlmShared                     00007FFCB64F0000  00007FFCB64FCFFF  0000d000                                    
    * cryptdll                       00007FFCB65F0000  00007FFCB6604FFF  00015000                                    
    * kerberos                       00007FFCB6640000  00007FFCB6744FFF  00105000                                    
    * schannel                       00007FFCB6110000  00007FFCB6194FFF  00085000                                    
    * SECURITY                       0000020534350000  0000020534352FFF  00003000                                    
    * MSCOREE                        00007FFCAEA60000  00007FFCAEAC3FFF  00064000                                    
    * mscoreei                       00007FFCAB750000  00007FFCAB7EBFFF  0009c000                                    
    * SqlServerSpatial140            00007FFCA28A0000  00007FFCA2951FFF  000b2000                                    
    * clbcatq                        00007FFCB9660000  00007FFCB9701FFF  000a2000                                    
    * msxml3                         00007FFCA1460000  00007FFCA169AFFF  0023b000                                    
    * sqlncli11                      00007FFCA1100000  00007FFCA1452FFF  00353000                                    
    * COMDLG32                       00007FFCB8E40000  00007FFCB8F66FFF  00127000                                    
    * COMCTL32                       00007FFCA1050000  00007FFCA10F8FFF  000a9000                                    
    * shcore                         00007FFCB8CB0000  00007FFCB8D57FFF  000a8000                                    
    * SHELL32                        00007FFCB97A0000  00007FFCBAC91FFF  014f2000                                    
    * windows.storage                00007FFCB6E40000  00007FFCB7589FFF  0074a000                                    
    * powrprof                       00007FFCB6DA0000  00007FFCB6DFCFFF  0005d000                                    
    * MSVCR100                       0000000068BF0000  0000000068CC1FFF  000d2000                                    
    * SQLNCLIR11                     0000020536600000  0000020536637FFF  00038000                                    
    * netbios                        00007FFCA1040000  00007FFCA104BFFF  0000c000                                    
    * sqlnclirda11                   0000000068890000  0000000068BE8FFF  00359000                                    
    * sqlevn70                       0000020537470000  000002053782AFFF  003bb000                                    
    * SQLNCLIRDAR11                  0000020536640000  0000020536677FFF  00038000                                    
    * ualapi                         00007FFCA1020000  00007FFCA1039FFF  0001a000                                    
    * ESENT                          00007FFCAEB40000  00007FFCAEE66FFF  00327000                                    
    * ntmarta                        00007FFCB5F30000  00007FFCB5F60FFF  00031000                                    
    * clr                            00007FFCA75F0000  00007FFCA7FDDFFF  009ee000                                    
    * MSVCR120_CLR0400               00007FFCA73C0000  00007FFCA74B6FFF  000f7000                                    
    * clrjit                         00007FFCA6530000  00007FFCA665AFFF  0012b000                                    
    * SqlAccess                      00007FFCA0FA0000  00007FFCA1014FFF  00075000                                    
    * BatchParser                    00007FFCA09D0000  00007FFCA09FBFFF  0002c000                                    
    * SRVCLI                         00007FFCA5F70000  00007FFCA5F95FFF  00026000                                    
    * dhcpcsvc6                      00007FFCB33B0000  00007FFCB33C5FFF  00016000                                    
    * mskeyprotect                   00007FFCA5E50000  00007FFCA5E64FFF  00015000                                    
    * mswsock                        00007FFCB6580000  00007FFCB65E6FFF  00067000                                    
    * ntdsapi                        00007FFCB05D0000  00007FFCB05F7FFF  00028000                                    
    * DSPARSE                        00007FFCB2350000  00007FFCB235CFFF  0000d000                                    
    * rasadhlp                       00007FFCAF840000  00007FFCAF849FFF  0000a000                                    
    * fwpuclnt                       00007FFCB33F0000  00007FFCB3468FFF  00079000                                    
    * ncryptsslp                     00007FFCA5F30000  00007FFCA5F53FFF  00024000                                    
    * xpsqlbot                       00007FFCA05B0000  00007FFCA05B7FFF  00008000                                    
    * xpstar                         00007FFCA0540000  00007FFCA05ADFFF  0006e000                                    
    * SQLSCM                         00007FFCA0740000  00007FFCA0752FFF  00013000                                    
    * xpstar                         0000020538860000  000002053886EFFF  0000f000                                    
    * Sort00060101                   00007FFCB1B10000  00007FFCB1B22FFF  00013000                                    
    * System.Data                    00007FFC9F850000  00007FFC9FBB5FFF  00366000                                    
    * System.Transactions            00007FFC9F780000  00007FFC9F7CEFFF  0004f000                                    
    * wldp                           00007FFCB67E0000  00007FFCB6804FFF  00025000                                    
    * instapi                        0000000048060000  000000004806CFFF  0000d000                                    
    * MSVCR80                        0000000068620000  00000000686E8FFF  000c9000                                    
    * xplog70                        00007FFCB2260000  00007FFCB2273FFF  00014000                                    
    * xplog70                        000002053AB80000  000002053AB83FFF  00004000                                    
    * SAMLIB                         00007FFCB02E0000  00007FFCB0302FFF  00023000                                    
    * dbghelp                        0000000069250000  00000000693E5FFF  00196000                                    
    *                                                                                                                
    *     P1Home: 000002039DAD9250:  0000000000000000  000002039D9E3401  0000000000000000  000002039DA93A43  00000203
    9DAD92C0  0000000000000003                                                                                       
    *     P2Home: 00000027485FC8C0:  000000000000027F  0000000000000000  0000000000000000  0000FFFF00001FA8  00000000
    00000000  0000000000000000                                                                                       
    *     P3Home: 000002036ECCA0A0:  00007FFCAD4BDF30  00007FFCAD476F10  0000000100000001  000002036ECCA0B8  00000203
    6ECCA0B8  0000000000000001                                                                                       
    *     P4Home: 0000000000000008:                                                                                  
    *     P5Home: 000002067B0F5266:                                                                                  
    *     P6Home: 00007FFCA8142790:  00000928249C8B48  41000008D0C48148  5F5C415D415E415F  9090909090C35D5E  44C74850
    EC834857  8948FFFFFFFE2024                                                                                       
    * ContextFlags: 000000000010005F:                                                                                
    *      MxCsr: 0000000000001FA8:                                                                                  
    *      SegCs: 0000000000000033:                                                                                  
    *      SegDs: 000000000000002B:                                                                                  
    *      SegEs: 000000000000002B:                                                                                  
    *      SegFs: 0000000000000053:                                                                                  
    *      SegGs: 000000000000002B:                                                                                  
    *      SegSs: 000000000000002B:                                                                                  
    *     EFlags: 0000000000010202:                                                                                  
    *        Rax: 000002036EB370C0:  00007FFCAD48DC98  0000000300000019  2121212021212120  2121212100000000  00000000
    00000000  2121000101000000                                                                                       
    *        Rcx: 0000000000000000:                                                                                  
    *        Rdx: 000002036ECCAB40:  2121212121212121  2121212121212121  2121212121212121  2121212121212121  21212121
    21212121  2121212121212121                                                                                       
    *        Rbx: 000002036ECCA0A0:  00007FFCAD4BDF30  00007FFCAD476F10  0000000100000001  000002036ECCA0B8  00000203
    6ECCA0B8  0000000000000001                                                                                       
    *        Rsp: 00000027485FD620:  0000000000000000  00007FFCAC113126  000002036ECCA0A0  000002036EB370C0  00000000
    00000000  000002036ECCAAB0                                                                                       
    *        Rbp: FFFFFFFFFFFFFFFF:                                                                                  
    *        Rsi: 0000000000000001:                                                                                  
    *        Rdi: 000002036ECCA0A0:  00007FFCAD4BDF30  00007FFCAD476F10  0000000100000001  000002036ECCA0B8  00000203
    6ECCA0B8  0000000000000001                                                                                       
    *         R8: 0000000000000010:                                                                                  
    *         R9: 000000000000044E:                                                                                  
    *        R10: 000002036ECBA060:  00007FFCA82EB650  2121212100000001  0000000000002000  212121210000008D  00000203
    5D14CB00  2121212100000008                                                                                       
    *        R11: 000002036ECCA700:  0000000000000000  0000000000000000  0000000000000000  0000000000000000  00000000
    00000000  0000000000000000                                                                                       
    *        R12: 000002036ECCA418:  000002036ECBA060  2121212100000000  0000000000000000  0000000000000000  00000000
    00000000  0000000000000000                                                                                       
    *        R13: 000002036ECBB1D0:  000002036ECBA060  0000000000000000  2121212100000000  0000000000000000  00000000
    00000000  0000000000000000                                                                                       
    *        R14: 0000000000000000:                                                                                  
    *        R15: 0000020360F6CBC0:  00007FFCAD48B558  000000000000000E  2121212021212120  2121212100000001  00000203
    60F6CDF0  2121000100000000                                                                                       
    *        Rip: 00007FFCAC119D06:  FF48578B48018B48  0002088789481050  888B4840478B4800  FF018B48000001A0  00020087
    89481850  888B4840478B4800                                                                                       
    * *******************************************************************************                                
    * -------------------------------------------------------------------------------                                
    * Short Stack Dump                                                                                               
    00007FFCAC119D06 Module(sqlmin+0000000000929D06)                                                                 
    00007FFCAC116075 Module(sqlmin+0000000000926075)                                                                 
    00007FFCAC115F26 Module(sqlmin+0000000000925F26)                                                                 
    00007FFCAB835203 Module(sqlmin+0000000000045203)                                                                 
    00007FFCAB9056B9 Module(sqlmin+00000000001156B9)                                                                 
    00007FFCAB904E10 Module(sqlmin+0000000000114E10)                                                                 
    00007FFCAB8F9F50 Module(sqlmin+0000000000109F50)                                                                 
    00007FFCAB8F9DC8 Module(sqlmin+0000000000109DC8)                                                                 
    00007FFCAB838025 Module(sqlmin+0000000000048025)                                                                 
    00007FFCAB838786 Module(sqlmin+0000000000048786)                                                                 
    00007FFCAB838580 Module(sqlmin+0000000000048580)                                                                 
    00007FFCA865294E Module(sqllang+000000000001294E)                                                                
    00007FFCA8652CD4 Module(sqllang+0000000000012CD4)                                                                
    00007FFCA8656092 Module(sqllang+0000000000016092)                                                                
    00007FFCA867073F Module(sqllang+000000000003073F)                                                                
    00007FFCA92BE391 Module(sqllang+0000000000C7E391)                                                                
    00007FFCA92BE509 Module(sqllang+0000000000C7E509)                                                                
    00007FFCA86546C0 Module(sqllang+00000000000146C0)                                                                
    00007FFCA8654123 Module(sqllang+0000000000014123)                                                                
    00007FFCA8653764 Module(sqllang+0000000000013764)                                                                
    00007FFCA865D9DD Module(sqllang+000000000001D9DD)                                                                
    00007FFCA865BEF2 Module(sqllang+000000000001BEF2)                                                                
    00007FFCA865BCE3 Module(sqllang+000000000001BCE3)                                                                
    00007FFCA81453CD Module(sqldk+00000000000053CD)                                                                  
    00007FFCA8145018 Module(sqldk+0000000000005018)                                                                  
    00007FFCA8144E0D Module(sqldk+0000000000004E0D)                                                                  
    00007FFCA8168C48 Module(sqldk+0000000000028C48)                                                                  
    00007FFCA8169190 Module(sqldk+0000000000029190)                                                                  
    00007FFCA8168387 Module(sqldk+0000000000028387)                                                                  
    00007FFCA81688D9 Module(sqldk+00000000000288D9)                                                                  
    00007FFCB9417974 Module(KERNEL32+0000000000017974)                                                               
    00007FFCBADEA271 Module(ntdll+000000000006A271)                           
    
    CSession @0x000002035DA50780
    ----------------------------
    m_sessionId = 69                     m_cRef = 12                          m_rgcRefType[0] = 1                    
    m_rgcRefType[1] = 1                  m_rgcRefType[2] = 9                  m_rgcRefType[3] = 1                    
    m_rgcRefType[4] = 0                  m_rgcRefType[5] = 0                  m_pmo = 0x000002035DA50040             
    m_pstackBhfPool = 0x0000000000000000 m_dwLoginFlags = 0x100083e0          m_fBackground = 0                      
    m_eConnResetOption = 0               m_fUserProc = 1                      m_fConnReset = 0                       
    m_fIsConnReset = 0                   m_fInLogin = 0                       m_fAuditLoginSent = 1                  
    m_fAuditLoginFailedSent = 0          m_fReplRelease = 0                   m_fKill = 0                            
    m_ulLoginStamp = 12254               m_eclClient = 7                      m_protType = 5                         
    
    
    CUEnvTransient @0x000002035DA50C60
    ----------------------------------
    m_ululRowcount = 1                   m_cidLastOpen = 0                    m_lFetchStat = 0                       
    m_lRetStat = 0                       m_lLastError = 0                     m_lPrevError = 0                       
    m_cNestLevel = 0                     m_lHoldRand1 = 0                     m_lHoldRand2 = 0                       
    m_cbContextInfo = 0                  m_rgbContextInfo = 000002035DA50E5C  
    
    CDbAndSetOpts @0x000002035DA50C80
    ---------------------------------
    m_fHasDbRef = 0                      m_fDateFirstSet = 0                  m_fDateFormatSet = 0                   
    m_lUserOpt1 = 0x14817000             m_lUserOpt2 = 0x40                   m_lUserOpt1SetMask = 0xfffff7f7        
    m_idtInsert.objid = 0                m_idtInsert.state = 0                m_idtInsert.dbid = 0                   
    m_llRowcnt = 0                       m_lStatList = 0                      m_lTextSize = 2147483647               
    m_lOffsets = 0x0                     m_ulLockTimeout = 4294967295         m_ulQueryGov = 0                       
    m_eDtFmt = 2                         m_eDayDateFirst = 1                  m_eDdLckPri = 0                        
    m_eIsoLvl = 2                        m_eFipsFlag = 0x0                    m_sLangId = 1                          
    
    
    m_pV7LoginRec
    ---------------------
    0000000000000000:   1c090000 04000074 00100000 00000006 582c0000  .	.....t........X,..                           
    
    0000000000000014:   00000000 e0830010 00000000 00000000 5e000800  ....àƒ..........^...                           
    
    0000000000000028:   00000000 00000000 6e002e00 ca000800 da000400  ........n...Ê...Ú...                           
    
    000000000000003C:   de001c00 16010000 16010500 a2e9ec0e 4f302001  Þ...........¢éì.O0 .                           
    
    0000000000000050:   eb070b09 00000b09 00000000 0000               ë..	...	......                                 
    
    
    
    
    CPhysicalConnection @0x000002035DA503D0
    ---------------------------------------
    m_pPhyConn->m_pmo = 0x000002035DA50040                                                                           
    m_pPhyConn->m_pNetConn = 0x000002035DA51040                                                                      
    m_pPhyConn->m_pConnList = 0x000002035DA50750                                                                     
    m_pPhyConn->m_pSess = 0x000002035DA507D8                                  m_pPhyConn->m_fTracked = -1            
    m_pPhyConn->m_cbPacketsize = 4096    m_pPhyConn->m_fMars = 0              m_pPhyConn->m_fKill = 0                
    
    
    CBatch @0x000002035DA51C80
    --------------------------
    m_pSess = 0x000002035DA50780         m_pConn = 0x000002035DA51680         m_cRef = 3                             
    m_rgcRefType[0] = 1                  m_rgcRefType[1] = 1                  m_rgcRefType[2] = 1                    
    m_rgcRefType[3] = 0                  m_rgcRefType[4] = 0                  m_pTask = 0x00000203770404E8           
    
    
    EXCEPT (null) @0x00000027485F9A78
    ---------------------------------
    exc_number = 0                       exc_severity = 0                     exc_func = sqldk.dll+0x000000000005D4F0
    
    
    
    Task @0x00000203770404E8
    ------------------------
    CPU Ticks used (ms) = 6              Task State = 2                                                              
    WAITINFO_INTERNAL: WaitResource = 0x0000000000000000                      WAITINFO_INTERNAL: WaitType = 0x0      
    WAITINFO_INTERNAL: WaitSpinlock = 0x0000000000000000                      SchedulerId = 0x0                      
    ThreadId = 0x10c8                    m_state = 0                          m_eAbortSev = 0                        
    
    
    
    EC @0x000002035DA69E00
    ----------------------
    spid = 0                             ecid = 0                             ec_stat = 0x0                          
    ec_stat2 = 0x0                       ec_atomic = 0x0                      ecType = 0                             
    __pSETLS = 0x000002035DA516F0        __pSEParams = 0x000002035DA51E30     
    
    SEInternalTLS @0x000002035DA516F0
    ---------------------------------
    m_activeHeapDatasetList = 0x000002035DA51B00                                                                     
    m_activeIndexDatasetList = 0x000002035DA51B10                             m_flags = 0                            
    m_TLSstatus = 3                      m_CriticalOpDbId = 65535             m_CloudHostDbId = 65535                
    m_RestoringDbId = 65535              m_RestoreTargetDbId = 0              m_noLockScanCount = 0                  
    m_readonlyDatabaseScan = false       m_inCatchupRedo = false                                                     
    m_pBulkOpLockNotification = 0x0000000000000000                            m_pDbccContext = 0x0000000000000000    
    m_pCompressionContext = 0x0000000000000000                                                                       
    m_pRetentionCleanupContext = 0x0000000000000000                           m_pAllocFileLimit = 0x0000000000000000 
    m_dekInstanceIndex = 0x-1            m_pImbiContext = 0x0000000000000000                                         
    m_pNcciThreadContext = 0x0000000000000000                                 
    
    SEParams @0x000002035DA51E30
    ----------------------------
    	m_lockTimeout = -1                  	m_isoLevel = 4096                   	m_logDontReplicate = 0                
    	m_neverReplicate = 0                	m_XactWorkspace = 0x000002035EDC4CE0                                       
    	m_execStats = 0x000002035E2335C0    
    

    Can this behavior be confirmed for SQL Server 2017 CU 16?

    Thanks,

    Alex

    Friday, September 13, 2019 1:15 PM

Answers

  • We were able to find out the reason for the problem. To solve another issue, the trace flag 9121 was set in the startup parameters. Although the flag fixed the original issue (also an Access Violation Error Exception, but using the IN operator in conjunction with a subquery that queries multiple linked servers via join), it now leads to this problem.
    We will now disable the Trace flag and report a bug for the other problem if necessary.

    Thanks everyone :)
    • Marked as answer by BI.Alex Monday, September 16, 2019 8:11 AM
    Monday, September 16, 2019 8:11 AM

All replies

  • There are other causes, but Access Violation error are almost always caused by a problem in SQL Server database engine.

    Since you are running the current patch level, I suggest you contact MS Support and send them the dump.  They will be able to tell you exactly what is happening.

     
    Friday, September 13, 2019 1:33 PM
    Moderator
  • Hi BI.Alex,

    Please proceed as Tom Phillips suggested.

    In the meantime, you can try an alternative approach.

    SQL:

    SELECT * --INTO #tableName
    FROM  OPENROWSET(BULK 'e:\Temp\DataCow.csv'
       , FORMATFILE = 'e:\Temp\DataCow.xml'  
       , ERRORFILE = 'e:\Temp\DataCow.err'
       , FIRSTROW = 2 -- real data starts on the 2nd row
       , MAXERRORS = 100
       ) AS t1;


    DataCow.csv:

    "ID","Name","Colour","LogDate"
    41,"Orange","Orange",2018-09-09 16:41:02.000
    42,"Cherry, Banana","Red,Yellow",
    43,"Apple","Yellow",2017-09-09 16:41:02.000
    

    DataCow.xml:

    <?xml version="1.0"?>
    <BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <RECORD>
          <FIELD ID="1" xsi:type="CharTerm" TERMINATOR=',"' MAX_LENGTH="70"/>
          <FIELD ID="2" xsi:type="CharTerm" TERMINATOR='","' MAX_LENGTH="70" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
          <FIELD ID="3" xsi:type="CharTerm" TERMINATOR='",' MAX_LENGTH="70" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
          <FIELD ID="4" xsi:type="CharTerm" TERMINATOR='\r\n' MAX_LENGTH="70" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
       </RECORD>
       <ROW>
          <COLUMN SOURCE="1" NAME="ID" xsi:type="SQLVARYCHAR"/>
          <COLUMN SOURCE="2" NAME="Name" xsi:type="SQLVARYCHAR"/>
          <COLUMN SOURCE="3" NAME="Colour" xsi:type="SQLVARYCHAR"/>
          <COLUMN SOURCE="4" NAME="LogDate" xsi:type="SQLVARYCHAR"/>
       </ROW>
    </BCPFORMAT>

    Friday, September 13, 2019 2:24 PM
  • We were able to find out the reason for the problem. To solve another issue, the trace flag 9121 was set in the startup parameters. Although the flag fixed the original issue (also an Access Violation Error Exception, but using the IN operator in conjunction with a subquery that queries multiple linked servers via join), it now leads to this problem.
    We will now disable the Trace flag and report a bug for the other problem if necessary.

    Thanks everyone :)
    • Marked as answer by BI.Alex Monday, September 16, 2019 8:11 AM
    Monday, September 16, 2019 8:11 AM