Commit Graph

716 Commits

Author SHA1 Message Date
geoff evans
53abf13a6b Windows: Always print the error string when it's provided to ErrorOutputDevice::Serialize
### Notes
Many other platforms already do this, this just brings parity to Windows.
I think by design the error message is meant to be reported via a call to HandleError() or LogFormattedMessageWithCallstack(), but sometimes neither happens. The reasons are unclear due to lack of information.

This print may be redundant (the message be printed twice in some situations, once with a callstack and once without), but that's better than not having it at all in edge cases.

#rnx
#rb joe.kirchoff
#jira UE-151094
#preflight 6283ed244106f5854a6e4dae

[CL 20248920 by geoff evans in ue5-main branch]
2022-05-17 15:09:29 -04:00
Devin Doucette
4b99be9d9e Avoid calling GLog->TearDown() from RequestExit as it may deadlock
#preflight 627ec8eebb2c29688c468c8f
#rb Tim.Smith
#rnx

[CL 20224709 by Devin Doucette in ue5-main branch]
2022-05-16 11:06:18 -04:00
geoff evans
d90ca97505 RenderingThread: Fix lack of logging the message and callstack for check() failures
### Notes
The check() message and callstack is actually printed in FWindowsErrorOutputDevice::HandleError which is called in the __except block after we RaiseException() inside ReportAssert(). However, RenderingThread's __except doesn't do this, so the contents of GErrorHist are lost to everyone except for CrashReporter. This change adds this necessary logging.

Also, add Windows Launch support for -IgnoreDebugger when choosing __try/__except or not (this precedes initialization of GIgnoreDebugger). This makes debugging easier for this class of issue.

### Testing
Repro steps are in the JIRA. Tested at that change (which has a reliable RenderingThread check() failure), and at #head where no defect exists. Tests fail and pass, respectively, as expected.

#rnx
#rb francis.hurteau
#jira UE-151056
#preflight 627b0b4ac42338be653745e6

[CL 20140980 by geoff evans in ue5-main branch]
2022-05-11 11:19:14 -04:00
Devin Doucette
c8db2d77fe Logging: Added a workaround to log callstacks for failed assertions
#preflight 626ac3c5b17dd9121b406186
#rb Josh.Adams

[CL 19966435 by Devin Doucette in ue5-main branch]
2022-04-28 14:52:11 -04:00
mihnea balta
a1d48e99c2 Report monitor resolution and scene viewport size in the log.
#rnx
#lockdown Michal.Valient
#jira UE-150364
#preflight https://horde.devtools.epicgames.com/job/62693ed52735a2c0ea700bbb
#rb Rolando.Caloca

#ROBOMERGE-AUTHOR: mihnea.balta
#ROBOMERGE-SOURCE: CL 19939381 in //UE5/Release-5.0/... via CL 19941154
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19945729 by mihnea balta in ue5-main branch]
2022-04-27 16:08:52 -04:00
mihnea balta
dd4a609400 Report the Windows build number and revision number in the log at startup.
Also adds support for detecting Windows Server 2022.

#jira UE-149576
#rnx
#lockdown Michal.Valient
#preflight https://horde.devtools.epicgames.com/job/625ec6259c09ef439d96bc85
#rb Christopher.Waters

#ROBOMERGE-AUTHOR: mihnea.balta
#ROBOMERGE-SOURCE: CL 19936502 in //UE5/Release-5.0/... via CL 19936683
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19937373 by mihnea balta in ue5-main branch]
2022-04-27 07:38:37 -04:00
robert millar
c0e08bb9df Move support for adding all thread callstacks to crash context from Windows to Microsoft.
#rb none

#ROBOMERGE-AUTHOR: robert.millar
#ROBOMERGE-SOURCE: CL 19928610 via CL 19930155 via CL 19931144 via CL 19931272
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19932829 by robert millar in ue5-main branch]
2022-04-26 20:15:07 -04:00
robert millar
edbf1f0c8d Add MicrosoftPlatformCrashContext and MicrosoftPlatformStackWalk to share code between Microsoft platforms.
#rb david.harvey

#ROBOMERGE-AUTHOR: robert.millar
#ROBOMERGE-SOURCE: CL 19920967 via CL 19923246 via CL 19924138 via CL 19924689
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19927818 by robert millar in ue5-main branch]
2022-04-26 16:25:18 -04:00
Johan Torp
088c218e96 Windows memory mapping improvements
Fix error handling, make PreloadHint respect in parameters and overload SupportsMemoryMappedFiles

#rb robert.seiver
#preflight yes

[CL 19898968 by Johan Torp in ue5-main branch]
2022-04-25 03:17:59 -04:00
Devin Doucette
7d3b035e8c Logging: Fixed missing callstacks for Windows crashes
The crash reporter thread was calling GLog->Panic() which would make it the panic thread and prevent subsequent logging from any other thread. Panic from ReportCrash to ensure that the thread handling the exception is the panic thread, which allows it to log the callstack after the crash reporter finishes.

#jira UE-148406
#preflight 6255f4d6647ad886b3693531
#rb Zousar.Shaker
#rnx

[CL 19738619 by Devin Doucette in ue5-main branch]
2022-04-13 09:16:17 -04:00
Devin Doucette
292008ea35 Logging: Replaced GLog->PanicFlush() with GLog->Panic()
Panic allows only one thread to become the panic thread. In panic mode, logs are only sent to panic-safe output devices. Each call to Panic flushes buffered logs to panic-safe output devices, and flushes panic-safe output devices.

#jira UE-147152
#preflight 62424814292f228e09d8a612
#rb Zousar.Shaker
#fyi Brandon.Schaefer

[CL 19545093 by Devin Doucette in ue5-main branch]
2022-03-29 13:31:48 -04:00
Devin Doucette
c8d64e3c97 Logging: Added and migrated to GLog->PanicFlush() for crash handling
#preflight 623a433a10251d53d5796835
#rb Zousar.Shaker

[CL 19478551 by Devin Doucette in ue5-main branch]
2022-03-23 09:39:18 -04:00
steve robb
87fb605867 TCHAR array init fixes for UTF-8 mode.
#rb devin.doucette
#preflight 6231e536e2541b4ff3af6cd2

#ROBOMERGE-AUTHOR: steve.robb
#ROBOMERGE-SOURCE: CL 19405353 via CL 19408955 via CL 19419621 via CL 19419706
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v930-19419903)

[CL 19420584 by steve robb in ue5-main branch]
2022-03-17 10:29:53 -04:00
jeannoe morissette
6d083e9aaf Fix driver version check for Windows on NVIDIA.
#jira UE-145362
#preflight 6228f4e41357c5e91307fa84
#lockdown Michal.Valient
#rnx

#ROBOMERGE-AUTHOR: jeannoe.morissette
#ROBOMERGE-SOURCE: CL 19337685 in //UE5/Release-5.0/... via CL 19348971
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19349177 by jeannoe morissette in ue5-main branch]
2022-03-10 23:55:58 -05:00
danny couture
4114b4b372 Add support for dynamic thread prioritization
- This restore proper prioritization support that was lost with the new task backend while keeping a sane number of threads
  - This helps to prevent latency sensitive tasks from going to efficient cores for Alder Lake
  - This fixes performance problems caused by high prio task getting picked up by background threads and being preempted under high-load, causing FPS hiccups.
  - SetThreadPriority takes ~20us on average on Windows System and is only paid for background work
  - Longer SetThreadPriority can be expected when lowering the priority of a task under heavy load, which might cause the caller to be preempted right away, this is expected.
  - Can be A/B tested from command-line with -TaskGraphUseDynamicPrioritization=1/0

#rb Andriy.Tylychko, Arne.Schober, Stefan.Boberg
#preflight 622786a7e83598518f3745a1

[CL 19314282 by danny couture in ue5-main branch]
2022-03-08 19:24:40 -05:00
steve robb
288f3de432 Fixes for the implicit conversion of ints and chars to TCHARs in UTF-8 mode.
#rb trivial
#preflight 621ed0b4e15c51d8c5e5d081

#ROBOMERGE-OWNER: steve.robb
#ROBOMERGE-AUTHOR: steve.robb
#ROBOMERGE-SOURCE: CL 19219816 via CL 19220283 via CL 19220288 via CL 19223679
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19227684 by steve robb in ue5-main branch]
2022-03-02 15:30:50 -05:00
PJ Kack
23456e2db7 Add FGenericPlatformProcess::TerminateProcTreeWithPredicate() that enables killing a launched process tree while keeping some of the child processes alive.
#jira none
#rb carlmagnus.nordin
#rnx
#preflight 621df1fcf1206ae3ea3c23be

[CL 19196914 by PJ Kack in ue5-main branch]
2022-03-01 07:42:09 -05:00
steve robb
33c800a605 TEXT(""_SV) changed to TEXTVIEW("") for UTF-8 support.
#rb trivial

