fuzzball icon indicating copy to clipboard operation
fuzzball copied to clipboard

Investigate Mysterious Bug 201633

Open tanabi opened this issue 5 years ago • 0 comments

In create.c, in the do_recycle code, there is a block having to do with recycling programs that had the following mysterious comment:

This is a workaround for bug #201633

Whatever this bug is, it predates SourceForge and we have no idea what the original issue was. The logic goes as follows:

if ( program is running )
    dequeue program

/* This is the mysterious bug 201633 block */
if (program is running)
   notify player and return

In theory, that second 'if' should never happen, because we dequeue'd the program and we have not allowed another action to happen. FB isn't multi-threaded so there's theoretically no way to re-run the program in between those two if statements. So at some point there was a problem with dequeue_prog I guess which meant the program wasn't actually getting killed.

Anyway, the purpose of this ticket is to try and determine if this mysterious if block is still needed or not. We will spin up a dev MUCK and try many test cases in deleting programs. Here are my suggestions for test cases -- please feel free to come up with more. And please document what test cases are preformed in case we ever have a problem here.

  • Try to recycle a program that is running in an infinite loop
  • Try to recycle a program that is waiting for a user's READ input
  • Try to recycle a program that is AUTOSTART and running
  • Try to recycle a program that is running and listening for MCP events
  • Try to recycle a program that is running and in PREEMPT
  • Try to recycle a program that is running and in BACKGROUND

Further, it would be a good idea to read through the dequeue_prog code and see if there are any cases where it would leave a program running. Maybe do that before running a bunch of random test cases.

I suspect the original purpose of this mysterious if is long gone (maybe even WAY long gone) but we need to be as certain as possible before blowing it away.

[Edited to update the location of do_recycle]

tanabi avatar Mar 15 '19 14:03 tanabi