Doom monster
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > Eternity > Alias Crash
 
Author
All times are GMT. The time now is 09:04. Post New Thread    Post A Reply
RazTK
Junior Member


Posts: 127
Registered: 10-05


If you type something like: alias "test" "echo ...;test"
and then type test at the console, the game will crash out.

Old Post 11-16-05 05:44 #
RazTK is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
WildWeasel
Resident Castlevania Super-Fanboy


Posts: 1705
Registered: 07-03


Somehow I get the feeling that this is a clear-cut case of "Don't Do That." What you're doing is an infinite loop without any sort of wait times in between loops, which typically will steal CPU cycles because there is no room for the CPU to "breathe."

Thankfully, Eternity doesn't allow this sort of thing to happen and just crashes out when such a thing is encountered.

Old Post 11-18-05 10:50 #
WildWeasel is offline Profile || Blog || PM || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 2202
Registered: 08-00


WildWeasel is right. I took a look at this in the debugger and it is causing a stack overflow, meaning that the function C_RunTextCmd is indirectly executing itself in an infinite fashion as it tries to expand the macro over and over. There's no simple way to prevent this due to the structure of the code without completely forbidding an alias to contain the same text as its own name. This would artificially limit what can be done with aliases in some cases, however.

Old Post 11-18-05 15:15 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
RazTK
Junior Member


Posts: 127
Registered: 10-05


It's crashing even if I do: alias "test" "echo ...;delay 1000;test"
I thought Eternity can handle that.

Last edited by RazTK on 11-18-05 at 16:05

Old Post 11-18-05 15:58 #
RazTK is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 2202
Registered: 08-00


I'd assume the alias expansion occurs before the command is executed. I don't know though. It's entirely possible that the delay command doesn't work right; it is a feature from SMMU that I have never tested. Anyways, all of this stuff will get sorted out if/when possible.

Old Post 11-18-05 16:13 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
RazTK
Junior Member


Posts: 127
Registered: 10-05


I figured this problem when I tried to do this kind of script:
code:
alias "autosummon" "start" alias "start" "alias ss ss2;alias autosummon stopsummon;ss2" alias "stopsummon" "alias ss stops;alias autosummon start" alias "ss2" "summon doombarrel;delay 1;ss" alias "stops" "echo Stopped"

Old Post 11-18-05 18:07 #
RazTK is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 2202
Registered: 08-00


The problem is that console commands are not interpreted anything like scripts; they are parsed and each command is run consecutively, back to back. Delays may be queued up between the commands as they are buffered, but the entire command must be parsed immediately. That means that alias resolving is not deferred to the time of command execution. That's why recursive aliases cause stack overflow.

I think I see what you're trying to do, and I don't think it'll work with the way the console currently functions. As you may or may not know depending on whether you've read the Eternity changelog and stuff in here, the entire console is way overdue for a rewrite. I don't know when or how it will happen, but it WILL happen eventually.

Old Post 11-18-05 19:31 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
All times are GMT. The time now is 09:04. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > Eternity > Alias Crash

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Forums Directory