From c25bb7bb969ca67ac2a7a73cc18aaf469fcceedd Mon Sep 17 00:00:00 2001
From: David Norell <davno443@student.liu.se>
Date: Sat, 30 May 2020 13:52:57 +0200
Subject: [PATCH] =?UTF-8?q?j=C3=A4rnspikar?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/examples/file_syscall_tests.c |  100 +--
 src/filesys/directory.c           |    4 +-
 src/filesys/filesys.c             |    6 +-
 src/filesys/inode.c               |    5 +-
 src/threads/thread.c              |    2 +-
 src/userprog/check.err            |   13 +-
 src/userprog/check.tmp            | 1103 -----------------------------
 src/userprog/messages             |  Bin 5000 -> 16645 bytes
 src/userprog/process.c            |   12 +-
 src/userprog/syscall.c            |    2 -
 10 files changed, 72 insertions(+), 1175 deletions(-)

diff --git a/src/examples/file_syscall_tests.c b/src/examples/file_syscall_tests.c
index 53358eb..190a49f 100644
--- a/src/examples/file_syscall_tests.c
+++ b/src/examples/file_syscall_tests.c
@@ -9,9 +9,9 @@
 
    Test program for basic system calls. Inspired by previous versions
    by various IDA-employees / lab-assistanst.
-   
+
    Emergency exit QEMU bu pressing C-a x (release Ctrl before pressing x)
- 
+
    DONE: Warn when '\r' instead of '\n'
    DONE: Check result for JUNK
    DONE: Compare/verify content of buffer after reads.
@@ -42,13 +42,13 @@ int main(int argc, char* argv[])
 {
   int id = JUNK;
   int i, j;
-  
+
   msg ( "* ------------------ write screen test ------------------ *" );
   {
     char* msg = "Now displaying the arguments to main\n";
     int length = strlen (msg);
     int result = JUNK;
-    
+
     result = write (STDOUT_FILENO, msg, length);
 
     for ( i = 0; i < argc; ++i )
@@ -56,18 +56,18 @@ int main(int argc, char* argv[])
       write (STDOUT_FILENO, argv[i], strlen (argv[i]) );
       write (STDOUT_FILENO, "\n", 1);
     }
-    
+
     verify (length == result);
   }
   end ( "* -------------------- press enter ---------------------- *" );
-  
+
   printf ("To emergency exit QEMU at any time:\n");
   printf ("Hold 'Control' and press 'a' and then \n");
   printf ("release 'Control' and press 'x'\n");
-    
+
   end ( "* -------------------- press enter ---------------------- *" );
 
-  
+
   msg ( "* ----------------- read keyboard test ------------------ *" );
   {
     char* input = "qwerty1234";
@@ -77,48 +77,48 @@ int main(int argc, char* argv[])
     char yes;
 
     init_buffer(buffer, 10);
-    
+
     printf ("Will now try to read 10 characters.\n");
     printf ("Please write \"%s\": ", input);
     result = read ( STDIN_FILENO, buffer, 10 );
     length = strlen( buffer );
     printf ("\nThe following characters was read: '%s'\n", buffer);
-    
+
     verify ( length == result && memcmp(buffer, input, 10) == 0 );
-    
+
     printf ("\nDid you see each character as you typed it? (y/n) ");
     result = read ( STDIN_FILENO, &yes, 1 );
     printf ("\n");
-    
+
     verify ( result == 1 && yes == 'y');
   }
   end ( "* -------------------- press enter ---------------------- *" );
 
-  
+
   msg ( "* ------------------ create file test ------------------- *" );
   {
     int success = JUNK;
-    
+
     printf ("Will try to create 'test.txt'\n");
-    success = create("test.txt", SIZE);    
+    success = create("test.txt", SIZE);
     verify ( success != JUNK && success );
   }
   end ( "* -------------------- press enter ---------------------- *" );
 
-  
+
   msg ( "* ------------------ open file test --------------------- *" );
   {
     printf ("Will try to open 'non_existent_file'\n");
-    id = open("non_existent_file");    
+    id = open("non_existent_file");
     verify ( id == -1 );
-    
+
     printf ("Will try to open 'test.txt'\n");
     id = open("test.txt");
     verify ( id > 1 );
   }
   end ( "* -------------------- press enter ---------------------- *" );
 
