A challenge (was Re: Of course, they'll deny it.)

George Toft plug-discuss@lists.PLUG.phoenix.az.us
Wed, 19 Sep 2001 07:46:50 -0700


To even mention CoreWars indicates one or more of the following:
1.  An addiction to computer nostalgia;
2.  Advanced age;
3.  Too much time on your hands (to search google).

Imagine this mainframe scenario (Burroughs 6700):
All current files are stored in core (RAM).  Disk is used to augment
RAM.  Archived files are stored on tape.  Files that are being used
have the highest priority, and are stored in core and the older stuff
gets pushed to disk.  This is not too unlike modern virtual memory.

A friend of mine, Dan, wanted to write a program that would make a 
copy of itself and put the copy into the run queue, then start over.  
His account gave him 30 seconds of CPU time per job.  He finally
found what he was looking for my snooping in a Captain's office for
the reference manual that contained the command to put the job in the
run queue (I guess it had been removed from the general references
for a reason).  He compiled his program (in Algol) and ran it.  The 
original program made a copy of itself and put it in the run queue
and restarted.  Now there are two programs running.  Each makes a 
copy and puts them in the run queue.  Now there are four, then
eight, then 16, 32, 64, 128, 256, ...

Since all of his processes were current, they held the highest
priority for storage and remained in core.  All other processes
went to disk.  When core was full of his processes, they filled 
up disk, and the older processes and files were dumped.  In the 
space of about a minute, he filled core and disk with his program, 
and trashed several thousand users files.  Everybody lost everything 
they had done since the last archive - three days before.

Needless to say, his account was revoked.  If this happened today,
he would probably go to jail.

This really happened at an Air Force installation in 1977.  So, yes,
I am guilty of #2 above.

I wrote a DOS program to do this under Windows 3.1.  It made 32
copies of itself before Windows wouldn't allow it to create any 
more copies.

*** DO NOT TRY THIS UNLESS YOU WANT TO REBOOT ***
I just tried it on my Linux box:
hawaii:~ # w
  1:29am  up 6 days, 17:48,  1 user,  load average: 172.85, 101.88,
42.79


*** DO NOT TRY THIS UNLESS YOU WANT TO REBOOT ***
Here's my script:
#!/bin/bash

while [ 1 ]; do
        # Make a copy
        cp corewar corewar.$$

        # Run it
        ./corewar.$$ &

# Start over
done

*** DO NOT TRY THIS UNLESS YOU WANT TO REBOOT ***

Here's the challenge: how do you clean up these processes without
using init 0, init 1, init 6, reboot, or shutdown?

Now I'm guilty of #3, above.

George



foodog wrote:
> 
> I've hatched a conspiracy theory this evening.  What if the Redmond
> coders aren't security dolts, but a group of fiendishly clever CoreWars
> masters?
> 
> Code Red was almost universally replaced with Code Red II.  I didn't see
> a single Code Red II hit after about 10am today. Nimda ate 'em and is
> the King Of The Hill in record time.
> 
> Nimda plays on Win95, 98, ME, NT4 and Win2K, and gets bonus points for
> special effects with MAPI, IIS, Outlook, Outlook Express, IE5, and even
> Java.  It even shoots for extra media hype by mentioning China.  Wow.
> That's like building a working railgun with Lego Mindstorm.
> 
> I propose that MS has intentionally dropped hints to recruit players.
> Code Red / Redcode.  Can it be coincidence?
> 
> disclaimer: I'm sleep deprived, over-caffeinated, on anti-snot meds, and
> perhaps deep down may harbor unkind feelings toward Microsoft.
> 
> Folklore-challenged individuals can learn about CoreWars from google.
> 
> Anyway, that is the theory which is mine.
> Steve
> ________________________________________________
> See http://PLUG.phoenix.az.us/navigator-mail.shtml if your mail doesn't post to the list quickly and you use Netscape to write mail.
> 
> PLUG-discuss mailing list  -  PLUG-discuss@lists.PLUG.phoenix.az.us
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss