Rubric updates from Winter 2013 CS 140 at Stanford
[pintos-anon] / ta-advice / hw2.txt
index b0ed14335e22a93b7e2744b7a37aca17cd6e5e7f..bd45909c20305ff12371d236c934b134c0eeec08 100644 (file)
@@ -11,6 +11,8 @@ OVERALL
   DESIGN
     -10 Failure to check return value of malloc()
     -10 Use of ASSERT to check something that can actually fail, e.g. malloc()
+    -10 Fails to free all resources during normal execution [specify where]
+     -5 Fails to free all resources when handling errors [specify where]
 
   CODING STYLE
     -10 Inconsistent or bad coding style: no indentation, cramming
@@ -36,7 +38,7 @@ PROBLEM 1: ARGUMENT PASSING
     -10 A2: Missing/non-responsive/too long/too short
     -10 A3: Missing/non-responsive/too long/too short
     -10 A3: Claims that strtok_r() does not modify the string it parses
-    -10 A3: Claims that strtok() uses a static buffer for parsing
+     -0 A3: Claims that strtok() uses a static buffer for parsing
     -10 A4: Missing/non-responsive/too long/too short
      -5 A4: Claims time or space advantage for user-space parsing
      -5 A4: Claims that the shell implements relative paths
@@ -47,11 +49,16 @@ PROBLEM 1: ARGUMENT PASSING
     -30 Not implemented
     -10 Uses global variables, locks, etc.
     -15 Doesn't check for stack overflow
+     -5 Stack overflow checking incomplete/buggy
     -10 Assumes any command line under N bytes long will fit in a page
         [change N to the value assumed, where N >= 1,366]
     -10 Assumes that the command line is capped at 128 bytes
      -1 Assumes that individual strings must be word-aligned for performance
     -10 Argument passing code is difficult to read or poorly abstracted
+    -10 Uses buffer on stack to copy command, possibly overflowing the
+        kernel stack
+    -10 Uses buffer on stack to hold pointers to each argument, possibly
+        overflowing the kernel stack
     
 Total deductions (capped at -30): XXX
 
@@ -68,7 +75,7 @@ PROBLEM 2: SYSTEM CALLS
      -3 B1: Omitted data for "wait" system call
      -3 B1: Omitted data for "exec" to wait for process loading to complete
      -6 B2: Missing/non-responsive/too long/too short
-     -2 B2: Claims that Pintos has stderr file descriptor
+     -0 B2: Claims that Pintos has stderr file descriptor
      -6 B3: Missing/non-responsive/too long/too short
      -3 B3: Claims that struct intr_frame's eax member is on user stack
      -6 B4: Missing/non-responsive/too long/too short
@@ -84,6 +91,9 @@ PROBLEM 2: SYSTEM CALLS
      -3 B5+B8: "wait" always returns -1 if child has already exited
      -3 B5+B8: "wait" or "exit" searches a global list of all processes
      -6 B5+B8: "wait" or "exit" has race condition [which]
+     -3 B5+B8: each additional, independent race condition for exec/wait/exit.
+        (e.g. unsynchronized global list access vs. race in setting return
+        values vs. race for cleanup of shared state)
      -6 B6: Missing/non-responsive/too long/too short
      -6 B7: Missing/non-responsive/too long/too short
      -3 B7: Calls thread_block() directly (use semaphores instead)
@@ -97,6 +107,8 @@ PROBLEM 2: SYSTEM CALLS
     -60 Not implemented
      -5 Global counter for file descriptors lacks synchronization
     -10 Global table of file descriptors lacks synchronization
+     -5 Global table of file descriptors has synchronization bugs
+    -10 No external synchronization in handling filesystem calls.
      -5 Global table allows multiple processes to access same file descriptor
      -5 Added big array (>= 512 bytes) to struct thread without justifying
     -10 Added big array (>= 1024 bytes) to struct thread
@@ -104,6 +116,7 @@ PROBLEM 2: SYSTEM CALLS
     -10 System call handler is poorly abstracted or unreadable
      -5 Failed to update comment on process_wait() function after implementing
      -5 "open" system call fails to release all resources in error cases
+    -10 strlen before (in the call to) validate a null terminated string
      
 Total deductions (capped at -60): XXX