CS360 Final Exam: May 6, 2004. Grading Guide
Question 1 - 10 Points
1 point:
You had two pipes upon which you call
pipe()
.
1 point:
Call
fork()
, and
execlp()
in the child.
0.5 points:
Cardinal sin of
exec
handled.
1 point:
Properly
dup2()
stdin/stdout in the child.
1 point:
Close all pipe buffers in the child.
1 point:
Close proper pipe buffers in the parent.
0.5 points:
Parent has while 1 loop with proper structure.
1 point:
Parent calls
read()/write()
to the proper fd's.
1 point:
Parent makes proper
read()
call.
1 point:
Parent prints the value correctly.
1 point:
No extraneous
dups/pipes/close
s.
Question 2 - 5 Points
Basically, allocated as to how well I thought you answered the question.
Question 3 - 12 Points
Each of these was worth one point:
Part A:
Clearly demarcated areas for
a
,
b
, &
c
.
Part A:
B
overruns its area.
Part A:
There is a final free chunk.
Part A:
A/B/C
's sizes are implicitly correct.
Part A:
A
&
B
's sizes are explicitly correct (24).
Part A:
The numbers look right (100-103, etc).
Part A:
The free chunk's size is 8112.
Part A:
The free chunk's pointers are
NULL
.
Part B:
A
's size is 24 & has decent looking flink/blink's.
Part B:
B
's size is 24 still.
Part B:
The free chunk's flink/blink pointers look right.
Overall thre is no extraneous stuff (like
i
) in the heap.
.
Question 4 - 10 Points
Each of these was worth one point. No partial credit.
Question 5 - 8 Points
2 points
: You state that you are longjmping somewhere bad in memory.
2 points
: You state that the return causes you to longjmp to a corrupted stack location.
1 point
: ID-string is pointing to
buf
.
1.5 points
: The fprintf may seg fault or print garbage.
1.5 points
: The free may seg fault, bus error, or corrupt memory.