You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2845644 on 2016/01/27 by Martin.Wilson Clear marker sync flag after creating tick record, add more information to checks incase issue occurs again #Jira OR-13469 #rb Thomas.Sarkanen #tests in editor tests, bot match. Change 2845613 on 2016/01/27 by John.Pollard Latest network profiler binaries #rb none #tests run profiler Change 2845595 on 2016/01/27 by Mieszko.Zielinski Fixed pathfollowing's block detection using wrong distance when testing for blockage #UE4 #rb Lukasz.Furman #test golden path Change 2845593 on 2016/01/27 by Jeff.Farris Added support for setting and choosing filmbacks and lenses for cinematic cameras. - New CineCameraComponent and CineCameraActor classes - can define filmback and lens presets via ini file - details customizations for filmback and lens selection - added prototype set of filmbacks and lenses (primes and zooms) - Camera details customization now gracefully handles when CameraSettings category is hidden - example sequencer usage is content/developers/jeff.farris/CineCams/CineCamTestMap #rb none #tests editor Change 2845585 on 2016/01/27 by Marcus.Wassmer Don't fool with connected state if we're early outing from the OS intercepting controller events. This fixes some missing delegates. Fixes cert bug about controller disconnect screen staying up permanently #rb Cody.Haskell #test Turning off controller, turning on again. #lockdown Andrew.Grant Change 2845528 on 2016/01/27 by Max.Chen Sequencer: Fix new spawnables not immediately getting an object binding. This was resulted in a missing +Track->Animation when first creating a spawnable and duplicate transform keys. #jira UE-26084 #tests Add spawnable, +Track->Animation exists #rb none Change 2845483 on 2016/01/27 by Andrew.Rodham Sequencer: Fixed MaximizedViewport not getting cleared/restored correctly #jria UE-26016 #rb Max.Chen #tests Tested the viewports Change 2845421 on 2016/01/27 by Max.Preussner Sequencer: Implemented go-to feature #RB max.chen #TESTS Editor Change 2845407 on 2016/01/27 by Max.Preussner Sequencer: Moved SetViewRange() into ISequencer and made it public #RB max.chen #TESTS none Change 2845404 on 2016/01/27 by Andrew.Rodham Sequencer: Fixed cinematic viewport not updating when dragging transport range #jira UE-26003 #rb Max.Chen #tests Scrubbed the timeline Change 2845396 on 2016/01/27 by David.Nikdel #OSS #Purchase #Store #PS4 - Minor log cleanup #RB: none #TESTS: compiles Change 2845375 on 2016/01/27 by Max.Chen Sequencer: Implement cinematic shot track thumbnails. #jira UE-25125 #tests Rebuild the trailer with the cinematic shot track #rb none Change 2845359 on 2016/01/27 by Marcus.Wassmer Downgrade some checks to ensures. #rb none #test ps4 Change 2845347 on 2016/01/27 by Nicholas.Davies Remove unused EditorStyle dependency from Social. It is not being used, and causes issues for the engine team. #RB Antony.Carter #TESTS n/a #codereview Robert.Manuszewski Change 2845227 on 2016/01/27 by Robert.Manuszewski Adding flags to create callstack map files when building Arxan protection #rb none #tests Built arxan exe Change 2844871 on 2016/01/26 by Andrew.Grant Prevent enums from being regenerated while cooking (prevents false-positive warning about FText's being regenerated) #rb none #tests ran editor [CL 2847722 by Andrew Grant in Main branch]
256 lines
7.1 KiB
C++
256 lines
7.1 KiB
C++
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "LinuxCommonStartup.h"
|
|
#include "ExceptionHandling.h"
|
|
#include "LinuxPlatformCrashContext.h"
|
|
#include "ModuleManager.h"
|
|
#include "EngineVersion.h"
|
|
|
|
#include <locale.h>
|
|
#include <sys/resource.h>
|
|
|
|
static FString GSavedCommandLine;
|
|
extern int32 GuardedMain( const TCHAR* CmdLine );
|
|
extern void LaunchStaticShutdownAfterError();
|
|
|
|
// FIXME: handle expose it someplace else?
|
|
extern int32 DLLIMPORT ReportCrash(const FLinuxCrashContext& Context);
|
|
extern void DLLIMPORT GenerateCrashInfoAndLaunchReporter(const FLinuxCrashContext& Context);
|
|
|
|
/**
|
|
* Game-specific crash reporter
|
|
*/
|
|
void CommonLinuxCrashHandler(const FGenericCrashContext& GenericContext)
|
|
{
|
|
// at this point we should already be using malloc crash handler (see PlatformCrashHandler)
|
|
|
|
const FLinuxCrashContext& Context = static_cast< const FLinuxCrashContext& >( GenericContext );
|
|
printf("CommonLinuxCrashHandler: Signal=%d\n", Context.Signal);
|
|
|
|
ReportCrash(Context);
|
|
if (GLog)
|
|
{
|
|
GLog->Flush();
|
|
}
|
|
if (GWarn)
|
|
{
|
|
GWarn->Flush();
|
|
}
|
|
if (GError)
|
|
{
|
|
GError->Flush();
|
|
GError->HandleError();
|
|
}
|
|
|
|
return GenerateCrashInfoAndLaunchReporter(Context);
|
|
}
|
|
|
|
|
|
/**
|
|
* Sets (soft) limit on a specific resource
|
|
*
|
|
* @param Resource - one of RLIMIT_* values
|
|
* @param DesiredLimit - desired value
|
|
* @param bIncreaseOnly - avoid changing the limit if current value is sufficient
|
|
*/
|
|
bool SetResourceLimit(int Resource, rlim_t DesiredLimit, bool bIncreaseOnly)
|
|
{
|
|
rlimit Limit;
|
|
if (getrlimit(Resource, &Limit) != 0)
|
|
{
|
|
fprintf(stderr, "getrlimit() failed with error %d (%s)\n", errno, strerror(errno));
|
|
return false;
|
|
}
|
|
|
|
if (bIncreaseOnly && (Limit.rlim_cur == RLIM_INFINITY || Limit.rlim_cur >= DesiredLimit))
|
|
{
|
|
if (!UE_BUILD_SHIPPING)
|
|
{
|
|
printf("- Existing per-process limit (soft=%lu, hard=%lu) is enough for us (need only %lu)\n", Limit.rlim_cur, Limit.rlim_max, DesiredLimit);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
Limit.rlim_cur = DesiredLimit;
|
|
if (setrlimit(Resource, &Limit) != 0)
|
|
{
|
|
fprintf(stderr, "setrlimit() failed with error %d (%s)\n", errno, strerror(errno));
|
|
|
|
if (errno == EINVAL)
|
|
{
|
|
if (DesiredLimit == RLIM_INFINITY)
|
|
{
|
|
fprintf(stderr, "- Max per-process value allowed is %lu (we wanted infinity).\n", Limit.rlim_max);
|
|
}
|
|
else
|
|
{
|
|
fprintf(stderr, "- Max per-process value allowed is %lu (we wanted %lu).\n", Limit.rlim_max, DesiredLimit);
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Expects GSavedCommandLine to be set up. Increases limit on
|
|
* - number of open files to be no less than desired (if specified on command line, otherwise left alone)
|
|
* - size of core file, so core gets dumped and we can debug crashed builds (unless overridden with -nocore)
|
|
*
|
|
*/
|
|
static bool IncreasePerProcessLimits()
|
|
{
|
|
// honor the parameter if given, but don't change limits if not
|
|
int32 FileHandlesToReserve = -1;
|
|
if (FParse::Value(*GSavedCommandLine, TEXT("numopenfiles="), FileHandlesToReserve) && FileHandlesToReserve > 0)
|
|
{
|
|
if (!UE_BUILD_SHIPPING)
|
|
{
|
|
printf("Increasing per-process limit of open file handles to %d\n", FileHandlesToReserve);
|
|
}
|
|
|
|
if (!SetResourceLimit(RLIMIT_NOFILE, FileHandlesToReserve, true))
|
|
{
|
|
fprintf(stderr, "Could not adjust number of file handles, consider changing \"nofile\" in /etc/security/limits.conf and relogin.\nerror(%d): %s\n", errno, strerror(errno));
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// core dump policy:
|
|
// - Shipping and Test disable by default (unless -core is passed)
|
|
// - The rest set it to infinity unless -nocore is passed
|
|
// (in all scenarios user wish as expressed with -core or -nocore takes priority)
|
|
bool bDisableCore = (UE_BUILD_SHIPPING != 0 || UE_BUILD_TEST != 0);
|
|
if (FParse::Param(*GSavedCommandLine, TEXT("nocore")))
|
|
{
|
|
bDisableCore = true;
|
|
}
|
|
if (FParse::Param(*GSavedCommandLine, TEXT("core")))
|
|
{
|
|
bDisableCore = false;
|
|
}
|
|
|
|
if (bDisableCore)
|
|
{
|
|
printf("Disabling core dumps.\n");
|
|
if (!SetResourceLimit(RLIMIT_CORE, 0, false))
|
|
{
|
|
fprintf(stderr, "Could not set core file size to 0, error(%d): %s\n", errno, strerror(errno));
|
|
return false;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
printf("Increasing per-process limit of core file size to infinity.\n");
|
|
if (!SetResourceLimit(RLIMIT_CORE, RLIM_INFINITY, true))
|
|
{
|
|
fprintf(stderr, "Could not adjust core file size, consider changing \"core\" in /etc/security/limits.conf and relogin.\nerror(%d): %s\n", errno, strerror(errno));
|
|
fprintf(stderr, "Alternatively, pass -nocore if you are unable or unwilling to do that.\n");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
|
|
int CommonLinuxMain(int argc, char *argv[], int (*RealMain)(const TCHAR * CommandLine))
|
|
{
|
|
FPlatformMisc::SetGracefulTerminationHandler();
|
|
|
|
if (UE_BUILD_SHIPPING)
|
|
{
|
|
// only printed in shipping
|
|
printf("%s %d %d %d %d\n", StringCast<ANSICHAR>(*FEngineVersion::Current().ToString()).Get(), GEngineMinNetVersion, GEngineNegotiationVersion, GPackageFileUE4Version, GPackageFileLicenseeUE4Version);
|
|
}
|
|
|
|
int ErrorLevel = 0;
|
|
|
|
if (setenv("LC_NUMERIC", "en_US", 1) != 0)
|
|
{
|
|
int ErrNo = errno;
|
|
fprintf(stderr, "Unable to setenv(LC_NUMERIC): errno=%d (%s)", ErrNo, strerror(ErrNo));
|
|
}
|
|
setlocale(LC_CTYPE, "");
|
|
|
|
for (int32 Option = 1; Option < argc; Option++)
|
|
{
|
|
GSavedCommandLine += TEXT(" ");
|
|
// we need to quote stuff that has spaces in it because something somewhere is removing quotation marks before they arrive here
|
|
FString Temp = UTF8_TO_TCHAR(argv[Option]);
|
|
if (Temp.Contains(TEXT(" ")))
|
|
{
|
|
if(Temp.StartsWith(TEXT("-")))
|
|
{
|
|
Temp = Temp.Replace(TEXT("="), TEXT("=\""));
|
|
}
|
|
else
|
|
{
|
|
Temp = TEXT("\"") + Temp;
|
|
}
|
|
Temp += TEXT("\"");
|
|
}
|
|
GSavedCommandLine += Temp; // note: technically it depends on locale
|
|
}
|
|
|
|
if (!UE_BUILD_SHIPPING)
|
|
{
|
|
GAlwaysReportCrash = true; // set by default and reverse the behavior
|
|
if ( FParse::Param( *GSavedCommandLine,TEXT("nocrashreports") ) || FParse::Param( *GSavedCommandLine,TEXT("no-crashreports") ) )
|
|
{
|
|
GAlwaysReportCrash = false;
|
|
}
|
|
}
|
|
|
|
if (!IncreasePerProcessLimits())
|
|
{
|
|
fprintf(stderr, "Could not set desired per-process limits, consider changing system limits.\n");
|
|
ErrorLevel = 1;
|
|
}
|
|
else
|
|
{
|
|
#if UE_BUILD_DEBUG
|
|
if( true && !GAlwaysReportCrash )
|
|
#else
|
|
if( FPlatformMisc::IsDebuggerPresent() && !GAlwaysReportCrash )
|
|
#endif
|
|
{
|
|
// Don't use exception handling when a debugger is attached to exactly trap the crash. This does NOT check
|
|
// whether we are the first instance or not!
|
|
ErrorLevel = RealMain( *GSavedCommandLine );
|
|
}
|
|
else
|
|
{
|
|
FPlatformMisc::SetCrashHandler(CommonLinuxCrashHandler);
|
|
GIsGuarded = 1;
|
|
// Run the guarded code.
|
|
ErrorLevel = RealMain( *GSavedCommandLine );
|
|
GIsGuarded = 0;
|
|
}
|
|
}
|
|
|
|
// check if a specific return code has been set
|
|
uint8 OverriddenErrorLevel = 0;
|
|
if (FPlatformMisc::HasOverriddenReturnCode(&OverriddenErrorLevel))
|
|
{
|
|
ErrorLevel = OverriddenErrorLevel;
|
|
}
|
|
|
|
if (ErrorLevel)
|
|
{
|
|
printf("Exiting abnormally (error code: %d)\n", ErrorLevel);
|
|
}
|
|
return ErrorLevel;
|
|
}
|
|
|
|
|
|
class FLinuxCommonStartupModule : public IModuleInterface
|
|
{
|
|
/** IModuleInterface implementation */
|
|
virtual void StartupModule() override {};
|
|
virtual void ShutdownModule() override {};
|
|
};
|
|
|
|
IMPLEMENT_MODULE(FLinuxCommonStartupModule, LinuxCommonStartup);
|