Skip to content

Instantly share code, notes, and snippets.

View PhroZenOne's full-sized avatar

Mikael Berglund PhroZenOne

View GitHub Profile
@PhroZenOne
PhroZenOne / memReport crash
Created March 13, 2017 19:53
Crash occurs when doing memReport -all
CommandLine Options: MelorianOutpost
LogMemory: Platform Memory Stats for LinuxServer
LogMemory: Process Physical Memory: 377.81 MB used, 377.81 MB peak
LogMemory: Process Virtual Memory: 722.39 MB used, 770.24 MB peak
LogMemory: Physical Memory: 1232.03 MB used, 6751.43 MB free, 7983.46 MB total
LogMemory: Virtual Memory: 0.00 MB used, 6751.43 MB free, 244.14 MB total
LogMemory:
LogMemory: Allocator Stats for binned:
LogMemory: Current Memory 272.15 MB used, plus 7.45 MB waste
LogEngine: MemReportDeferred: saving to ../../../valhalla/Saved/Profiling/MemReports/MelorianOutpost-LinuxServer-04.19-18.51.56/MelorianOutpost-LinuxServer-19-18.51.56.memreport
CommonLinuxCrashHandler: Signal=11
LogLinux: === Critical error: ===
Unhandled Exception: SIGSEGV: invalid attempt to read memory at address 0x0000000000000048
LogLinux: Fatal error!
[Callstack] 00 0x0000000001fd64df FLinuxPlatformStackWalk::CaptureStackBackTrace(unsigned long long*, unsigned int, void*) [C:\valhalla\UnrealEngine\Engine\Source\Runtime\Core\Private\Linux/LinuxPlatformStackWalk.cpp, line 951]
[Callstack] 01 0x0000000001eeeab5 FGenericPlatformStackWalk::StackWalkAndDump(char*, unsigned long, int, void*) [C:\valhalla\UnrealEngine\Engine\Source\Runtime\Core\Private\GenericPlatform/GenericPlatformStackWalk.cpp, line 159]
[Callstack] 02 0x0000000001f9bfc0 FLinuxCrashContext::CaptureStackTrace() [Runtime/Core/Public/Containers/ContainerAllocationPolicies.h, line 344]
This file has been truncated, but you can view the full file.
[2017.04.30-00.32.32:069][276]UATHelper: Cooking (Windows): Running AutomationTool...
[2017.04.30-00.32.32:483][279]UATHelper: Cooking (Windows): Automation.ParseCommandLine: Parsing command line: BuildCookRun -nocompile -nocompileeditor -installed -nop4 -project=C:/Users/PhroZen/valhalla-proj/valhalla-unreal/valhalla.uproject -cook -skipstage -ue4exe=UE4Editor-Cmd.exe -targetplatform=Win64
[2017.04.30-00.32.33:417][282]UATHelper: Cooking (Windows): BuildCookRun.SetupParams: Setting up ProjectParams for C:\Users\PhroZen\valhalla-proj\valhalla-unreal\valhalla.uproject
[2017.04.30-00.32.34:249][291]LogSlate: Took 0.060421 seconds to synchronously load lazily loaded font '../../../Engine/Content/Editor/Slate/Fonts/DroidSansMono.ttf' (77K)
[2017.04.30-00.32.35:476][338]UATHelper: Cooking (Windows): Project.Cook: ********** COOK COMMAND STARTED **********
[2017.04.30-00.32.35:482][338]UATHelper: Cooking (Windows): CommandUtils.RunCommandlet: Running UE4Editor Cook for project C:\Users\PhroZen\valhalla-proj\valhall
This file has been truncated, but you can view the full file.
LogPlatformFile: Not using cached read wrapper
LogInit:Display: RandInit(729124251) SRandInit(729124251).
LogTaskGraph: Started task graph with 5 named threads and 8 total threads with 1 sets of task threads.
LogStats: Stats thread started at 0.085192
LogInit:Warning: Incompatible or missing module: UE4Editor-valhalla.dll
Running E:/UE_4.16/Engine/Binaries/DotNET/UnrealBuildTool.exe valhalla Development Win64 -project="C:/Users/PhroZen/valhalla-proj/valhalla-416/valhalla.uproject" -editorrecompile -progress -NoHotReloadFromIDE
Creating makefile for valhalla (no existing makefile)
Performing full C++ include scan (no include cache file)
@progress push 5%
Parsing headers for valhallaEditor
@PhroZenOne
PhroZenOne / valhalla.h
Last active October 7, 2017 21:19
better version of UE_LOG
#define FUNCTION_NAME_LINE_NR (FString(__FUNCTION__) + TEXT("(") + FString::FromInt(__LINE__) + TEXT(")"))
#ifdef _MSC_VER
#define VALHALLA_LOG(LogCategory, Verbosity, FormatString, ...)\
__if_exists(this)\
{\
if(GEngine->GetWorldFromContextObject(this, EGetWorldErrorMode::ReturnNull))\
{\
switch(GEngine->GetWorldFromContextObject(this, EGetWorldErrorMode::ReturnNull)->GetNetMode())\
@PhroZenOne
PhroZenOne / compile-server.sh
Last active March 20, 2018 12:18
Build EU4 server on ubuntu.
#!/bin/bash
set -e
set -x
PROJECT_PATH=$1
CURRENT_DIR=$( cd "$( dirname "$0" )" && pwd )
if [[ "$PROJECT_PATH" != /* ]]; then
PROJECT_PATH=$CURRENT_DIR/$PROJECT_PATH
@PhroZenOne
PhroZenOne / cooking ue4
Created March 28, 2015 23:49
cooking ue4
+ ./Engine/Build/BatchFiles/RunUAT.sh BuildCookRun -nop4 -platform=Linux -project=/home/ubuntu/perforce/ThirdPersonCpp/ThirdPersonCpp.uproject -cook -compressed -allmaps -stage -archive -archivedirectory=/home/ubuntu/out -package -LinuxNoEditor -clientconfig=Development -serverconfig=Development -server -noclient -clean -pak -targetplatform=Linux -utf8output
Running AutomationTool...
AutomationTool exists: Deleting
Deleting all AutomationScript dlls
Compiling AutomationTool with xbuild
xbuild Source/Programs/AutomationTool/AutomationTool_Mono.csproj /p:Configuration=Development /p:Platform=AnyCPU /verbosity:quiet /nologo /p:TargetFrameworkProfile=
Compilation Succeeded
Start UAT: mono AutomationTool.exe BuildCookRun -nop4 -platform=Linux -project=/home/ubuntu/perforce/ThirdPersonCpp/ThirdPersonCpp.uproject -cook -compressed -allmaps -stage -archive -archivedirectory=/home/ubuntu/out -package -LinuxNoEditor -clientconfig=Development -serverconfig=Development -server -noclient -clean -pak -targetplatform=Linu
UFUNCTION(BlueprintCallable, Category = "Valhalla|Server", CustomThunk, meta = (CustomStructureParam = "structToFill"))
static void JsonToStruct(const UProperty* structToFill, const FString& json);
DECLARE_FUNCTION(execJsonToStruct) {
Stack.MostRecentPropertyAddress = nullptr;
Stack.MostRecentProperty = nullptr;
Stack.StepCompiledIn<UStructProperty>(NULL);
void* structPtr = Stack.MostRecentPropertyAddress;
auto structProperty = Cast<UStructProperty>(Stack.MostRecentProperty);
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.RandomAccessFile;
import java.util.ArrayList;