FIX: Access violation occurs when you restore the In-Memory Optimized database in SQL Server 2016 and 2017

Applies to: SQL Server 2016 DeveloperSQL Server 2016 EnterpriseSQL Server 2016 Enterprise Core

Symptoms


Assume that you use Microsoft SQL Server 2016 or 2017. When you try to restore the database, you may receive an access violation dump that resembles the following:

DateTime spidSpidId      The database 'DatabaseName' is marked RESTORING and is in a state that does not allow recovery to be run.
DateTime spidSpidId      Restore(DatabaseName): Offline roll-forward begins
DateTime spidSpidId      Restore(DatabaseName): Starting filestream recovery
DateTime spidSpidId      Restore(DatabaseName): Processing 136 VLF headers
DateTime spidSpidId      Restore(DatabaseName): Processing VLF headers is complete
DateTime spidSpidId      Restore(DatabaseName): First LSN: LSNId, Last LSN: LSNId
DateTime spidSpidId      [INFO] Database ID: [5]. Deleting unrecoverable checkpoint table row (id: 108).
DateTime spidSpidId      [INFO] Database ID: [5]. Deleting unrecoverable checkpoint table row (id: 107).
DateTime spidSpidId      [INFO] Database ID: [5]. Deleting unrecoverable checkpoint table row (id: 109).
DateTime spidSpidId      [INFO] HkCkptLoadInternalEx(): Database ID: [5]. Root file: {FileId}, watermark: WatermarkId, RecoveryLsn: RecoveryLsnId, RecoveryCheckpointId: 110, RecoveryCheckpointTimestamp: 0x318ce
DateTime spidSpidId     ***Stack Dump being sent to FilePath
DateTime spidSpidId     SqlDumpExceptionHandler: Process ProcessId generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
DateTime spidSpidId     * *******************************************************************************
DateTime spidSpidId     *
DateTime spidSpidId     * BEGIN STACK DUMP:
DateTime spidSpidId     *   DateTime spid SpidId
DateTime spidSpidId     *
DateTime spidSpidId     *
DateTime spidSpidId     *   Exception Address = ExceptionAddress
DateTime spidSpidId     *   Exception Code    = c0000005 EXCEPTION_ACCESS_VIOLATION
DateTime spidSpidId     *   Access Violation occurred reading address AddressId 

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. 

Resolution


This issue is fixed in the following cumulative updates for SQL Server:
About cumulative updates for SQL Server:
Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

References


Learn about the terminology that Microsoft uses to describe software updates.