Page 1 of 1
What is the fix for the original console?
Posted: Sun Mar 29, 2009 10:47 pm
by Leo T_C_K
To not crash? And I don't mean the umenu or the one which you see during Unreal server browser. I mean the original classical console. Was it even fixed? 227 got it replaced with the uwindow like console afaik.
You know that false memory crash....What caused it?
Re: What is the fix for the original console?
Posted: Mon Mar 30, 2009 4:58 am
by []KAOS[]Casey
i'd actually go and find out but i'm going with coding so bad that the engine is ashamed of itself and crashes
Re: What is the fix for the original console?
Posted: Mon Mar 30, 2009 6:31 am
by Hyper
As far as I know it was never fixed. They worked around the problem by replacing the whole console with a window console. (A true fix would still be welcome; I would prefer the old console over the window one, it fits better into the look-and feel of Unreal imo.)
Re: What is the fix for the original console?
Posted: Mon Mar 30, 2009 9:27 am
by .:..:
That memory error is simply caused by this:
Code: Select all
var PlayerReplicationInfo MsgPlayer[64];
Pointer array to PlayerReplicationInfo actors. When some player have said a chat message it stores it there in the list, and when player disconnects from server the actor cleanup code dosen't set it's reference to NULL (it only NULL's out references from current in level Actors, not ALL objects) leaving an invalid pointer to that PRI. So next time you bring down the console and it tries to render chatting player name it crashes from that invalid pointer in this line:
Code: Select all
simulated function DrawConsoleView( Canvas C )
{
...
if (( MsgType[Line] == 'Say' ) || ( MsgType[Line] == 'TeamSay' ))
C.StrLen( MsgPlayer[Line].PlayerName$":"@MsgText[Line], XL, YL );
But indeed its fixable by setting it work alike UWindow console (store playername instead of PRI).
Re: What is the fix for the original console?
Posted: Mon Mar 30, 2009 1:33 pm
by Bane
That memory error is simply caused by this:
Code: Select all
var PlayerReplicationInfo MsgPlayer[64];
Pointer array to PlayerReplicationInfo actors. When some player have said a chat message it stores it there in the list, and when player disconnects from server the actor cleanup code dosen't set it's reference to NULL (it only NULL's out references from current in level Actors, not ALL objects) leaving an invalid pointer to that PRI. So next time you bring down the console and it tries to render chatting player name it crashes from that invalid pointer in this line:
Code: Select all
simulated function DrawConsoleView( Canvas C )
{
...
if (( MsgType[Line] == 'Say' ) || ( MsgType[Line] == 'TeamSay' ))
C.StrLen( MsgPlayer[Line].PlayerName$":"@MsgText[Line], XL, YL );
But indeed its fixable by setting it work alike UWindow console (store playername instead of PRI).
Shouldn't that give some form of NULL pointer error? The crash I've always gotten was "Ran out of virtual memory. To fix this issue...". Are you talking about some other crash that I've just never seen?
Re: What is the fix for the original console?
Posted: Mon Mar 30, 2009 1:59 pm
by .:..:
That memory error is simply caused by this:
Code: Select all
var PlayerReplicationInfo MsgPlayer[64];
Pointer array to PlayerReplicationInfo actors. When some player have said a chat message it stores it there in the list, and when player disconnects from server the actor cleanup code dosen't set it's reference to NULL (it only NULL's out references from current in level Actors, not ALL objects) leaving an invalid pointer to that PRI. So next time you bring down the console and it tries to render chatting player name it crashes from that invalid pointer in this line:
Code: Select all
simulated function DrawConsoleView( Canvas C )
{
...
if (( MsgType[Line] == 'Say' ) || ( MsgType[Line] == 'TeamSay' ))
C.StrLen( MsgPlayer[Line].PlayerName$":"@MsgText[Line], XL, YL );
But indeed its fixable by setting it work alike UWindow console (store playername instead of PRI).
Shouldn't that give some form of NULL pointer error? The crash I've always gotten was "Ran out of virtual memory. To fix this issue...". Are you talking about some other crash that I've just never seen?
Well theres no other logical reason here from what I see.
This is not actually a NULL pointer error, just wrong memory offset access violation (as if it actually were a NULL pointer here we would only see some script warnings).
As a result of invalid pointer it is possible that StrLen is being fed with a ton of gibberish text which overflows that function resulting in "ran out of memory" crash.
Re: What is the fix for the original console?
Posted: Mon Mar 30, 2009 2:24 pm
by Bane
erm, NULL wasn't the right word. My mistake.
Anyways. It should give some kind of access violation error from what you're saying, not an allocation error. Unless UScript just does some really weird stuff, Strlen() shouldn't be allocating anything. Of course, I don't know much about the inner workings of UScript, so maybe it does have to allocate something. Are you positive that's where the error occurs? Also, shouldn't the console be filled with illegal pointers to deleted PRI objects every map switch? You'd think the crash would happen much more often. And isn't MsgType[] reset ever? If it was reset then the 'then' part wouldn't get called, and if it wasn't, you should see a bunch of garbage in the console after a map switch.
Re: What is the fix for the original console?
Posted: Mon Mar 30, 2009 3:11 pm
by .:..:
Actually it is possible it tries to allocates too long string when it duplicates the string for the function inner use.
As for the mapchange, the console script clears the message list so it wouldnt crash from that (as this would obviously leave old maps referenced in memory):
Code: Select all
event NotifyLevelChange()
{
...
ClearMessages();
}
Re: What is the fix for the original console?
Posted: Mon Mar 30, 2009 4:20 pm
by Bane
Actually it is possible it tries to allocates too long string when it duplicates the string for the function inner use.
As for the mapchange, the console script clears the message list so it wouldnt crash from that (as this would obviously leave old maps referenced in memory):
Code: Select all
event NotifyLevelChange()
{
...
ClearMessages();
}
Right.
Code: Select all
function ClearMessages()
{
for (i=0; i
Re: What is the fix for the original console?
Posted: Mon Mar 30, 2009 4:44 pm
by .:..:
And the only way to change the type to Say or TeamSay would overwrite any invalid PRI reference. I really don't think that's the place where the error occurs.
No, you dont see the error. You see in online games while ur playing in some server you receive a lot of chat messages, then the chatting player disconnects away from server (deleting PRI Actor after a while but still leaving in Console reference to it). So next time you bring down console (while being in that server), your game may crash (depending on whatever actor has been cleaned up from memory yet or only have bDeleteMe on True).
Re: What is the fix for the original console?
Posted: Mon Mar 30, 2009 5:50 pm
by Bane
And the only way to change the type to Say or TeamSay would overwrite any invalid PRI reference. I really don't think that's the place where the error occurs.
No, you dont see the error. You see in online games while ur playing in some server you receive a lot of chat messages, then the chatting player disconnects away from server (deleting PRI Actor after a while but still leaving in Console reference to it). So next time you bring down console (while being in that server), your game may crash (depending on whatever actor has been cleaned up from memory yet or only have bDeleteMe on True).
Uh. What.
I've heard that objects have quirks with actor references and garbage collection, but from what you're describing it sounds more like objects and actors handle actor references completely differently.
The only quirk about object->actor references I can remember is that an object can have a reference to an actor at level end. Since there is a valid reference to that actor, it doesn't get garbage collected when it should, causing a whole chain of garbage collection issues, so you even have the entire map not getting collected. Or something like that; I usually just preferred to not use objects so I never ran into it.
When a player disconnects after saying something, I see ": message" in the console instead of "Name: message". That's to be expected; the PRI actor is destroyed, so when the console tries to get the playername, which generates an acessed none and returns "". That should be all that happens. Why does it sound like you're saying that's the situation only when doing (none).playername from an actor and not from an object? It sounds like you're saying that from an object, an accessed none would act something like dereferencing random memory in C.
Plus, I'm pretty sure I've GPF'd from bringing down the console immediately after joining a server. I could be mistaken, but I don't think I am.
Re: What is the fix for the original console?
Posted: Mon Mar 30, 2009 7:07 pm
by .:..:
Thats because destroyed actors will stay in memory until deleted actors chain is big enough and it will cleanup them from memory (it has nothing to do with garbage collecting), however while cleaning up from memory it sets all references to that actor to None from Actor list (NOT Object list, which would be very slow). So any objects that have a reference to some destroyed actor which has been destroyed a while ago will cause a crash when tried to be used.
Re: What is the fix for the original console?
Posted: Mon Mar 30, 2009 7:23 pm
by Bane
Thats because destroyed actors will stay in memory until deleted actors chain is big enough and it will cleanup them from memory (it has nothing to do with garbage collecting), however while cleaning up from memory it sets all references to that actor to None from Actor list (NOT Object list, which would be very slow). So any objects that have a reference to some destroyed actor which has been destroyed a while ago will cause a crash when tried to be used.
Ah, now I get it. Thanks.
Re: What is the fix for the original console?
Posted: Fri Apr 10, 2009 7:50 pm
by Leo T_C_K
By the way: Any idea what is exactly reposnible for editactor? I found out that the 224 upak console when used with 226, with that fixed compat.function so it doesn't crash have not working editactor class online, i mean you can't even view the properties, perhaps it may be because i was in jcoopz server though but still, with ubrowser console it works...any idea how to fix that?