Debugging Malloc Lab for CSAPP
These days I’m working on malloc lab for course csapp. No doubt that it’s the hardest lab in this course. Everyone feels desprate when facing endless segmentfault. Typically, you just added a few lines and then your malloc became full of segment faults.

I spent over 40 hours on this lab and 70% of my time is on debugging. I also implemented many optimizations to improve my malloc’s performance. But finally my score is stuck at 97. Only 1 guy in this class got 100. I have no idea how he made this. It is said that he removed header and footer of block. If you don’t want to spend too much time on this lab, writing a malloc with explicit list is enough to get 90+ score. This is definitely possible and has been proved by my friend and TA.
Writing Shell Lab for CSAPP
Shell Lab is the 1st lab after midterm exam of 15213/18213 (Introduction to computer system), and it’s more complicated than previous labs. The most annoying part about this lab must be race condition. I spent over two days on debugging a concealed race condition. It’s such a disgusting bug that TA and me checked code line by line whole night to fix it.
So here are some points should take care.
Avoid Race Condition
Several things you should do to avoid race condition.
Hello world!
Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!