Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlayerResourcesComponent nullptr exception #42

Open
jacopomaroli opened this issue Jul 27, 2020 · 1 comment
Open

PlayerResourcesComponent nullptr exception #42

jacopomaroli opened this issue Jul 27, 2020 · 1 comment

Comments

@jacopomaroli
Copy link

Describe the bug
PlayerResourcesComponent member is set in the constructor of the ARTSPlayerController and gets dereferenced before hitting void ARTSPlayerController::BeginPlay() in file
TrumpDefense2020\TD2020\Plugins\RealTimeStrategy\Source\RealTimeStrategy\Private\RTSPlayerController.cpp

To Reproduce
Steps to reproduce the behavior:

  1. compile project
  2. run in viewport
  3. observe crash

Expected behavior
It shouldn't crash

Screenshots
N/A

Desktop (please complete the following information):

Additional context
When you run the project from visual studio and hit the run in viewport preview mode in UE UI, you can set a breakpoint in the ARTSPlayerController constructor.
This allows you to set another breakpoint when PlayerResourcesComponent variable changes (Debug-> New Breakpoint -> Data Breakpoint...: 4 bytes)
This leads to a breakpoint in vcruntime140.dll!memcpy() Line 244 and if you download the debug symbols you'll find the code where it breaks is this

MoveSmall8::
        mov     rcx, qword ptr [rdx]    ; get eight bytes from source
        mov     [rax], rcx              ; write eight bytes to destination
        ret <--

with the following callstack

>	vcruntime140.dll!memcpy() Line 244	Unknown
 	UE4Editor-Engine.dll!00007ffdf52c0913()	Unknown
 	UE4Editor-Engine.dll!00007ffdf52c0a9a()	Unknown
 	UE4Editor-CoreUObject.dll!00007ffdf8dea65c()	Unknown
 	UE4Editor-CoreUObject.dll!00007ffdf8df3518()	Unknown
 	UE4Editor-CoreUObject.dll!00007ffdf8dbf36f()	Unknown
 	UE4Editor-CoreUObject.dll!00007ffdf8e09887()	Unknown
 	UE4Editor-Engine.dll!00007ffdf5942726()	Unknown
 	UE4Editor-Engine.dll!00007ffdf5943067()	Unknown
 	UE4Editor-Engine.dll!00007ffdf56fa173()	Unknown
 	UE4Editor-Engine.dll!00007ffdf56f9f9a()	Unknown
 	UE4Editor-Engine.dll!00007ffdf56e39aa()	Unknown
 	UE4Editor-Engine.dll!00007ffdf5944325()	Unknown
 	UE4Editor-Engine.dll!00007ffdf5943c8c()	Unknown
 	UE4Editor-Engine.dll!00007ffdf56fc0c5()	Unknown
 	UE4Editor-UnrealEd.dll!00007ffdf377ac89()	Unknown
 	UE4Editor-UnrealEd.dll!00007ffdf379b350()	Unknown
 	UE4Editor-UnrealEd.dll!00007ffdf37b92e6()	Unknown
 	UE4Editor-UnrealEd.dll!00007ffdf31b1891()	Unknown
 	UE4Editor-UnrealEd.dll!00007ffdf3ad2346()	Unknown
 	UE4Editor.exe!00007ff7966c6225()	Unknown
 	UE4Editor.exe!00007ff7966d596c()	Unknown
 	UE4Editor.exe!00007ff7966e48aa()	Unknown
 	UE4Editor.exe!00007ff7966e659a()	Unknown
 	kernel32.dll!00007ffe4c697bd4()	Unknown
 	ntdll.dll!00007ffe4d7ace51()	Unknown

this issue could be entirely due to ue4-rts but I thought checking with you first as it seems rather easy to incour into and it seems weird no one experienced it before.

I think it could be due to the fact that PlayerResourcesComponent gets garbage collected by UE as it's not used but that's just a wild guess based on what I read from other similar issues

TBH while compiling this issue I realized this specific commit was fiddling with something around resources so that could be the culprit... npruehs/ue4-rts@fdcb8ae
Anyhow it would be great knowing what's the hash of ue4-rts which is needed to make the project work

P.S. awesome project BTW, very inspiring. Keep it up!

@JernejHabjan
Copy link
Owner

Hey @jacopomaroli sorry for late response. Keep checking this project as I'm currently updating RTS dependency of https://github.com/npruehs/ue4-rts/
as a plugin.
After latest version of this plugin is linked in project, errors like this should be gone.
Have a good one ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants