Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[469b] Crash on failed to find global function #835

Open
SeriousBuggie opened this issue May 22, 2022 · 8 comments
Open

[469b] Crash on failed to find global function #835

SeriousBuggie opened this issue May 22, 2022 · 8 comments
Labels
UnrealScript This is an issue in the UnrealScript code

Comments

@SeriousBuggie
Copy link
Collaborator

Sometimes server crash with message like that:
Failed to find function PickDestination in Velociraptor MH-AOV-Tomb-Raider+Lost-Valley.Velociraptor141 Global 0
I think this caused call state-only function when Actor is in state which not have state function and not has global version function either.

For this exactly message this caused by this code:
jurassic.zip

All calls to PickDestination same as function itself located in state Hiding. One call even in state code. Possible there is cause.

Not sure what really happen there and how, but other players report same behavior for other code. So possible there some bug about it.

Maybe good idea on try call unexists Global function do nothing, instead of crash server.

@an-eternity
Copy link

an-eternity commented May 22, 2022

This could be somehow related: https://www.oldunreal.com/phpBB3/viewtopic.php?f=42&t=4499&p=42862#p42862

That example taken from package "EXU.u". Bugged script from that package called non-existing function, but the 'context' was not the same as in your case - it called non-existing function from non-existing parent class...
Interesting is that sometimes when non-existing function was called crash didn't happen, which means some random factor took place...

There is also one map ("MH-MHF-ADV_Assault[RMD]") where crash happens always, either on "PickDestination" or on "FindBestPathToward". It was mentioned in issue 422.

@SeriousBuggie
Copy link
Collaborator Author

Failed to find function ClearShot in TMale1Bot DM-Grinder.TMale1Bot1 Global 0

History: AActor::ProcessState <- AActor::Tick <- TickAllActors <- ULevel::Tick <- TickLevel <- 
UGameEngine::Tick <- UXC_GameEngine::Tick <- UpdateWorld <- MainLoopIteration <- MainLoop <- main

This exception happens with, and so far only with, MushMatch, in the middle of a match.

@wallabra
Copy link

wallabra commented Jul 8, 2022

MushMatch being this: https://github.com/wallabra/MushMatch

@wallabra
Copy link

wallabra commented Jul 8, 2022

Smells like a bug related to how the actor states are handled. Maybe the part of native code which directly uses actor states / state machines needs fixed?

@SeriousBuggie
Copy link
Collaborator Author

If you able reproduce it on regular basis - be very good if you attach steps for reproduce it.

In fact this situation must never happen, because places, where call state function exactly in specific state.

But somehow state changed, but code still run inside ol state. So this lead to attempt call function which not exists in new state. This as intended fallback to global function., Which not exists. So this produce crash.

But by simple logic it must produce warning in log, not a crash.

@stijn-volckaert stijn-volckaert added the UnrealScript This is an issue in the UnrealScript code label Jul 25, 2022
@SeriousBuggie
Copy link
Collaborator Author

SeriousBuggie commented Aug 30, 2023

Reproduce:

  1. Start play CrashState.zip

Expected result: No crash.
Actual result: Crash:

---------------------------
Critical Error
---------------------------
Failed to find function Bar in MyActor Autoplay.MyActor0 Global 0

History: (Autoplay.MyActor0 Autoplay.MyActor.A.Foo) <- AActor::ProcessState <- 
Object MyActor Autoplay.MyActor0, Old State State Autoplay.MyActor.A, New State State Autoplay.MyActor.B <- 
AActor::Tick <- TickAllActors <- ULevel::Tick <- (NetMode=0) <- TickLevel <- 
UGameEngine::Tick <- UpdateWorld <- MainLoop
---------------------------
ОК   
---------------------------

Used code:

class MyActor expands Actor;

auto state A {
	function Foo() {
		Log("Foo: start" @ GetStateName());
		ChangeState();
		Log("Foo: continue" @ GetStateName());
		Bar();
	}
	
	function Bar() {
		Log("Bar" @ GetStateName());
	}
	
Begin:
	Sleep(1);
	Foo();
	Sleep(1);
	Goto 'begin';
}