-  
+
   msg ( "* ------------------ write file test -------------------- *" );
   {
     char buffer[8];
@@ -126,7 +126,7 @@ int main(int argc, char* argv[])
     bool success = true;
 
     init_buffer(buffer, 8);
-    
+
     printf ("Will try to write a sequence to '%d'\n", id);
     for ( i = 0; i < 16; ++i)
     {
@@ -147,21 +147,21 @@ int main(int argc, char* argv[])
   }
   end ( "* -------------------- press enter ---------------------- *" );
 
-  
+
   msg ( "* ------------------ read file test --------------------- *" );
   {
     char buffer[8];
     char verify_buffer[8];
     int result = JUNK;
     bool success = true;
-    
+
     init_buffer(buffer, 8);
     init_buffer(verify_buffer, 8);
-    
+
     printf ("Will try to reopen 'test.txt'\n");
     close(id);
     id = open("test.txt");
-    
+
     printf ("Will try to read a sequence from '%d'\n", id);
     for ( i = 0; i < 16; ++i)
     {
@@ -171,7 +171,7 @@ int main(int argc, char* argv[])
         result = read(id, buffer, 4);
         success = success && (result == 4);
         result = write(STDOUT_FILENO, buffer, 4);
-        
+
         success = success && (memcmp(buffer, verify_buffer, 4) == 0);
       }
       result = write(STDOUT_FILENO, "\n", 1);
@@ -184,31 +184,31 @@ int main(int argc, char* argv[])
   }
   end ( "* -------------------- press enter ---------------------- *" );
 
-  
+
   msg ( "* ------------------ close file test -------------------- *" );
   {
     char buffer[128];
     int result = JUNK;
-    
+
     init_buffer(buffer, 128);
-    
+
     printf ("Will try to close 'STDIN_FILENO' and then read from it.\n");
     printf ("Write some input please: ");
     close(STDIN_FILENO);
     result = get_line(buffer, 128);
     verify ( result < 128 && result == (int)strlen(buffer) );
-    
+
     printf ("Will try to close 'STDOUT_FILENO' and then write to it.\n");
     close(STDOUT_FILENO);
     result = write(STDOUT_FILENO, buffer, strlen(buffer));
     printf ("\n");
     verify ( result == (int)strlen(buffer) );
-    
+
     printf ("Will try to close id '%d' and then read from it\n", id);
     close(id);
     result = read(id, buffer, 128);
     verify ( result == -1 );
-    
+
     printf ("Will try to close id '%d' and then read from it\n", id);
     close(JUNK);
     result = read(JUNK, buffer, 128);
@@ -216,42 +216,42 @@ int main(int argc, char* argv[])
   }
   end ( "* -------------------- press enter ---------------------- *" );
 
-  
+
   msg ( "* ------------------ remove file test ------------------- *" );
   {
     int success = JUNK;
-    
+
     printf ("Will try to remove 'test.txt' and then open it\n");
     success = remove("test.txt");
-    id = open("test.txt");    
+    id = open("test.txt");
     verify ( success && id == -1 );
-    
+
     printf ("Will try to remove 'non_existent_file'\n");
     success = remove("non_existent_file");
     verify ( ! success );
   }
   end ( "* -------------------- press enter ---------------------- *" );
-  
+
   printf ("To emergency exit QEMU at any time:\n");
   printf ("Hold 'Control' and press 'a' and then \n");
   printf ("release 'Control' and press 'x'\n");
-    
+
   end ( "* -------------------- press enter ---------------------- *" );
 
-  
+
   msg ( "* ---------------- seek/tell file test ------------------ *" );
   {
     char buffer[8];
     char verify_buffer[8];
     int result = JUNK;
     int success = CRAP;
-    
+
     init_buffer(buffer, 8);
     init_buffer(verify_buffer, 8);
-    
+
     printf ("Will try to create and open 'test.txt'\n");
     success = create("test.txt", SIZE);
-    id = open("test.txt");    
+    id = open("test.txt");
     verify ( success != CRAP && success && id > 1 );
 
     printf ("Will try to write a sequence to '%d'\n", id);
@@ -270,18 +270,18 @@ int main(int argc, char* argv[])
       result = write(STDOUT_FILENO, "\n", 1);
     }
     verify ( success );
-    
+
     printf ("Will try to read the sequence from '%d'\n", id);
     seek (id, 0);
     for ( i = 0; i < 16; ++i)
     {
       for ( j = 0; j < 16; ++j)
       {
-        snprintf (verify_buffer, 8, "%4d", i*16+j);        
+        snprintf (verify_buffer, 8, "%4d", i*16+j);
         result = read(id, buffer, 4);
         success = success && (result == 4);
         result = write(STDOUT_FILENO, buffer, 4);
-        
+
         success = success && (memcmp(buffer, verify_buffer, 4) == 0);
       }
       result = write(STDOUT_FILENO, "\n", 1);
@@ -305,7 +305,7 @@ const char* crlf_warning = ("\033[1;31;40mWARNING\033[1;0m: "
 static void skip_line( void )
 {
   char c = '\0';
-  
+
   while ( c != '\n' && c != '\r' )
     read ( STDIN_FILENO, &c, 1);
 
@@ -317,14 +317,14 @@ static void skip_line( void )
 static int get_line( char* buf, int size )
 {
   int i;
-  
+
   for ( i = 0; i < (size - 1); ++i)
   {
     buf[i] = '\0';
-    
+
     if (read ( STDIN_FILENO, buf+i, 1) != 1)
       return -1;
-    
+
     if ( buf[i] == '\r' )
       write ( STDOUT_FILENO, crlf_warning, strlen ( crlf_warning ) );
 
@@ -343,10 +343,10 @@ static void verify(int test)
   const char* result[3] = {"\033[1;31;40m WRONG RESULT \033[1;0m \n",
                            "\033[1;32;40m RESULT OK \033[1;0m \n",
                            "\033[1;31;40m BAD BOOLEAN \033[1;0m \n"};
-  
+
   if (test < 0 || test > 1)
     test = 2;
-  
+
   write ( STDOUT_FILENO, result[ test ], strlen (result[ test ]) );
 }
 
diff --git a/src/filesys/directory.c b/src/filesys/directory.c
index dfaff73..4401808 100644
--- a/src/filesys/directory.c
+++ b/src/filesys/directory.c
@@ -103,7 +103,6 @@ lookup (const struct dir *dir, const char *name,
 {
   struct dir_entry e;
   size_t ofs;
-
   ASSERT (dir != NULL);
   ASSERT (name != NULL);
 
@@ -134,12 +133,13 @@ dir_lookup (const struct dir *dir, const char *name,
   ASSERT (name != NULL);
 
   lock_acquire(&dir_lock);
+
   if (lookup (dir, name, &e, NULL))
     *inode = inode_open (e.inode_sector);
   else
     *inode = NULL;
-  lock_release(&dir_lock);
 
+  lock_release(&dir_lock);
   return *inode != NULL;
 }
 
diff --git a/src/filesys/filesys.c b/src/filesys/filesys.c
index c215102..3a1b116 100644
--- a/src/filesys/filesys.c
+++ b/src/filesys/filesys.c
@@ -73,10 +73,12 @@ filesys_open (const char *name)
   struct dir *dir = dir_open_root ();
   struct inode *inode = NULL;
   struct file *file = NULL;
+
   file_close(file);
-  if (dir != NULL && dir_lookup (dir, name, &inode))
-    file = file_open (inode);
+  if (dir != NULL)
+    dir_lookup (dir, name, &inode);
 
+  file = file_open (inode);
   dir_close (dir);
 
   return file;
diff --git a/src/filesys/inode.c b/src/filesys/inode.c
index a82642b..88de076 100644
--- a/src/filesys/inode.c
+++ b/src/filesys/inode.c
@@ -192,9 +192,12 @@ inode_close (struct inode *inode)
 {
   lock_acquire(&list_lock);
   /* Ignore null pointer. */
+
   if (inode == NULL)
+  {
+    lock_release(&list_lock);
     return;
-
+  }
   lock_acquire(&inode->inode_lock);
 
   /* Release resources if this was the last opener. */
diff --git a/src/threads/thread.c b/src/threads/thread.c
index dbf0cf1..6617e27 100644
--- a/src/threads/thread.c
+++ b/src/threads/thread.c
@@ -549,7 +549,7 @@ schedule (void)
   ASSERT (is_thread (next));
 
   //wake up any threads that has slept long enough
-  pmap_for_each(&process_table, try_wake, 0);
+  //pmap_for_each(&process_table, try_wake, 0);
 
   if (cur != next)
     prev = switch_threads (cur, next);
diff --git a/src/userprog/check.err b/src/userprog/check.err
index aeb5c71..054bfed 100644
--- a/src/userprog/check.err
+++ b/src/userprog/check.err
@@ -1,8 +1,9 @@
-20+1 records in
-21+0 records out
-86016 bytes (86 kB, 84 KiB) copied, 0,000136171 s, 632 MB/s
+make[1]: *** [../../tests/Make.tests:105: tests/userprog/wait-killed.output] Interrupt
+make[1]: *** [../../tests/Make.tests:105: tests/filesys/base/lg-create.output] Interrupt
+make[1]: *** [../../tests/Make.tests:105: tests/userprog/multi-recurse.output] Interrupt
+make[1]: *** [../../tests/Make.tests:105: tests/filesys/base/lg-full.output] Interrupt
+make[1]: *** [../../tests/Make.tests:105: tests/klaar/pfs.output] Interrupt
 make[1]: *** [../../tests/Make.tests:105: tests/userprog/wait-twice.output] Interrupt
-make[1]: *** [../../tests/Make.tests:105: tests/userprog/open-missing.output] Interrupt
-make[1]: *** [../../tests/Make.tests:105: tests/userprog/open-empty.output] Interrupt
-make[1]: *** [../../tests/Make.tests:105: tests/userprog/exec-missing.output] Interrupt
+make[1]: *** [../../tests/Make.tests:105: tests/userprog/wait-bad-pid.output] Interrupt
+make[1]: *** [../../tests/Make.tests:105: tests/userprog/multi-child-fd.output] Interrupt
 make: *** [../Makefile.kernel:10: check] Interrupt
diff --git a/src/userprog/check.tmp b/src/userprog/check.tmp
index 8f3cf2a..b708676 100644
--- a/src/userprog/check.tmp
+++ b/src/userprog/check.tmp
@@ -1,13 +1,5 @@
 cd build && make check
 make[1]: Entering directory '/home/davidnorell/tdiu16-eget/src/userprog/build'
-gcc -m32 -c ../../userprog/syscall.c -o userprog/syscall.o -std=gnu99 -ggdb -msoft-float -fno-omit-frame-pointer -ffreestanding -fno-inline -fno-pic -O -fno-stack-protector -nostdinc -I../.. -I../../lib -I../../lib/kernel -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wsystem-headers -DPINTOS -DUSERPROG -DFILESYS -MMD -MF userprog/syscall.d
-ld -melf_i386 -T threads/kernel.lds.s -o kernel.o threads/init.o threads/thread.o threads/switch.o threads/interrupt.o threads/intr-stubs.o threads/synch.o threads/palloc.o threads/malloc.o threads/start.o threads/boundedbuffer.o threads/synchlist.o devices/timer.o devices/kbd.o devices/vga.o devices/serial.o devices/disk.o devices/input.o devices/intq.o lib/debug.o lib/random.o lib/stdio.o lib/stdlib.o lib/string.o lib/arithmetic.o lib/kernel/debug.o lib/kernel/list.o lib/kernel/bitmap.o lib/kernel/hash.o lib/kernel/console.o lib/kernel/slist.o userprog/process.o userprog/load.o userprog/pagedir.o userprog/exception.o userprog/syscall.o userprog/gdt.o userprog/tss.o userprog/flist.o userprog/plist.o filesys/filesys.o filesys/free-map.o filesys/file.o filesys/directory.o filesys/inode.o filesys/fsutil.o
-objcopy -O binary -R .note -R .comment -S kernel.o kernel.bin.tmp
-dd if=kernel.bin.tmp of=kernel.bin bs=4096 conv=sync
-rm kernel.bin.tmp
-gcc -m32 -c ../../threads/loader.S -o threads/loader.o -Wa,--gstabs -nostdinc -I../.. -I../../lib -I../../lib/kernel -DPINTOS -DUSERPROG -DFILESYS -DKERNEL_LOAD_PAGES=`perl -e 'print +(-s "kernel.bin") / 4096;'`
-ld -melf_i386 -N -e start -Ttext 0x7c00 --oformat binary -o loader.bin threads/loader.o
-cat loader.bin kernel.bin > os.dsk
 pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/klaar/read-bad-buf -a read-bad-buf -p ../../tests/klaar/sample.txt -a sample.txt -- -q  -F=10000  -f run read-bad-buf < /dev/null 2> tests/klaar/read-bad-buf.errors > tests/klaar/read-bad-buf.allput
 pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/klaar/low-mem -a low-mem -p tests/klaar/child-simple -a child-simple -- -q  -F=10000 -tcl=3 -f run low-mem < /dev/null 2> tests/klaar/low-mem.errors > tests/klaar/low-mem.allput
 pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/klaar/exec-corrupt -a exec-corrupt -p ../../tests/klaar/corrupt-elf -a corrupt-elf -- -q  -F=10000  -f run exec-corrupt < /dev/null 2> tests/klaar/exec-corrupt.errors > tests/klaar/exec-corrupt.allput
@@ -72,1098 +64,3 @@ pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/userprog/multi-recurse -a multi-
 pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/userprog/multi-child-fd -a multi-child-fd -p ../../tests/userprog/sample.txt -a sample.txt -p tests/userprog/child-close -a child-close -- -q  -F=10000  -f run multi-child-fd < /dev/null 2> tests/userprog/multi-child-fd.errors > tests/userprog/multi-child-fd.allput
 pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/filesys/base/lg-create -a lg-create -- -q  -F=10000  -f run lg-create < /dev/null 2> tests/filesys/base/lg-create.errors > tests/filesys/base/lg-create.allput
 pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/filesys/base/lg-full -a lg-full -- -q  -F=10000  -f run lg-full < /dev/null 2> tests/filesys/base/lg-full.errors > tests/filesys/base/lg-full.allput
-pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/filesys/base/lg-random -a lg-random -- -q  -F=10000  -f run lg-random < /dev/null 2> tests/filesys/base/lg-random.errors > tests/filesys/base/lg-random.allput
-pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/filesys/base/lg-seq-block -a lg-seq-block -- -q  -F=10000  -f run lg-seq-block < /dev/null 2> tests/filesys/base/lg-seq-block.errors > tests/filesys/base/lg-seq-block.allput
-pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/filesys/base/lg-seq-random -a lg-seq-random -- -q  -F=10000  -f run lg-seq-random < /dev/null 2> tests/filesys/base/lg-seq-random.errors > tests/filesys/base/lg-seq-random.allput
-pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/filesys/base/sm-create -a sm-create -- -q  -F=10000  -f run sm-create < /dev/null 2> tests/filesys/base/sm-create.errors > tests/filesys/base/sm-create.allput
-pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/filesys/base/sm-full -a sm-full -- -q  -F=10000  -f run sm-full < /dev/null 2> tests/filesys/base/sm-full.errors > tests/filesys/base/sm-full.allput
-pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/filesys/base/sm-random -a sm-random -- -q  -F=10000  -f run sm-random < /dev/null 2> tests/filesys/base/sm-random.errors > tests/filesys/base/sm-random.allput
-pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/filesys/base/sm-seq-block -a sm-seq-block -- -q  -F=10000  -f run sm-seq-block < /dev/null 2> tests/filesys/base/sm-seq-block.errors > tests/filesys/base/sm-seq-block.allput
-pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/filesys/base/sm-seq-random -a sm-seq-random -- -q  -F=10000  -f run sm-seq-random < /dev/null 2> tests/filesys/base/sm-seq-random.errors > tests/filesys/base/sm-seq-random.allput
-pintos -v -k -T 300 --qemu  --fs-disk=2 -p tests/filesys/base/syn-read -a syn-read -p tests/filesys/base/child-syn-read -a child-syn-read -- -q  -F=10000  -f run syn-read < /dev/null 2> tests/filesys/base/syn-read.errors > tests/filesys/base/syn-read.allput
-pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/filesys/base/syn-remove -a syn-remove -- -q  -F=10000  -f run syn-remove < /dev/null 2> tests/filesys/base/syn-remove.errors > tests/filesys/base/syn-remove.allput
-pintos -v -k -T 60 --qemu  --fs-disk=2 -p tests/filesys/base/syn-write -a syn-write -p tests/filesys/base/child-syn-wrt -a child-syn-wrt -- -q  -F=10000  -f run syn-write < /dev/null 2> tests/filesys/base/syn-write.errors > tests/filesys/base/syn-write.allput
-perl -I../.. ../../tests/klaar/read-bad-buf.ck tests/klaar/read-bad-buf tests/klaar/read-bad-buf.result
-FAIL tests/klaar/read-bad-buf
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/klaar/low-mem.ck tests/klaar/low-mem tests/klaar/low-mem.result
-FAIL tests/klaar/low-mem
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (low-mem) begin
-  (low-mem) exec("child-simple"): -1
-  (low-mem) end
-  low-mem: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (low-mem) begin
-  (low-mem) exec("child-simple"): -1
-  (low-mem) end
-- low-mem: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/klaar/exec-corrupt.ck tests/klaar/exec-corrupt tests/klaar/exec-corrupt.result
-FAIL tests/klaar/exec-corrupt
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (exec-corrupt) begin
-  load: corrupt-elf: error loading executable
-  corrupt-elf: exit(-1)
-  (exec-corrupt) exec("corrupt-elf"): -1
-  (exec-corrupt) end
-  exec-corrupt: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (exec-corrupt) begin
-+ Checkpoint 6
-  load: corrupt-elf: error loading executable
-- corrupt-elf: exit(-1)
-  (exec-corrupt) exec("corrupt-elf"): -1
-  (exec-corrupt) end
-- exec-corrupt: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-Acceptable output:
-  (exec-corrupt) begin
-  load: corrupt-elf: error loading executable
-  (exec-corrupt) exec("corrupt-elf"): -1
-  (exec-corrupt) end
-  corrupt-elf: exit(-1)
-  exec-corrupt: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (exec-corrupt) begin
-+ Checkpoint 6
-  load: corrupt-elf: error loading executable
-  (exec-corrupt) exec("corrupt-elf"): -1
-  (exec-corrupt) end
-- corrupt-elf: exit(-1)
-- exec-corrupt: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-Acceptable output:
-  (exec-corrupt) begin
-  (exec-corrupt) exec("corrupt-elf"): -1
-  (exec-corrupt) end
-  exec-corrupt: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (exec-corrupt) begin
-+ Checkpoint 6
-+ load: corrupt-elf: error loading executable
-  (exec-corrupt) exec("corrupt-elf"): -1
-  (exec-corrupt) end
-- exec-corrupt: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-Acceptable output:
-  (exec-corrupt) begin
-  load: corrupt-elf: error loading executable
-  (exec-corrupt) exec("corrupt-elf"): -1
-  (exec-corrupt) end
-  exec-corrupt: exit(0)
-  corrupt-elf: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (exec-corrupt) begin
-+ Checkpoint 6
-  load: corrupt-elf: error loading executable
-  (exec-corrupt) exec("corrupt-elf"): -1
-  (exec-corrupt) end
-- exec-corrupt: exit(0)
-- corrupt-elf: exit(-1)
-+ 
-+ Process exit(3), status: 0
-+ 
-Acceptable output:
-  (exec-corrupt) begin
-  load: corrupt-elf: error loading executable
-  (exec-corrupt) exec("corrupt-elf"): -1
-  (exec-corrupt) end
-  exec-corrupt: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (exec-corrupt) begin
-+ Checkpoint 6
-  load: corrupt-elf: error loading executable
-  (exec-corrupt) exec("corrupt-elf"): -1
-  (exec-corrupt) end
-- exec-corrupt: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-Acceptable output:
-  (exec-corrupt) begin
-  load: corrupt-elf: error loading executable
-  (exec-corrupt) exec("corrupt-elf"): -1
-  corrupt-elf: exit(-1)
-  (exec-corrupt) end
-  exec-corrupt: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (exec-corrupt) begin
-+ Checkpoint 6
-  load: corrupt-elf: error loading executable
-  (exec-corrupt) exec("corrupt-elf"): -1
-- corrupt-elf: exit(-1)
-  (exec-corrupt) end
-- exec-corrupt: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/klaar/pfs.ck tests/klaar/pfs tests/klaar/pfs.result
-FAIL tests/klaar/pfs
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/filst/sc-bad-write.ck tests/filst/sc-bad-write tests/filst/sc-bad-write.result
-FAIL tests/filst/sc-bad-write
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/filst/sc-bad-close.ck tests/filst/sc-bad-close tests/filst/sc-bad-close.result
-FAIL tests/filst/sc-bad-close
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/filst/sc-bad-nr-1.ck tests/filst/sc-bad-nr-1 tests/filst/sc-bad-nr-1.result
-FAIL tests/filst/sc-bad-nr-1
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (sc-bad-nr-1) begin
-  sc-bad-nr-1: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (sc-bad-nr-1) begin
-- sc-bad-nr-1: exit(-1)
-+ Executed an unknown system call!
-+ Stack top + 0: 22
-+ Stack top + 1: 0
-Acceptable output:
-  (sc-bad-nr-1) begin
-  Executed an unknown system call!
-  Stack top + 0: 21
-  Stack top + 1: 0
-  sc-bad-nr-1: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (sc-bad-nr-1) begin
-  Executed an unknown system call!
-- Stack top + 0: 21
-+ Stack top + 0: 22
-  Stack top + 1: 0
-- sc-bad-nr-1: exit(-1)
-perl -I../.. ../../tests/filst/sc-bad-nr-2.ck tests/filst/sc-bad-nr-2 tests/filst/sc-bad-nr-2.result
-FAIL tests/filst/sc-bad-nr-2
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (sc-bad-nr-2) begin
-  sc-bad-nr-2: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (sc-bad-nr-2) begin
-- sc-bad-nr-2: exit(-1)
-+ Executed an unknown system call!
-+ Stack top + 0: 1048576
-+ Stack top + 1: 0
-Acceptable output:
-  (sc-bad-nr-2) begin
-  Executed an unknown system call!
-  Stack top + 0: 1048576
-  Stack top + 1: 0
-  sc-bad-nr-2: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (sc-bad-nr-2) begin
-  Executed an unknown system call!
-  Stack top + 0: 1048576
-  Stack top + 1: 0
-- sc-bad-nr-2: exit(-1)
-perl -I../.. ../../tests/filst/sc-bad-nr-3.ck tests/filst/sc-bad-nr-3 tests/filst/sc-bad-nr-3.result
-FAIL tests/filst/sc-bad-nr-3
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (sc-bad-nr-3) begin
-  Executed an unknown system call!
-  Stack top + 0: -1
-  Stack top + 1: 0
-  sc-bad-nr-3: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (sc-bad-nr-3) begin
-  Executed an unknown system call!
-  Stack top + 0: -1
-  Stack top + 1: 0
-- sc-bad-nr-3: exit(-1)
-Acceptable output:
-  (sc-bad-nr-3) begin
-  sc-bad-nr-3: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (sc-bad-nr-3) begin
-- sc-bad-nr-3: exit(-1)
-+ Executed an unknown system call!
-+ Stack top + 0: -1
-+ Stack top + 1: 0
-perl -I../.. ../../tests/userprog/args-none.ck tests/userprog/args-none tests/userprog/args-none.result
-FAIL tests/userprog/args-none
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (args) begin
-  (args) argc = 1
-  (args) argv[0] = 'args-none'
-  (args) argv[1] = null
-  (args) end
-  args-none: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (args) begin
-  (args) argc = 1
-  (args) argv[0] = 'args-none'
-  (args) argv[1] = null
-  (args) end
-- args-none: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/args-single.ck tests/userprog/args-single tests/userprog/args-single.result
-FAIL tests/userprog/args-single
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (args) begin
-  (args) argc = 2
-  (args) argv[0] = 'args-single'
-  (args) argv[1] = 'onearg'
-  (args) argv[2] = null
-  (args) end
-  args-single: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (args) begin
-  (args) argc = 2
-  (args) argv[0] = 'args-single'
-  (args) argv[1] = 'onearg'
-  (args) argv[2] = null
-  (args) end
-- args-single: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/args-multiple.ck tests/userprog/args-multiple tests/userprog/args-multiple.result
-FAIL tests/userprog/args-multiple
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (args) begin
-  (args) argc = 5
-  (args) argv[0] = 'args-multiple'
-  (args) argv[1] = 'some'
-  (args) argv[2] = 'arguments'
-  (args) argv[3] = 'for'
-  (args) argv[4] = 'you!'
-  (args) argv[5] = null
-  (args) end
-  args-multiple: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (args) begin
-  (args) argc = 5
-  (args) argv[0] = 'args-multiple'
-  (args) argv[1] = 'some'
-  (args) argv[2] = 'arguments'
-  (args) argv[3] = 'for'
-  (args) argv[4] = 'you!'
-  (args) argv[5] = null
-  (args) end
-- args-multiple: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/args-many.ck tests/userprog/args-many tests/userprog/args-many.result
-FAIL tests/userprog/args-many
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (args) begin
-  (args) argc = 23
-  (args) argv[0] = 'args-many'
-  (args) argv[1] = 'a'
-  (args) argv[2] = 'b'
-  (args) argv[3] = 'c'
-  (args) argv[4] = 'd'
-  (args) argv[5] = 'e'
-  (args) argv[6] = 'f'
-  (args) argv[7] = 'g'
-  (args) argv[8] = 'h'
-  (args) argv[9] = 'i'
-  (args) argv[10] = 'j'
-  (args) argv[11] = 'k'
-  (args) argv[12] = 'l'
-  (args) argv[13] = 'm'
-  (args) argv[14] = 'n'
-  (args) argv[15] = 'o'
-  (args) argv[16] = 'p'
-  (args) argv[17] = 'q'
-  (args) argv[18] = 'r'
-  (args) argv[19] = 's'
-  (args) argv[20] = 't'
-  (args) argv[21] = 'u'
-  (args) argv[22] = 'v'
-  (args) argv[23] = null
-  (args) end
-  args-many: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (args) begin
-  (args) argc = 23
-  (args) argv[0] = 'args-many'
-  (args) argv[1] = 'a'
-  (args) argv[2] = 'b'
-  (args) argv[3] = 'c'
-  (args) argv[4] = 'd'
-  (args) argv[5] = 'e'
-  (args) argv[6] = 'f'
-  (args) argv[7] = 'g'
-  (args) argv[8] = 'h'
-  (args) argv[9] = 'i'
-  (args) argv[10] = 'j'
-  (args) argv[11] = 'k'
-  (args) argv[12] = 'l'
-  (args) argv[13] = 'm'
-  (args) argv[14] = 'n'
-  (args) argv[15] = 'o'
-  (args) argv[16] = 'p'
-  (args) argv[17] = 'q'
-  (args) argv[18] = 'r'
-  (args) argv[19] = 's'
-  (args) argv[20] = 't'
-  (args) argv[21] = 'u'
-  (args) argv[22] = 'v'
-  (args) argv[23] = null
-  (args) end
-- args-many: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/args-dbl-space.ck tests/userprog/args-dbl-space tests/userprog/args-dbl-space.result
-FAIL tests/userprog/args-dbl-space
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (args) begin
-  (args) argc = 3
-  (args) argv[0] = 'args-dbl-space'
-  (args) argv[1] = 'two'
-  (args) argv[2] = 'spaces!'
-  (args) argv[3] = null
-  (args) end
-  args-dbl-space: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (args) begin
-  (args) argc = 3
-  (args) argv[0] = 'args-dbl-space'
-  (args) argv[1] = 'two'
-  (args) argv[2] = 'spaces!'
-  (args) argv[3] = null
-  (args) end
-- args-dbl-space: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/sc-bad-sp.ck tests/userprog/sc-bad-sp tests/userprog/sc-bad-sp.result
-FAIL tests/userprog/sc-bad-sp
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/userprog/sc-bad-arg.ck tests/userprog/sc-bad-arg tests/userprog/sc-bad-arg.result
-FAIL tests/userprog/sc-bad-arg
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (sc-bad-arg) begin
-  sc-bad-arg: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (sc-bad-arg) begin
-- sc-bad-arg: exit(-1)
-+ 
-+ Process exit(3), status: -268370093
-+ 
-perl -I../.. ../../tests/userprog/sc-boundary.ck tests/userprog/sc-boundary tests/userprog/sc-boundary.result
-FAIL tests/userprog/sc-boundary
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (sc-boundary) begin
-  sc-boundary: exit(42)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (sc-boundary) begin
-- sc-boundary: exit(42)
-+ 
-+ Process exit(3), status: 42
-+ 
-perl -I../.. ../../tests/userprog/sc-boundary-2.ck tests/userprog/sc-boundary-2 tests/userprog/sc-boundary-2.result
-FAIL tests/userprog/sc-boundary-2
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (sc-boundary-2) begin
-  sc-boundary-2: exit(67)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (sc-boundary-2) begin
-- sc-boundary-2: exit(67)
-+ 
-+ Process exit(3), status: 67
-+ 
-perl -I../.. ../../tests/userprog/halt.ck tests/userprog/halt tests/userprog/halt.result
-pass tests/userprog/halt
-perl -I../.. ../../tests/userprog/exit.ck tests/userprog/exit tests/userprog/exit.result
-FAIL tests/userprog/exit
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (exit) begin
-  exit: exit(57)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (exit) begin
-- exit: exit(57)
-+ 
-+ Process exit(3), status: 57
-+ 
-perl -I../.. ../../tests/userprog/create-normal.ck tests/userprog/create-normal tests/userprog/create-normal.result
-FAIL tests/userprog/create-normal
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (create-normal) begin
-  (create-normal) create quux.dat
-  (create-normal) end
-  create-normal: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (create-normal) begin
-  (create-normal) create quux.dat
-  (create-normal) end
-- create-normal: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/create-empty.ck tests/userprog/create-empty tests/userprog/create-empty.result
-FAIL tests/userprog/create-empty
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (create-empty) begin
-  create-empty: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (create-empty) begin
-- create-empty: exit(-1)
-+ (create-empty) create(""): 0
-+ (create-empty) end
-+ 
-+ Process exit(3), status: 0
-+ 
-Acceptable output:
-  (create-empty) begin
-  (create-empty) create(""): 0
-  (create-empty) end
-  create-empty: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (create-empty) begin
-  (create-empty) create(""): 0
-  (create-empty) end
-- create-empty: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/create-null.ck tests/userprog/create-null tests/userprog/create-null.result
-perl -I../.. ../../tests/userprog/create-bad-ptr.ck tests/userprog/create-bad-ptr tests/userprog/create-bad-ptr.result
-FAIL tests/userprog/create-null
-Kernel panic in run: PANIC at ../../filesys/directory.c:153 in dir_add(): assertion `name != NULL' failed.
-perl -I../.. ../../tests/userprog/create-long.ck tests/userprog/create-long tests/userprog/create-long.result
-FAIL tests/userprog/create-long
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (create-long) begin
-  (create-long) create("x..."): 0
-  (create-long) end
-  create-long: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (create-long) begin
-  (create-long) create("x..."): 0
-  (create-long) end
-- create-long: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-FAIL tests/userprog/create-bad-ptr
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/userprog/create-exists.ck tests/userprog/create-exists tests/userprog/create-exists.result
-perl -I../.. ../../tests/userprog/create-bound.ck tests/userprog/create-bound tests/userprog/create-bound.result
-FAIL tests/userprog/create-bound
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (create-bound) begin
-  (create-bound) create("quux.dat"): 1
-  (create-bound) end
-  create-bound: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (create-bound) begin
-  (create-bound) create("quux.dat"): 1
-  (create-bound) end
-- create-bound: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-FAIL tests/userprog/create-exists
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (create-exists) begin
-  (create-exists) create quux.dat
-  (create-exists) create warble.dat
-  (create-exists) try to re-create quux.dat
-  (create-exists) create baffle.dat
-  (create-exists) try to re-create quux.dat
-  (create-exists) end
-  create-exists: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (create-exists) begin
-  (create-exists) create quux.dat
-  (create-exists) create warble.dat
-  (create-exists) try to re-create quux.dat
-  (create-exists) create baffle.dat
-  (create-exists) try to re-create quux.dat
-  (create-exists) end
-- create-exists: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/open-normal.ck tests/userprog/open-normal tests/userprog/open-normal.result
-perl -I../.. ../../tests/userprog/open-boundary.ck tests/userprog/open-boundary tests/userprog/open-boundary.result
-FAIL tests/userprog/open-normal
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-FAIL tests/userprog/open-boundary
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (open-boundary) begin
-  (open-boundary) open "sample.txt"
-  (open-boundary) end
-  open-boundary: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (open-boundary) begin
-  (open-boundary) open "sample.txt"
-  (open-boundary) end
-- open-boundary: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-+ owned by entered
-perl -I../.. ../../tests/userprog/open-null.ck tests/userprog/open-null tests/userprog/open-null.result
-perl -I../.. ../../tests/userprog/open-bad-ptr.ck tests/userprog/open-bad-ptr tests/userprog/open-bad-ptr.result
-FAIL tests/userprog/open-null
-Kernel panic in run: PANIC at ../../filesys/directory.c:127 in dir_lookup(): assertion `name != NULL' failed.
-FAIL tests/userprog/open-bad-ptr
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/userprog/open-twice.ck tests/userprog/open-twice tests/userprog/open-twice.result
-perl -I../.. ../../tests/userprog/close-normal.ck tests/userprog/close-normal tests/userprog/close-normal.result
-FAIL tests/userprog/open-twice
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-FAIL tests/userprog/close-normal
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (close-normal) begin
-  (close-normal) open "sample.txt"
-  (close-normal) close "sample.txt"
-  (close-normal) end
-  close-normal: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (close-normal) begin
-  (close-normal) open "sample.txt"
-  (close-normal) close "sample.txt"
-  (close-normal) end
-- close-normal: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/close-twice.ck tests/userprog/close-twice tests/userprog/close-twice.result
-perl -I../.. ../../tests/userprog/close-stdin.ck tests/userprog/close-stdin tests/userprog/close-stdin.result
-perl -I../.. ../../tests/userprog/close-stdout.ck tests/userprog/close-stdout tests/userprog/close-stdout.result
-FAIL tests/userprog/close-twice
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (close-twice) begin
-  (close-twice) open "sample.txt"
-  (close-twice) close "sample.txt"
-  (close-twice) close "sample.txt" again
-  (close-twice) end
-  close-twice: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (close-twice) begin
-  (close-twice) open "sample.txt"
-  (close-twice) close "sample.txt"
-  (close-twice) close "sample.txt" again
-  (close-twice) end
-- close-twice: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-Acceptable output:
-  (close-twice) begin
-  (close-twice) open "sample.txt"
-  (close-twice) close "sample.txt"
-  (close-twice) close "sample.txt" again
-  close-twice: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (close-twice) begin
-  (close-twice) open "sample.txt"
-  (close-twice) close "sample.txt"
-  (close-twice) close "sample.txt" again
-- close-twice: exit(-1)
-+ (close-twice) end
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/close-bad-fd.ck tests/userprog/close-bad-fd tests/userprog/close-bad-fd.result
-FAIL tests/userprog/close-stdin
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (close-stdin) begin
-  close-stdin: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (close-stdin) begin
-- close-stdin: exit(-1)
-+ (close-stdin) end
-+ 
-+ Process exit(3), status: 0
-+ 
-Acceptable output:
-  (close-stdin) begin
-  (close-stdin) end
-  close-stdin: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (close-stdin) begin
-  (close-stdin) end
-- close-stdin: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/read-normal.ck tests/userprog/read-normal tests/userprog/read-normal.result
-FAIL tests/userprog/close-stdout
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (close-stdout) begin
-  close-stdout: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (close-stdout) begin
-- close-stdout: exit(-1)
-+ (close-stdout) end
-+ 
-+ Process exit(3), status: 0
-+ 
-Acceptable output:
-  (close-stdout) begin
-  (close-stdout) end
-  close-stdout: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (close-stdout) begin
-  (close-stdout) end
-- close-stdout: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/read-bad-ptr.ck tests/userprog/read-bad-ptr tests/userprog/read-bad-ptr.result
-FAIL tests/userprog/close-bad-fd
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (close-bad-fd) begin
-  (close-bad-fd) end
-  close-bad-fd: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (close-bad-fd) begin
-  (close-bad-fd) end
-- close-bad-fd: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-Acceptable output:
-  (close-bad-fd) begin
-  close-bad-fd: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (close-bad-fd) begin
-- close-bad-fd: exit(-1)
-+ (close-bad-fd) end
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/read-boundary.ck tests/userprog/read-boundary tests/userprog/read-boundary.result
-FAIL tests/userprog/read-normal
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/userprog/read-zero.ck tests/userprog/read-zero tests/userprog/read-zero.result
-FAIL tests/userprog/read-bad-ptr
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/userprog/read-stdout.ck tests/userprog/read-stdout tests/userprog/read-stdout.result
-FAIL tests/userprog/read-boundary
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/userprog/read-bad-fd.ck tests/userprog/read-bad-fd tests/userprog/read-bad-fd.result
-perl -I../.. ../../tests/userprog/write-normal.ck tests/userprog/write-normal tests/userprog/write-normal.result
-FAIL tests/userprog/read-zero
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/userprog/write-bad-ptr.ck tests/userprog/write-bad-ptr tests/userprog/write-bad-ptr.result
-FAIL tests/userprog/read-stdout
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (read-stdout) begin
-  (read-stdout) end
-  read-stdout: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (read-stdout) begin
-  (read-stdout) end
-- read-stdout: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-Acceptable output:
-  (read-stdout) begin
-  read-stdout: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (read-stdout) begin
-- read-stdout: exit(-1)
-+ (read-stdout) end
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/write-boundary.ck tests/userprog/write-boundary tests/userprog/write-boundary.result
-FAIL tests/userprog/read-bad-fd
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (read-bad-fd) begin
-  (read-bad-fd) end
-  read-bad-fd: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (read-bad-fd) begin
-  (read-bad-fd) end
-- read-bad-fd: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-Acceptable output:
-  (read-bad-fd) begin
-  read-bad-fd: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (read-bad-fd) begin
-- read-bad-fd: exit(-1)
-+ (read-bad-fd) end
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/write-zero.ck tests/userprog/write-zero tests/userprog/write-zero.result
-FAIL tests/userprog/write-normal
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/userprog/write-stdin.ck tests/userprog/write-stdin tests/userprog/write-stdin.result
-FAIL tests/userprog/write-boundary
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/userprog/write-bad-fd.ck tests/userprog/write-bad-fd tests/userprog/write-bad-fd.result
-FAIL tests/userprog/write-bad-ptr
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/userprog/exec-once.ck tests/userprog/exec-once tests/userprog/exec-once.result
-FAIL tests/userprog/write-zero
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/userprog/exec-arg.ck tests/userprog/exec-arg tests/userprog/exec-arg.result
-FAIL tests/userprog/write-stdin
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (write-stdin) begin
-  write-stdin: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (write-stdin) begin
-- write-stdin: exit(-1)
-+ (write-stdin) end
-+ 
-+ Process exit(3), status: 0
-+ 
-Acceptable output:
-  (write-stdin) begin
-  (write-stdin) end
-  write-stdin: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (write-stdin) begin
-  (write-stdin) end
-- write-stdin: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/exec-multiple.ck tests/userprog/exec-multiple tests/userprog/exec-multiple.result
-FAIL tests/userprog/write-bad-fd
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (write-bad-fd) begin
-  (write-bad-fd) end
-  write-bad-fd: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (write-bad-fd) begin
-  (write-bad-fd) end
-- write-bad-fd: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-Acceptable output:
-  (write-bad-fd) begin
-  write-bad-fd: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (write-bad-fd) begin
-- write-bad-fd: exit(-1)
-+ (write-bad-fd) end
-+ 
-+ Process exit(3), status: 0
-+ 
-FAIL tests/userprog/exec-once
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (exec-once) begin
-  (child-simple) run
-  child-simple: exit(81)
-  (exec-once) end
-  exec-once: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (exec-once) begin
-+ Checkpoint 6
-  (child-simple) run
-- child-simple: exit(81)
-+ 
-+ Process exit(4), status: 81
-+ 
-  (exec-once) end
-- exec-once: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/exec-bad-ptr.ck tests/userprog/exec-bad-ptr tests/userprog/exec-bad-ptr.result
-perl -I../.. ../../tests/userprog/wait-simple.ck tests/userprog/wait-simple tests/userprog/wait-simple.result
-FAIL tests/userprog/exec-arg
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (exec-arg) begin
-  (args) begin
-  (args) argc = 2
-  (args) argv[0] = 'child-args'
-  (args) argv[1] = 'childarg'
-  (args) argv[2] = null
-  (args) end
-  child-args: exit(0)
-  (exec-arg) end
-  exec-arg: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (exec-arg) begin
-+ Checkpoint 6
-  (args) begin
-  (args) argc = 2
-  (args) argv[0] = 'child-args'
-  (args) argv[1] = 'childarg'
-  (args) argv[2] = null
-  (args) end
-- child-args: exit(0)
-+ 
-+ Process exit(4), status: 0
-+ 
-  (exec-arg) end
-- exec-arg: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-FAIL tests/userprog/exec-multiple
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (exec-multiple) begin
-  (child-simple) run
-  child-simple: exit(81)
-  (child-simple) run
-  child-simple: exit(81)
-  (child-simple) run
-  child-simple: exit(81)
-  (child-simple) run
-  child-simple: exit(81)
-  (exec-multiple) end
-  exec-multiple: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (exec-multiple) begin
-+ Checkpoint 6
-  (child-simple) run
-- child-simple: exit(81)
-+ 
-+ Process exit(4), status: 81
-+ 
-+ Checkpoint 6
-  (child-simple) run
-- child-simple: exit(81)
-+ 
-+ Process exit(5), status: 81
-+ 
-+ Checkpoint 6
-  (child-simple) run
-- child-simple: exit(81)
-+ 
-+ Process exit(6), status: 81
-+ 
-+ Checkpoint 6
-  (child-simple) run
-- child-simple: exit(81)
-+ 
-+ Process exit(7), status: 81
-+ 
-  (exec-multiple) end
-- exec-multiple: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/wait-killed.ck tests/userprog/wait-killed tests/userprog/wait-killed.result
-perl -I../.. ../../tests/userprog/wait-bad-pid.ck tests/userprog/wait-bad-pid tests/userprog/wait-bad-pid.result
-FAIL tests/userprog/exec-bad-ptr
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/userprog/multi-recurse.ck tests/userprog/multi-recurse tests/userprog/multi-recurse.result
-FAIL tests/userprog/wait-simple
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (wait-simple) begin
-  (child-simple) run
-  child-simple: exit(81)
-  (wait-simple) wait(exec()) = 81
-  (wait-simple) end
-  wait-simple: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (wait-simple) begin
-+ Checkpoint 6
-  (child-simple) run
-- child-simple: exit(81)
-- (wait-simple) wait(exec()) = 81
-+ 
-+ Process exit(4), status: 81
-+ 
-+ (wait-simple) wait(exec()) = 4
-  (wait-simple) end
-- wait-simple: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/userprog/multi-child-fd.ck tests/userprog/multi-child-fd tests/userprog/multi-child-fd.result
-FAIL tests/userprog/wait-killed
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-FAIL tests/userprog/wait-bad-pid
-Test output failed to match any acceptable form.
-
-Acceptable output:
-  (wait-bad-pid) begin
-  (wait-bad-pid) end
-  wait-bad-pid: exit(0)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (wait-bad-pid) begin
-  (wait-bad-pid) end
-- wait-bad-pid: exit(0)
-+ 
-+ Process exit(3), status: 0
-+ 
-Acceptable output:
-  (wait-bad-pid) begin
-  wait-bad-pid: exit(-1)
-Differences in `diff -u' format:
-+ Checkpoint 6
-  (wait-bad-pid) begin
-- wait-bad-pid: exit(-1)
-+ (wait-bad-pid) end
-+ 
-+ Process exit(3), status: 0
-+ 
-perl -I../.. ../../tests/filesys/base/lg-create.ck tests/filesys/base/lg-create tests/filesys/base/lg-create.result
-perl -I../.. ../../tests/filesys/base/lg-full.ck tests/filesys/base/lg-full tests/filesys/base/lg-full.result
-FAIL tests/userprog/multi-recurse
-run: wait(exec("multi-recurse 0")) returned 18: FAILED
-perl -I../.. ../../tests/filesys/base/lg-random.ck tests/filesys/base/lg-random tests/filesys/base/lg-random.result
-FAIL tests/userprog/multi-child-fd
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/filesys/base/lg-seq-block.ck tests/filesys/base/lg-seq-block tests/filesys/base/lg-seq-block.result
-FAIL tests/filesys/base/lg-full
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-FAIL tests/filesys/base/lg-create
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/filesys/base/lg-seq-random.ck tests/filesys/base/lg-seq-random tests/filesys/base/lg-seq-random.result
-perl -I../.. ../../tests/filesys/base/sm-create.ck tests/filesys/base/sm-create tests/filesys/base/sm-create.result
-FAIL tests/filesys/base/lg-random
-run: write 512 bytes at offset 6144 failed: FAILED
-FAIL tests/filesys/base/lg-seq-block
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/filesys/base/sm-full.ck tests/filesys/base/sm-full tests/filesys/base/sm-full.result
-perl -I../.. ../../tests/filesys/base/sm-random.ck tests/filesys/base/sm-random tests/filesys/base/sm-random.result
-FAIL tests/filesys/base/lg-seq-random
-Run didn't start up properly: no "Pintos booting" message
-FAIL tests/filesys/base/sm-create
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/filesys/base/sm-seq-block.ck tests/filesys/base/sm-seq-block tests/filesys/base/sm-seq-block.result
-perl -I../.. ../../tests/filesys/base/sm-seq-random.ck tests/filesys/base/sm-seq-random tests/filesys/base/sm-seq-random.result
-FAIL tests/filesys/base/sm-full
-run: write 5678 bytes at offset 0 in "quux" failed: FAILED
-FAIL tests/filesys/base/sm-random
-run: write 13 bytes at offset 858 failed: FAILED
-perl -I../.. ../../tests/filesys/base/syn-read.ck tests/filesys/base/syn-read tests/filesys/base/syn-read.result
-perl -I../.. ../../tests/filesys/base/syn-remove.ck tests/filesys/base/syn-remove tests/filesys/base/syn-remove.result
-FAIL tests/filesys/base/sm-seq-block
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-perl -I../.. ../../tests/filesys/base/syn-write.ck tests/filesys/base/syn-write tests/filesys/base/syn-write.result
-FAIL tests/filesys/base/syn-read
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-FAIL tests/filesys/base/syn-remove
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
-FAIL tests/filesys/base/sm-seq-random
-Run didn't start up properly: no "Pintos booting" message
-FAIL tests/filesys/base/syn-write
-Kernel panic in run: PANIC at ../../userprog/exception.c:100 in kill(): Kernel bug - unexpected interrupt in kernel
diff --git a/src/userprog/messages b/src/userprog/messages
index d70983f70aee5893e7a5924ad02e774c7057c0ff..02515b05b5be6efb2e9a6eccd8d19ffe92d927b8 100644
GIT binary patch
literal 16645
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

delta 19
bcmZo|V(d`ge1UTZ=jI2TD>x@V;M4#BQN;)L

diff --git a/src/userprog/process.c b/src/userprog/process.c
index f8dc612..c77fd5b 100644
--- a/src/userprog/process.c
+++ b/src/userprog/process.c
@@ -35,13 +35,11 @@ struct main_args
 
 void* setup_main_stack(const char* command_line, void* stack_top);
 
-static struct lock exit_lock;
 /* This function is called at boot time (threads/init.c) to initialize
  * the process subsystem. */
 void process_init(void)
 {
   pmap_init(&process_table);
-  lock_init(&exit_lock);
 }
 
 /* This function is currently never called. As thread_exit does not
@@ -204,9 +202,9 @@ start_process (struct parameters_to_start_process* parameters)
   /* Add process information to process list */
   struct process* p = malloc(sizeof(struct process));
   ptype_init(p, parameters->par_id, thread_current()->name);   //create value type for process list
-  int inserted UNUSED = pmap_insert(&process_table, thread_tid(), p);
+  pmap_insert(&process_table, thread_tid(), p);
 
-  if ( ! success /*|| inserted == -1*/)
+  if ( ! success )
   {
     *(parameters->chi_id) = -1;
     sema_up(&parameters->arg_sem);
@@ -299,12 +297,10 @@ process_cleanup (void)
    * that may sometimes poweroff as soon as process_wait() returns,
    * possibly before the printf is completed.)
    */
-  lock_acquire(&exit_lock);
+
   /* remove process from process table */
   struct process *p = pmap_find(&process_table, thread_tid());
 
- //synkronisera open_file_table och process_table
-
   if(p != NULL)
   {
     status = p->exit_status;
@@ -329,12 +325,12 @@ process_cleanup (void)
   //remove all child process that is marked as dead from the process list
   pmap_remove_if(&process_table, parent_ded, 0);
 
+  //close all files opened by this process
   map_for_each(&open_file_table, pf_close, thread_tid());
 
   /* remove all open files in table for this process */
   map_remove_if(&open_file_table, owned_by, 0);
 
-  lock_release(&exit_lock);
   /* Destroy the current process's page directory and switch back
      to the kernel-only page directory. */
   if (pd != NULL)
diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c
index 1826418..504c073 100644
--- a/src/userprog/syscall.c
+++ b/src/userprog/syscall.c
@@ -218,7 +218,6 @@ bool remove(int32_t* esp)
     process_exit(-1);
     thread_exit();
   }
-
   return filesys_remove((char*)esp[1]);
 }
 
@@ -233,7 +232,6 @@ int open(int32_t* esp)
     process_exit(-1);
     thread_exit();
   }
-
   struct file *file = filesys_open((char*)esp[1]);
   if(file == NULL)
     return -1;
-- 
GitLab