SetupPlatform.exe Error 0xc0000005 During Windows Setup

When you install a Windows 10/11 Feature Update, the setup process may go until 87% and close automatically with an exception error 0xc0000005 that is recorded in the setup logs. A crash dump file may also be generated.

Setupact.log (in the Panther directory) contains these entries:

Info SP BFSVC: Opening template from \Device\HarddiskVolume2\$WINDOWS.~BT\NewOS\WINDOWS\System32\config\BCD-Template.
Info SP BFSVC: Reopening system store.
FatalError SP Exception handler called! Details:
FatalError SP Exception record: 0
FatalError SP Exception code: 0xc0000005
FatalError SP Exception flags: 0x0
FatalError SP Exception address: 00007FF91D4911DD
FatalError SP Exception parameter 0: 0000000000000000
FatalError SP Exception parameter 1: 0000000000000000
Info SP SEH: Attempting to log exception
Info MOUPG Action progress: [60%]
Info MOUPG Task progress: [98%]
Info MOUPG Overall progress: [98%]
Info MOUPG Mapped Global progress: [98%]
FatalError [0x090001] PANTHR Exception (code 0xC0000005: ACCESS_VIOLATION) occurred at 0x00007FF91D4911DD in C:\$WINDOWS.~BT\Sources\SetupPlatform.dll (+00000000003F11DD). Minidump attached (143379 bytes) to diagerr.xml and C:\$WINDOWS.~BT\Sources\Panther\mndC459.diagerr.mdmp.

Minidump

A minidump may be generated, and you may find something like below if you debug the dump file.

PROCESS_NAME: SetupPlatform.exe
READ_ADDRESS: 0000000000000000
ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s.
EXCEPTION_CODE_STR: c0000005
EXCEPTION_PARAMETER1: 0000000000000000
EXCEPTION_PARAMETER2: 0000000000000000

