UE4.14.3 + Macos Sierra.
System Configuration: MacBookPro 2011 Early ,(Intel Graphics 3000 + AMD Radeon HD 6750M) Metal has not supported.
Base on First Person C++ Example, I rewrite HUDClass named “AFPVProjectHUD”
When I use function ‘GetWorld()->SweepMultiByChannel’ in HUD::DrawHUD() ,and use Editor(Play in Editor).
- Click ‘Play’ in Editor.
- Click game screen then mouse can control the crosshair.
- Press ‘ESC’.
- Click ‘Play’ again, and it crashed.
If I comment out that line “GetWorld()->SweepMultiByChannel” ,it works fine and never crash even if I push the ‘Play’ button again and again.
I am not sure whether is my memory problem, but it always crash in the same place and give me the same crash report.
Source File is in Attachment.
##there is my code in FPVProjectHUD.cpp
void AFPVProjectHUD::DrawHUD()
{
Super::DrawHUD();
// find center of the Canvas
const FVector2D Center(Canvas->ClipX * 0.5f, Canvas->ClipY * 0.5f);
// offset by half the texture's dimensions so that the center of the texture aligns with the center of the Canvas
const FVector2D CrosshairDrawPosition( (Center.X),
(Center.Y + 20.0f));
// draw the crosshair
FCanvasTileItem TileItem( CrosshairDrawPosition, CrosshairTex->Resource, FLinearColor::White);
TileItem.BlendMode = SE_BLEND_Translucent;
Canvas->DrawItem( TileItem );
static APawn* Player = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);
if (Player) {
FCollisionShape RadarCollision;
RadarCollision.ShapeType = ECollisionShape::Sphere;
RadarCollision.SetSphere(1000.0f);
FVector EndLocation = Player->GetActorLocation();
EndLocation.Z += 200;
//why SEGV_NOOP at 0x0 ?
GetWorld()->SweepMultiByChannel(HitResult, Player->GetActorLocation(), EndLocation,FQuat::Identity, ECollisionChannel::ECC_WorldDynamic, RadarCollision);
}
}
##And there is my crash report
MachineId:C1*******
EpicAccountId:95f4aef******
SEGV_NOOP at 0x0
AFPVProjectHUD::DrawHUD() Address = 0x162596fe7 [/Users/Shared/Epic Games/UE_4.14/Engine/Source/Runtime/Core/Public/Math/UnrealMathSSE.h, line 229] [in UE4Editor-FPVProject-4861.dylib]
AHUD::PostRender() Address = 0x105a28fc5 (filename not found) [in UE4Editor-Engine.dylib]
UGameViewportClient::Draw(FViewport*, FCanvas*) Address = 0x10596e1c7 (filename not found) [in UE4Editor-Engine.dylib]
FViewport::Draw(bool) Address = 0x1066df4a2 (filename not found) [in UE4Editor-Engine.dylib]
UEditorEngine::Tick(float, bool) Address = 0x10b5dee88 (filename not found) [in UE4Editor-UnrealEd.dylib]
UUnrealEdEngine::Tick(float, bool) Address = 0x10c21c3fc (filename not found) [in UE4Editor-UnrealEd.dylib]
FEngineLoop::Tick() Address = 0x103adbc79 (filename not found) [in UE4Editor]
GuardedMain(wchar_t const*) Address = 0x103ae2b72 (filename not found) [in UE4Editor]
-[UE4AppDelegate runGameThread:] Address = 0x103af016c (filename not found) [in UE4Editor]
-[FCocoaGameThread main] Address = 0x103d10526 (filename not found) [in UE4Editor-Core.dylib]
Unknown() Address = 0x7fff860dac6d (filename not found) [in Foundation]
_pthread_body Address = 0x7fff99eabaab (filename not found) [in libsystem_pthread.dylib]
_pthread_body Address = 0x7fff99eab9f7 (filename not found) [in libsystem_pthread.dylib]
thread_start Address = 0x7fff99eab1fd (filename not found) [in libsystem_pthread.dylib]
##Some part in Diagnostics.txt
Generating report for minidump
Application version 4.14.3-0
... built from changelist 3249277
OS version 10.12.3.27954
Running 1 x64 processors
Exception was " SEGV_NOOP at 0x0"
Source context from "engine/source/runtime/core/public/math/unrealmathsse.h"
<SOURCE START>
214 * @param Vec Vector to store
215 * @param Ptr Memory pointer
216 */
217 #define VectorStore( Vec, Ptr ) _mm_storeu_ps( (float*)(Ptr), Vec )
218
219 /**
220 * Stores the XYZ components of a vector to unaligned memory.
221 *
222 * @param Vec Vector to store XYZ
223 * @param Ptr Unaligned memory pointer
224 */
225 FORCEINLINE void VectorStoreFloat3( const VectorRegister& Vec, void* Ptr )
226 {
227 union { VectorRegister v; float f[4]; } Tmp;
228 ***** Tmp.v = Vec;
229 float* FloatPtr = (float*)(Ptr);
230 FloatPtr[0] = Tmp.f[0];
231 FloatPtr[1] = Tmp.f[1];
232 FloatPtr[2] = Tmp.f[2];
233 }
234
235 /**
236 * Stores the X component of a vector to unaligned memory.
237 *
238 * @param Vec Vector to store X
239 * @param Ptr Unaligned memory pointer
240 */
241 #define VectorStoreFloat1( Vec, Ptr ) _mm_store_ss((float*)(Ptr), Vec)
242
243 /**
<SOURCE END>