function ChangeState() {
	Log("ChangeState: start" @ GetStateName());
	GotoState('B');
	Log("ChangeState: end" @ GetStateName());
}

state B {
Begin:
	Sleep(1);
	Goto 'begin';	
}

log:

ScriptLog: Foo: start A
ScriptLog: ChangeState: start A
ScriptLog: ChangeState: end B
ScriptLog: Foo: continue B
Critical: appError called:
Critical: Failed to find function Bar in MyActor Autoplay.MyActor0 Global 0
Critical: Windows GetLastError: Not enough memory for process command (8)
Exit: Executing UObject::StaticShutdownAfterError
Exit: Executing UWindowsClient::ShutdownAfterError
Exit: ALAudio subsystem shut down.
Exit: UALAudioSubsystem::ShutdownAfterError
Log: DirectDraw End Mode
Exit: UD3D9RenderDevice::ShutdownAfterError
Critical: (Autoplay.MyActor0 Autoplay.MyActor.A.Foo)
Critical: AActor::ProcessState
Critical: Object MyActor Autoplay.MyActor0, Old State State Autoplay.MyActor.A, New State State Autoplay.MyActor.B
Critical: AActor::Tick
Critical: TickAllActors
Critical: ULevel::Tick
Critical: (NetMode=0)
Critical: TickLevel
Critical: UGameEngine::Tick
Critical: UpdateWorld
Critical: MainLoop
Exit: Exiting.

Issue reproduced on v469d RC2.

@SeriousBuggie
Copy link
Collaborator Author

SeriousBuggie commented Aug 30, 2023

And this crash again.
new one

Critical: appError called:
Critical: Failed to find function FindViewSpot in ST_TFemale2Bot CTF-XV-TheGrandCanyonV0.ST_TFemale2Bot1 Global 0
Exit: Executing UObject::StaticShutdownAfterError
Critical: (CTF-XV-TheGrandCanyonV0.ST_TFemale2Bot1 fnn238.bbBot.Hunting.PickDestination)
Critical: AActor::ProcessState
Critical: Object ST_TFemale2Bot CTF-XV-TheGrandCanyonV0.ST_TFemale2Bot1, Old State State fnn238.bbBot.Hunting, New State State Botpack.Bot.FallingState
Critical: AActor::Tick
Critical: TickAllActors
Critical: ULevel::Tick
Critical: (NetMode=1)
Critical: TickLevel
Critical: UGameEngine::Tick
Critical: UpdateWorld
Critical: UServerCommandlet::Main
Exit: Exiting.

prev one

Critical: appError called:
Critical: Failed to find function PickRegDestination in ST_TSkaarjbot CTF-XV-Veniis-RezqV3.ST_TSkaarjbot0 Global 0
Exit: Executing UObject::StaticShutdownAfterError
Critical: (CTF-XV-Veniis-RezqV3.ST_TSkaarjbot0 Botpack.Bot.TacticalMove.PickDestination)
Critical: AActor::ProcessState
Critical: Object ST_TSkaarjbot CTF-XV-Veniis-RezqV3.ST_TSkaarjbot0, Old State State fnn238.bbBot.TacticalMove, New State State fnn238.bbBot.RangedAttack
Critical: AActor::Tick
Critical: TickAllActors
Critical: ULevel::Tick
Critical: (NetMode=1)
Critical: TickLevel
Critical: UGameEngine::Tick
Critical: UpdateWorld
Critical: UServerCommandlet::Main
Exit: Exiting.

@SeriousBuggie
Copy link
Collaborator Author

Spots in bot code for trigger bug:

  1. TacticalMove contains PickRegDestination. Nobody else contain. Nor RangedAttack, nor Global.
  2. Hunting contains FindViewSpot. Nobody else contain. Nor FallingState, nor Global.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UnrealScript This is an issue in the UnrealScript code
Projects
None yet
Development

No branches or pull requests

4 participants