Subject: the dangers of reusing object numbers

From: [email-masked]
Date: Wed, 15 Sep 1993 09:08:47 -0700

I'm all in favor of reusing object numbers, despite the dangers.
But for your amusement, here's the funniest bug I've ever seen.
This particular problem could only occur with a wizardly verb.

Subject: dog turns into can of coke!
Date: Wed, 23 Jun 93 10:53:57 -0400
From: [email-masked]

I'm laughing so hard I can't breathe!  This one's a classic:

 ------- Forwarded Message
Date: Tue, 22 Jun 93 22:51:03 -0400
From: Albert Lin <[email-masked]>
Subject: bartender bug

I had just created another dog, named Biffina (#4573), when I saw the
following text on my screen:

Bubba the barkeep stamps up to you.  "There you are! We are a bit short of
glasses.  If you don't mind...."  Bubba the barkeep snatches the Biffina out of
your hand and minces away angrily.

Needless to say, this caught me completely by surprise.  Doing a
prospectus on me revealed:

 rT      can of Coca-Cola Classic (#4573)

My dog had been turned into a can of Coke!  Apparently, Khadthulu had
created the Apocolypse Cafe with Bubba the barkeep.  Somehow, the
.glasses property on Bubba got messed up, and my newly created object
appeared in that list.  So, after the timeout, Bubba stamped up to me,
grabbed my dog, and turned it into a can of Coke.  I'm guessing that
this was possible because Bubba has a wiz-owned verb somewhere.

What a weird bug.

 - -Albert

 - -----------

>page khadthulu with hi! can i have my dog (#4573) back?
Your message has been sent.
You sense that Khadthulu is looking for you in Apocolypse Cafe.
It pages, "you're dog?!?!?!"

 ------- End of Forwarded Message

EXPLANATION:

The bartender has a .glasses property.  Every once in a while, it looks around
for glass objects that people have walked away with and brings them back to
the bar.  When someone orders a drink, it renames an unused glass to what they
ordered and serves it.

The glasses are owned by the person who owns the bar (because I wanted them to
come out of that person's quota.)  But the verb that renames the object is
owned by the person who wrote (adapted from Aphid's code) the bartender, me.
So I made the verb that renames the drink object wizardly so it could rename
an object owned by someone else.

Someone made a glass for their bartender and then recycled it.  (They own it,
so they can recycle it.)  But the object number stays on the bartender's list
of glasses.  Albert made a dog and got the recycled object number.  The
bartender program saw it as a glass object that someone had walked away with!
And since the verb is wizardly....

The solution: make sure only the @add-glass verb can add things to the
.glasses property of the bartender, and put a recycle method on generic drink
which removes its object number from the .glasses property. 

Ah, recycled object numbers....

-- Amy