Closed pipi0425 closed 3 months ago
@pipi0425, thank you for raising this issue and for your interest in this plugin!
It’s challenging to pinpoint the exact cause since I haven't been able to reproduce it myself.
Trying to fix this, I've submitted a possible solution on the Develop branch just for you. Please download and test the fix: Link. It includes the changes compiled for UE5.4.2
Let me know if the crash is resolved. If it is, I will update the Main branch and Releases page. If the crash persists, please provide the new crash call stack and the log file from YourProject/Saved/Logs
.
Thanks for your response. I just tested and encountered crashes again.
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000000
VCRUNTIME140
UnrealEditor_CustomShapeButton!SCustomShapeButton::GetRawColors() [C:\...\Plugins\CustomShapeButton-main\Source\CustomShapeButton\Private\SCustomShapeButton.cpp:79]
UnrealEditor_CustomShapeButton!SCustomShapeButton::IsAlphaPixelHovered() [C:\...\Plugins\CustomShapeButton-main\Source\CustomShapeButton\Private\SCustomShapeButton.cpp:178]
UnrealEditor_CustomShapeButton!TBaseSPMethodDelegateInstance<1,SCustomShapeButton const ,1,bool __cdecl(void),FDefaultDelegateUserPolicy>::Execute() [C:\Program Files\Epic Games\UE_5.4\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:281]
UnrealEditor_CustomShapeButton!SlateAttributePrivate::TSlateAttributeBase<SWidget,bool,SlateAttributePrivate::FSlateAttributeNoInvalidationReason,TSlateAttributeComparePredicate<TEqualTo<void> >,0>::FSlateAttributeGetterWrapper<SlateAttributePrivate::TSlateA() [C:\Program Files\Epic Games\UE_5.4\Engine\Source\Runtime\SlateCore\Public\Types\Attributes\SlateAttributeBase.inl:585]
UnrealEditor_SlateCore
UnrealEditor_SlateCore
a lot of lines of UnrealEditor_SlateCore here
What I observe:
GetRawColors()
from SCustomShapeButton.cpp:79
. I just moved from Unity to UE less than one year so I don't know, is it possible that some functions get called at the end of frame or some time later and caused the "when I access it, it has been changed" type of bug?
Sandbox.logAny suggestions? Thanks a lot!
@pipi0425, thanks for the quick response.
The issue seems complex and may be difficult to fix without debugging your project, as I've already tried all ideas. Your logs look fine.
Are you able to send me your project via any of the following?
@JanSeliv#6546
janseliw@gmail.com
This would help the most to find the issue. If you can't send the project, please share some screenshots or a video of your setup.
Alternatively, you could modify the Sample Project I sent you before to make it crash as in your own project and send it to me.
Hi, Sorry I don't use telegram. I've sent the project to your email from peterzsy@outlook.com
, based on your sample project.
I've also attached the zip here in case you did not receive it.
CustomShapeButtonSample_UE5-4-crash240617.zip
Thanks!
@pipi0425, thank you for providing the Sample Project with your modifications. It was extremely helpful, along with your video and Readme, which allowed me to reproduce and debug the crash.
I don't have a fix yet. Each time I think the crash is resolved, it appears again after about ~10 minutes of testing.
I will keep you updated once I have a solution
@pipi0425, the issue seems to be fixed now, see the video, where I'm testing the fix for a few minutes: https://github.com/JanSeliv/CustomShapeButton/assets/20540872/7903140d-756b-42f5-8408-695867db66a2
Please download and test the Sample Project with included fix: CustomShapeButtonSample_UE5-4-crash240617.zip
Let me know if it works for you or still crashes
@JanSeliv Hi, thanks for your quick response. I just tested it and also copied to my original project to test. At this moment, I do not see any problems or crashes, so I think this might have been fixed.
Just curious, I noticed your most recent commit used weakptr instead, what was causing this crash?
Again, thanks so much for your help!
@pipi0425, thank you for confirming the fix!
Just curious, I noticed your most recent commit used weakptr instead, what was causing this crash?
Regarding the solution itself [commit], in your crash call stack, the error was EXCEPTION_ACCESS_VIOLATION
. This happens when a pointer references an object that no longer exists. To fix it, I bound the IsAlphaPixelHovered
function differently: with a lambda+weakptr pointer instead of a raw bind as before, to ensure it only runs if the Slate widget object is still valid before calling IsAlphaPixelHovered
.
I submitted the fix to the Main branch and updated the Releases page, so it's included now for everyone.
Closing the issue as done per confirmation above.
Hi, seems like this issue is still present after all, I get it the most often hovering images with a lot of transparency spots
@GdevPT could you please repeat your setup/textures in my Sample Project from Releases page, so it starts crashes here as well and send me it back as author did above? Video also will help a lot. So I can reproduce this issue on my own and try to fix
Hi, your plugin is great and functions perfectly in most cases.
However, I just encountered some random crashes of the editor. When testing in PIE, sometimes, when mouse over my partly transparent hexagon shape button (using texture, not material), the engine just crashes, but when I restart the engine and test multiple times it does not reoccur, and a few hours later it crashes again. This gives me no confidence, not sure if it will crash in build. If you could kindly take a look if this is something in the code?
I noticed that in
SCustomShapeButton.cpp
around line 179, you did checkIsValidIndex
, but in my case, exception access violation still triggers.Does this have anything to do with multiple buttons close to each other and potentially overlap? My hex-shape buttons form a hex grid pattern.
p.s. I just checked the other closed issue and verified: texture: NoMipmaps texture group: UI never stream compression: vector displacement map RGBA8 and texture size 444*512, power of 2.
Any suggestions?
Thanks,