Page 1 of 1

UT error, how to solve it?

Posted: Thu Feb 23, 2017 1:11 am
by buby
Hi there, this is my first time here because I have met many problems with UT99. One of ths happen tonight as show in the picture and I wish to solve this matter, if there is a solution.
Thanks

Re: UT error, how to solve it?

Posted: Thu Feb 23, 2017 9:57 am
by ShaiHulud
Do you happen to remember what you were doing just before the error message appeared? Was Nexgen open? Do you always encounter that error on that map?

The Nexgen replace function has a potentially scary while loop (no limiter condition), but my best attempts to trip it up with edge-case input have failed. It would be good if we could find a scenario where the error occurred every time, so that the arguments to the function could be logged.

Re: UT error, how to solve it?

Posted: Thu Feb 23, 2017 10:17 am
by Barbie
You did not mention some circumstances:
* Were you playing locally or on line? Because Nexgen is often used in servers, I think the latter.
* If it was on line: are you the server maintainer?
* And, as ShaiHulud already asked: what did you do before this error occurred and is it reproducibly?

Aside from that I detected a bug in Nexgen112.NexgenUtil.uc that may have caused this error:
function replace

Code: Select all

/***************************************************************************************************
 *
 *  $DESCRIPTION  Replaces a specified substring in a string with another substring.
 *  $PARAM        source  The original string, which is to be filtered.
 *  $PARAM        oldStr  Substring in the original string that is to be replaced.
 *  $PARAM        newStr  Replacement for the substring to be replaced.
 *  $RETURN       The specified string where all occurrences of oldStr are replaced with newStr.
 *
 **************************************************************************************************/
static function string replace(coerce string source, coerce string oldStr, coerce string newStr) {
	local bool bDone;
	local int subStrIndex;
	local string result;
	local string strLeft;

	strLeft = source;

	// Replace each occurrence of oldStr with newStr.
	while (!bDone) {

		// Find index of oldStr in the part not examined yet.
		subStrIndex = instr(strLeft, oldStr);

		// Update examined and unexamined parts.
		if (subStrIndex < 0) {
			bDone = true;
			result = result $ strLeft;
		} else {
			result = result $ left(strLeft, subStrIndex) $ newStr;
			strLeft = mid(strLeft, subStrIndex + len(oldStr));
		}
	}

	// Return the filtered string.
	return result;
}
Because the InStr() function returns 0 if the search string is empty, the above replace() function will loop forever, if "oldStr" is empty.

<EDIT>
Example for map crashing UT added: one trigger logs the result of instr() with empty search text, the other trigger nearby the Pylon executes »log(Replace("Hello World", "", "none empty string"))« and will crash UT with this.
TestNexGen112Crash.jpg
</EDIT>

Re: UT error, how to solve it?

Posted: Thu Feb 23, 2017 10:29 am
by buby
Thank you guys for your rapid answers.
Well, you are right, I have missed some information:

1) I was playing online
2) I am not a server
3) this error happen when I was shotting
4) This error (looping) happen often look at here and here and here

Re: UT error, how to solve it?

Posted: Fri Feb 24, 2017 1:53 am
by Chamberly
Okay, I see 2 crash logs are Nexgen related due to language conflict?

The other 2 have crash related to inventory/maps (not just some maps but a lot of these maps will have these, no escape lol but you could use XC_Engine to avoid the crash or keep the crash)

Re: UT error, how to solve it?

Posted: Fri Feb 24, 2017 4:19 pm
by buby
Thank you, but let me know how to use "XC_Engine".

Thanks

PS.
I have found this link. Is it this that I have to install and modify? In my C:\UnrealTournament\System I have seen two files "XC_Spec_r6.u" and "XC_Spec_r9.u" what have I to do with these two files?

Re: UT error, how to solve it?

Posted: Fri Feb 24, 2017 4:59 pm
by Chamberly
The installation instruction are there, but later in that thread I posted a web link with a simplified installation instruction.

Those 2 files, just keep it there. Maps and some servers with siege mod use it.

Re: UT error, how to solve it?

Posted: Mon Feb 27, 2017 1:45 am
by buby
Another one error I have got today while playing rng-diskbar-lol doing nothing just camp.

Re: UT error, how to solve it?

Posted: Mon Feb 27, 2017 3:05 am
by ShaiHulud
That latter image is identical to the one sent to me - and included in this thread:

viewtopic.php?f=12&t=12054

...perhaps try the same solutions posted there and see if that helps.

Out of interest, was NexgenStatsViewer running on that server? It looks something like this when you join:

Image