STACK_TEXT:
00000057`8614b0f0 00007ff9`c220156b : 00000000`00000000 00000000`00000000 00000057`8614b1c0 0000020b`e3ff1560 : SetupPlatform!BiSpacesUpdatePhysicalDevicePath+0x2d
00000057`8614b150 00007ff9`c2200a69 : 00000000`0000038c 00007ff9`0000002a 00007ff9`00000000 00000057`00000003 : SetupPlatform!BiUpdateEfiEntry+0x7f
00000057`8614b1f0 00007ff9`c2200bf9 : 0000020b`e3f65640 0000020b`00000000 0000020b`e3ff1560 00000000`0000038c : SetupPlatform!BiCreateEfiEntry+0xf9
00000057`8614b250 00007ff9`c21ff683 : 00000000`00000000 00000057`8614b310 00000000`00000290 00000057`8614b310 : SetupPlatform!BiExportBcdObjects+0x99
00000057`8614b290 00007ff9`c23495d6 : 00000000`00000000 00000000`00000000 00000000`00000002 00000000`00000013 : SetupPlatform!BiExportStoreToEfi+0x57
00000057`8614b2d0 00007ff9`c234902b : 00000000`00000000 00000000`00000001 00000000`0000033c 0000020b`e3f64c10 : SetupPlatform!BiImportStoreFromFile+0x18e
00000057`8614b340 00007ff9`c23054cf : 00000000`00000000 0000020b`e3f62718 0000020b`e3f62700 0000020b`e3fd54e8 : SetupPlatform!BcdImportStoreWithFlags+0x4b
00000057`8614b370 00007ff9`c230ddce : 00007ff9`c2509e90 0000020b`e3f89ce8 0000020b`e3fd54e8 00000000`00000001 : SetupPlatform!OSRollbackUtils::RestoreBCDDatabase+0x167
00000057`8614ba10 00007ff9`c2309001 : 0000020b`00000200 0000020b`e3f654e8 0000020b`00000047 00007ff9`c24782f8 : SetupPlatform!OSRollbackService::CBootFilesRestoreCheckpoint::Rollback+0x1c9e
00000057`8614bc50 00007ff9`c2309c55 : 00007ff9`c2309b4c 00007ff9`c2309b4c 00007ff9`c2309b4c 00000057`8614bde0 : SetupPlatform!OSRollbackService::CCheckpointImpressario::ExecuteRollbackSequence+0x305
00000057`8614bd30 00007ff9`c20a34e9 : 0000020b`e3f64828 00000000`00000000 00000000`00000001 0000020b`e3f2cc88 : SetupPlatform!OSRollbackService::CSetupRollbackService::RollbackExecuteSequence+0x151
00000057`8614bdf0 00007ff9`c204cc20 : 00007ff9`c204c77e 00000000`00000000 00007ff9`c204c77e 00000000`00000001 : SetupPlatform!CSetupPlatformRollback::Execute+0x79
00000057`8614be80 00007ff9`c2052457 : 0000020b`e3f2cc88 00000057`00000000 00000057`8614c420 00000000`00000001 : SetupPlatform!CSetupPlatformPrivate::RollbackOfflineCommon+0x9c4
00000057`8614bfd0 00007ff7`fae6394c : 00000000`00000001 00000000`00000000 00000000`00000001 00000000`00000001 : SetupPlatform!CSetupPlatformPrivate::Rollback+0x15a7
00000057`8614c2d0 00007ff7`fae691a9 : 00000000`00000001 00000000`00000001 00000000`00000000 00000000`00000000 : SetupPlatform_exe!wWinMain+0x20cc
00000057`8614f980 00007ff9`c7ef6fd4 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : SetupPlatform_exe!__wmainCRTStartup+0x1c9
00000057`8614fa40 00007ff9`c883cf31 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : kernel32!BaseThreadInitThunk+0x14
00000057`8614fa70 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x21

STACK_COMMAND: ~0s; .ecxr ; kb
SYMBOL_NAME: SetupPlatform!BiSpacesUpdatePhysicalDevicePath+2d
MODULE_NAME: SetupPlatform
IMAGE_NAME: SetupPlatform.dll

Event Viewer

The following Event log entry may be recorded:

Faulting application name: SetupHost.exe, version: 10.0.19041.1138, time stamp: 0xcdb250a9
Faulting module name: SetupPlatform.dll, version: 1.60.19041.1138, time stamp: 0xfbb9a3ac
Exception code: 0xc0000005
Fault offset: 0x00000000003f114d
Faulting process id: 0x1bb4
Faulting application start time: 0x01d79d062c9c526c
Faulting application path: C:\$WINDOWS.~BT\Sources\SetupHost.exe
Faulting module path: C:\$WINDOWS.~BT\Sources\SetupPlatform.dll
Report Id: e69dc087-4ef3-4a31-8917-349a0dc87008
Faulting package full name:
Faulting package-relative application ID:

{Bootmgr} entry

When you run the bcdedit /enum bootmgr command-line, the {bootmgr} may look like below. The “device” entry may be missing.

Windows Boot Manager
--------------------
identifier              {bootmgr}
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
flightsigning           Yes
default                 {current}
resumeobject            {b41548ef-ca44-11e9-a1e1-f8b46ab8194f}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Cause

The SetupPlatform.dll error 0xc0000005 error/crash in procedure SetupPlatform!BiSpacesUpdatePhysicalDevicePath occurs when reading/writing to the BCD occurs because of the missing “device” value in the {Bootmgr} section of the BCD.

Resolution

It’s a BCD issue. Fixing it or rebuilding it should resolve the error in most cases.

(Create a USB setup disk and have it ready, just in case.)

Open an admin Command Prompt, and run these commands below.

diskpart
list vol

Note down the volume number of your EFI boot partition (on GPT-based systems) or the System Reserved partition on MBR-based systems. See How to Find if a Disk Uses MBR or GPT)



In this example, the disks are GPT. The EFI boot partition is always a FAT32 partition.

diskpart list vol

In the above output, you can see that the EFI boot partition is Volume 1 — i.e., HarddiskVolume1.

Let’s run the following command to backup the BCD database.

bcdedit /export c:\bcd.bak

Then, add the “device” value under the {bootmgr} section of the BCD database. To do so, run the following command:

bcdedit /set {bootmgr} device partition=\Device\HarddiskVolume1

bcdedit add device under {bootmgr}

The bootmgr section in BCD should now look like below:

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1      <== we added this entry.
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
flightsigning           Yes
default                 {current}
resumeobject            {b41548ef-ca44-11e9-a1e1-f8b46ab8194f}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Re-run Setup. In case it fails, rebuild the BCD and try again.
That should resolve the setupplatform.dll exception error 0xc0000005 during Windows 10/11 Setup.


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

Leave a Reply