Hi,

I had a closer look at the savegames Rainer sent me, and it looks like the
IRIX one has the savegame directory written to heap address 0x7c9, which
is quite some way away from where it's supposed to be (precisely 1000 +
strlen(cwd) bytes, if I'm not mistaken). Since this is in the midst of
game code, weird problems are bound to occur.

In order to trace this, we'll have to find out where this corruption comes
from- there are two basic possibilies: Either it happens right after
initialization, or during a kernel call.

The following patch should trigger an error automatically once this
happens, the step number should then allow us to identify the culprit
(within the granularity of SCI interpreter operations):


--- freesci/src/engine/vm.c.old Sun Mar 17 01:51:50 2002
+++ freesci/src/engine/vm.c     Sun Mar 17 01:54:00 2002
@@ -1200,6 +1200,12 @@
 
     } /* switch(opcode >> 1) */
 
+    if (!strncmp(s->heap + 0x7c9, "/usr/people", 10)) {
+           fprintf(stderr,"Error: 0x7c9 is corrupt!\n\n");
+           script_error_flag = 1;
+    }
+
+
     if (xs != s->execution_stack + s->execution_stack_pos) {
       sciprintf("Error: xs is stale; last command was %02x\n", opnumber);
     }



Rainer, could you apply and test with it, please?


TIA!

llap,
 Christoph


Reply via email to