Hi,
We are using a simple crash test case to verify whether crash logs are generated correctly:
int* c = nullptr;
*c = 3;
This code crashes as expected in UE 4.27. However, in UE 5.6, the application freezes and triggers an ANR instead of crashing, and this happens only in the Shipping build.
Interestingly, if we change the code to:
volatile int* c = nullptr;
*c = 3;
the application crashes as expected in UE 5.6 as well.
Could you please help us understand why this behavior differs between UE 4.27 and UE 5.6, and why adding volatile changes the outcome in Shipping builds?
Best regards,
Sultan
[Attachment Removed]
Hi Muhammad,
Can you confirm that you are building buth 4.27 and 5.6 against the same NDK version? 5.x did add new Crash Handlers which may be contributing to differing behaviour but we can further investigate once you’ve confirmed NDK versions.
Best regards.
[Attachment Removed]
Hi Muhammad,
Dereferencing NULL under the C/C++ standard is undefined behavious and doesn’t necessarily cause a trap. Additionally, under shipping builds, for the non volatile case, the compiler may choose to optimize out that snippet whereas volatile hints the compiler into keeping the code and cause a trap on attempted memory store.
Best regards.
[Attachment Removed]
Hi [Content removed]
We have following Android setup for UE 5.6
JDK 21
NDK 27.2.12479018
SDK API tool chain 35
android-35
android-27
For UE4.27 we have following Android setup:
JDK 11+
NDK 23.0.7599858
android-35
android-27
[Attachment Removed]
Thanks for clarification [Content removed] you can close this ticket.
Thanks.
[Attachment Removed]