#ROBOMERGE-OWNER: steve.robb
#ROBOMERGE-AUTHOR: steve.robb
#ROBOMERGE-SOURCE: CL 19135062 via CL 19136099 via CL 19136620 via CL 19138526
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19155676 by steve robb in ue5-main branch]
2022-02-25 15:48:16 -05:00
michael noland
28ee88b5e1 Added a Windows-specific version of FWindowsPlatformMisc::GetMaxRefreshRate
#jira UE-142825
#rb nick.darnell
#preflight 620c06cd4353dc61c7fd3b90
#lockdown julien.marchand

#ROBOMERGE-AUTHOR: michael.noland
#ROBOMERGE-SOURCE: CL 19058655 in //UE5/Release-5.0/... via CL 19074349
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19076494 by michael noland in ue5-main branch]
2022-02-22 13:48:19 -05:00
Wojciech Krywult
c2a62160ec Windows: Added an option to initialize COM in the MTA (multithreading) mode (it defaults to STA i.e. singlethreading mode as before)
#rb Rolando.Caloca, jeff.newquist
#preflight 620e82d8e55d9645848be5f4
#rnx

[CL 19037697 by Wojciech Krywult in ue5-main branch]
2022-02-17 13:24:20 -05:00
stefan boberg
05635692aa Added heuristic for detecting Windows 11 in WindowsPlatformMisc.cpp
#preflight https://horde.devtools.epicgames.com/job/620102296773a3612885d2fd
#lockdown mark.lintott
#jira UE-141492
#rb danny.couture,mihnea.balta,geoff.evans

#ROBOMERGE-AUTHOR: stefan.boberg
#ROBOMERGE-SOURCE: CL 18884144 in //UE5/Release-5.0/... via CL 18884157 via CL 18884194
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18884910 by stefan boberg in ue5-main branch]
2022-02-07 09:14:41 -05:00
ionut matasaru
9f38497358 [Insights] Fixed memory tracking for an FRunnableThread to emit a free event when the thread ends (this time without resetting Runnable to nullptr when thread ends).
#jira UE-140358
#rb Johan.Berg
#preflight 61f796c741414fb013b5b467

#ROBOMERGE-AUTHOR: ionut.matasaru
#ROBOMERGE-SOURCE: CL 18787315 in //UE5/Release-5.0/... via CL 18787321 via CL 18787340
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18787342 by ionut matasaru in ue5-main branch]
2022-01-31 03:13:35 -05:00
eric mcdaniel
361f6b69d1 [Backout] - CL18771801
- this change prevents gauntlet from running tasks on Xbox so I am backing it out
  - instance of Horde failure:  https://horde.devtools.epicgames.com/job/61f43b2f74510448a686da51?step=72cc

- the XboxConsoleInputReader thread is created and immediately terminates
  - this change introduced a null out of Runnable in the Xbox version of FRunnableThreadWin::Run()
    - this causes FRunnableThread::SetupCreatedThread() to assert on startup that a valid runnable thread was created but has no Runnable

#rb none
#preflight 61f47fb6801201ab389bb311
[FYI] ionut.matasaru

Original CL Desc
-----------------------------------------------------------------
[Insights]
  - Fixed memory tracking for an FRunnableThread to emit a free event when the thread ends.
  - Fixed memory tracking for "ProgramSize" of loaded modules (dlls), to emit a free event when dll is unloaded.

#jira UE-140358
#rb Johan.Berg
#preflight 61f40923f628752a568b292b

#ROBOMERGE-AUTHOR: eric.mcdaniel
#ROBOMERGE-SOURCE: CL 18781656 in //UE5/Release-5.0/... via CL 18781895 via CL 18781943
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18781953 by eric mcdaniel in ue5-main branch]
2022-01-28 20:10:09 -05:00
ionut matasaru
2df95139ab [Insights]
- Fixed memory tracking for an FRunnableThread to emit a free event when the thread ends.
  - Fixed memory tracking for "ProgramSize" of loaded modules (dlls), to emit a free event when dll is unloaded.

#jira UE-140358
#rb Johan.Berg
#preflight 61f40923f628752a568b292b

#ROBOMERGE-AUTHOR: ionut.matasaru
#ROBOMERGE-SOURCE: CL 18771801 in //UE5/Release-5.0/... via CL 18771806 via CL 18771881
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18771891 by ionut matasaru in ue5-main branch]
2022-01-28 10:54:49 -05:00
johan berg
e83f240b1e [Insights] Report ThreadStack size correctly.
#rb ionut.matasaru
#preflight 61f2b40f800734b52da7a7d4

#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18753812 in //UE5/Release-5.0/... via CL 18753843 via CL 18756968
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18757286 by johan berg in ue5-main branch]
2022-01-27 14:10:33 -05:00