Why am I getting the error 0xC0000005: Access violation reading location when I upgrade my c++ project from 4.4 to 4.5?

Hey

So I am trying to update my c++ unreal project from 4.4.3 to 4.5.1. The project now builds in Visual Studio and starts loading up in the unreal engine. However before the project finishes loading it crashes with the following error:

Unhandled exception at 0x00007FFDEEAEB146 (UE4Editor-CoreUObject.dll) in UE4Editor.exe: 0xC0000005: Access violation reading location 0x0000011A00000000.

I have discovered that if I delete the Content/Maps folder then the project will load without a map loaded. However, if I then try to create a new map or exit unreal, the engine crashes with exactly the same error.

Here is the log:

Log file open, 12/12/14 22:22:26
LogInit:Display: Running engine for game: Haiku
LogInit: Version: 4.5.1-2336687+++depot+UE4-Releases+4.5
LogInit: API Version: 2326478
LogInit: Compiled (64-bit): Oct 21 2014 22:32:40
LogInit: Compiled with Visual C++: 18.00.21005.01
LogInit: Build Configuration: Development
LogInit: Branch Name: ++depot+UE4-Releases+4.5
LogInit: Command line:
LogInit: Base directory: D:/Program Files/Unreal Engine/4.5/Engine/Binaries/Win64/
LogInit: Rocket: 1
[2014.12.12-12.22.26:408][ 0]LogTaskGraph: Started task graph with 3 named threads and 4 total threads.
[2014.12.12-12.22.26:493][ 0]LogOnline:Display: STEAM: Loading Steam SDK 1.30
[2014.12.12-12.22.26:494][ 0]LogOnline:Warning: STEAM: Steam SDK 1.30 libraries not present at …/…/…/Engine/Binaries/ThirdParty/Steamworks/Steamv130/Win64/ or failed to load!
[2014.12.12-12.22.26:494][ 0]LogOnline:Warning: Unable to load default OnlineSubsystem module Steam, using NULL interface
[2014.12.12-12.22.26:519][ 0]LogOnline:Verbose: NULL: Created thread (ID:3688).
[2014.12.12-12.22.26:530][ 0]LogInit: WinSock: version 1.1 (2.2), MaxSocks=32767, MaxUdp=65467
[2014.12.12-12.22.26:556][ 0]LogVoice:Warning: Failed to initialize voice interface
[2014.12.12-12.22.26:578][ 0]LogInit: Presizing for 0 objects not considered by GC, pre-allocating 0 bytes.
[2014.12.12-12.22.26:586][ 0]LogInit: Object subsystem initialized
[2014.12.12-12.22.26:589][ 0]LogConsoleResponse:Warning: Skipping Unknown console variable: ‘UIScaleRule = ShortestSide’
[2014.12.12-12.22.26:589][ 0]LogConsoleResponse:Warning: Found in ini file ‘D:/Documents/UnrealProjects/Haiku(for4.5)/Haiku/Saved/Config/Windows/Engine.ini’, in section ‘[/Script/Engine.RendererSettings]’
[2014.12.12-12.22.26:590][ 0]LogConsoleResponse:Warning: Skipping Unknown console variable: ‘UIScaleCurve = (EditorCurveData=(Keys=((Time=480.000000,Value=0.444000),(Time=720.000000,Value=1.000000),(Time=1080.000000,Value=1.000000),(Time=8640.000000,Value=8.000000))),ExternalCurve=None)’
[2014.12.12-12.22.26:590][ 0]LogConsoleResponse:Warning: Found in ini file ‘D:/Documents/UnrealProjects/Haiku(for4.5)/Haiku/Saved/Config/Windows/Engine.ini’, in section ‘[/Script/Engine.RendererSettings]’
[2014.12.12-12.22.26:591][ 0]LogInit: Selected Device Profile: [Windows]
[2014.12.12-12.22.26:591][ 0]LogInit: Applying CVar settings loaded from the selected device profile: [Windows]
[2014.12.12-12.22.26:598][ 0]LogInit: Computer: MSI
[2014.12.12-12.22.26:599][ 0]LogInit: User: Matthew
[2014.12.12-12.22.26:600][ 0]LogInit: CPU Page size=4096, Cores=4
[2014.12.12-12.22.26:601][ 0]LogInit: High frequency timer resolution =2.338348 MHz
[2014.12.12-12.22.26:601][ 0]LogMemory: Memory total: Physical=15.9GB (16GB approx) Virtual=131072.0GB
[2014.12.12-12.22.26:601][ 0]LogMemory: Platform Memory Stats for Windows
[2014.12.12-12.22.26:602][ 0]LogMemory: Process Physical Memory: 93.84 MB used, 100.23 MB peak
[2014.12.12-12.22.26:602][ 0]LogMemory: Process Virtual Memory: 71.76 MB used, 81.25 MB peak
[2014.12.12-12.22.26:602][ 0]LogMemory: Physical Memory: 5405.60 MB used, 16303.20 MB total
[2014.12.12-12.22.26:602][ 0]LogMemory: Virtual Memory: 317.06 MB used, 134217728.00 MB total
[2014.12.12-12.22.26:666][ 0]LogD3D11RHI: Found D3D11 adapter 0: NVIDIA GeForce GTX 860M (Feature Level 11_0)
[2014.12.12-12.22.26:667][ 0]LogD3D11RHI: Adapter has 1972MB of dedicated video memory, 0MB of dedicated system memory, and 2048MB of shared system memory, 1 output[s]
[2014.12.12-12.22.26:688][ 0]LogD3D11RHI: Found D3D11 adapter 1: Intel(R) HD Graphics 4600 (Feature Level 11_0)
[2014.12.12-12.22.26:688][ 0]LogD3D11RHI: Adapter has 0MB of dedicated video memory, 0MB of dedicated system memory, and 1792MB of shared system memory, 0 output[s]
[2014.12.12-12.22.26:693][ 0]LogD3D11RHI: Found D3D11 adapter 2: Microsoft Basic Render Driver (Feature Level 11_0)
[2014.12.12-12.22.26:693][ 0]LogD3D11RHI: Adapter has 0MB of dedicated video memory, 0MB of dedicated system memory, and 256MB of shared system memory, 0 output[s]
[2014.12.12-12.22.26:693][ 0]LogD3D11RHI: Chosen D3D11 Adapter Id = 0
[2014.12.12-12.22.26:696][ 0]LogRHI: Texture pool is 1361 MB (70% of 1945 MB)
[2014.12.12-12.22.26:746][ 0]LogD3D11RHI: Async texture creation enabled
[2014.12.12-12.22.26:818][ 0]LogTextLocalizationManager: The requested culture (‘en_AU’) has no localization data; parent culture’s (‘en’) localization data will be used.
[2014.12.12-12.22.26:929][ 0]LogContentStreaming: Texture pool size is 0.000000MB
[2014.12.12-12.22.30:704][ 0]LogTargetPlatformManager:Display: Building Assets For Windows
[2014.12.12-12.22.31:114][ 0]LogTargetPlatformManager:Display: Building Assets For Windows
[2014.12.12-12.22.31:163][ 0]LogDerivedDataCache:Display: Max Cache Size: 512 MB
[2014.12.12-12.22.31:216][ 0]LogDerivedDataCache: Loaded boot cache 0.05s 57MB C:/Users/Matthew/AppData/Local/UnrealEngine/4.5/DerivedDataCache/Boot.ddc.
[2014.12.12-12.22.31:217][ 0]LogDerivedDataCache:Display: Loaded Boot cache: C:/Users/Matthew/AppData/Local/UnrealEngine/4.5/DerivedDataCache/Boot.ddc
[2014.12.12-12.22.31:217][ 0]LogDerivedDataCache: FDerivedDataBackendGraph: Pak pak cache file …/…/…/…/…/…/Documents/UnrealProjects/Haiku(for4.5)/Haiku/DerivedDataCache/DDC.ddp not found, will not use a pak cache.
[2014.12.12-12.22.31:218][ 0]LogDerivedDataCache: Unable to find inner node Pak for hierarchical cache Hierarchy.
[2014.12.12-12.22.31:270][ 0]LogDerivedDataCache:Display: Pak cache opened for reading …/…/…/Engine/DerivedDataCache/DDC.ddp.
[2014.12.12-12.22.31:283][ 0]LogDerivedDataCache: Using Local data cache path C:/Users/Matthew/AppData/Local/UnrealEngine/Common/DerivedDataCache: Writable
[2014.12.12-12.22.31:519][ 0]LogMeshUtilities: No automatic mesh reduction module available
[2014.12.12-12.22.31:520][ 0]LogMeshUtilities: No automatic mesh merging module available
[2014.12.12-12.22.31:739][ 0]LogLinker:Warning: Asset ‘…/…/…/Engine/Content/Functions/Engine_MaterialFunctions02/Texturing/FlipBook.uasset’ has been saved with empty engine version. The asset will be loaded but may be incompatible.
[2014.12.12-12.22.31:742][ 0]LogLinker:Warning: Asset ‘…/…/…/Engine/Content/Functions/Engine_MaterialFunctions02/ExampleContent/Textures/flipbook.uasset’ has been saved with empty engine version. The asset will be loaded but may be incompatible.
[2014.12.12-12.22.32:883][ 0]UdpMessaging: Initializing bridge on interface 0.0.0.0:0 to multicast group 230.0.0.1:6666.
[2014.12.12-12.22.34:412][ 0]LogMaterial: Missing cached shader map for material M_Weapons_Metal, compiling.
[2014.12.12-12.22.34:413][ 0]LogMaterial:Warning: Failed to compile Material /Game/Materials/Character/M_Weapons_Metal.M_Weapons_Metal for platform PCD3D_SM5, Default Material will be used in game.
[2014.12.12-12.22.34:413][ 0]LogMaterial:Warning: (Node TextureSample) TextureSample> Missing input texture
[2014.12.12-12.22.36:080][ 0]LogAssetRegistry: FAssetRegistry took 0.0116 seconds to start up
[2014.12.12-12.22.36:106][ 0]LogDirectoryWatcher:Warning: Failed to begin reading directory changes for …/…/…/Engine/Plugins/Experimental/CharacterAI/Content/. Error: 0
[2014.12.12-12.22.36:961][ 0]SourceControl: Info Source control is disabled
[2014.12.12-12.22.36:961][ 0]SourceControl: Info Source control is disabled
[2014.12.12-12.22.36:968][ 0]SourceControl: Info Source control is disabled
[2014.12.12-12.22.37:561][ 0]LogObj: 38459 objects as part of root set at end of initial load.
[2014.12.12-12.22.37:561][ 0]LogUObjectAllocator: 10349544 out of 0 bytes used by permanent object pool.
[2014.12.12-12.22.37:669][ 0]LogEngine: Initializing Engine…
[2014.12.12-12.22.37:792][ 0]LogInit: XAudio2 using ‘Speakers (2- Realtek High Definition Audio)’ : 2 channels at 48 kHz using 32 bits per sample (channel mask 0x3)
[2014.12.12-12.22.37:821][ 0]LogInit: FAudioDevice initialized.
[2014.12.12-12.22.37:837][ 0]LogAIModule: Creating AISystem for world NewWorld
[2014.12.12-12.22.37:871][ 0]LogDerivedDataCache: Saved boot cache 0.0

After a lot of code changing and testing I have finally solved the problem. It was due to a pointer in a USTRUCT in my GameState class. I removed the pointer and the game now loads correctly with the map working.