COMP 2012H Honors Object-Oriented Programming and Data Structures

Assignment 2 Grade Appeal

Grade Appeal Procedures

Check your grade and remarks here.
Check the Grading Scheme here.
Check the sample solution here.

  1. Download the grader and memory_leak_grader.
  2. Supply your own Process.cpp, ProcessNode.cpp, ProcessQueue.cpp, and ProcessScheduler.cpp files to compile and run these two programs.
  3. You can run grader with the following command line options:
    • -o results.txt to write the output into the specified textfile.
    • -s to also output successful cases.
    • To run individual test cases, add these command line options with the double-quotes:
      • "Process"
      • "ProcessQueue enqueue() and dequeue()"
      • "ProcessQueue is_empty()"
      • "AddProcess1"
      • "AddProcess2"
      • "RemoveProcess"
      • "Quantum"
      • "Aging1"
      • "Aging2"
      • "Randomized Stress Test"
  4. Run memory_leak_grader with Dr. Memory or Valgrind to get the memory leak report.
  5. Send an email to Bing Yen if the results of the grader and memory_leak_grader are not consistent with your given grade. Attach your grader and/or memory_leak_grader output as textfile(s) in your email.

Crash or Infinite Loop

If the grader or memory_leak_grader program crashes or enters an infinite loop for any of the test cases, and the cause is only due to a minor bug (e.g. forgetting to check for nullptr), you may fix the bug and send an email to Bing Yen with your updated .cpp file(s), as well as a description of the fix. We will regrade your assignment only for the "Process", "ProcessQueue", and "ProcessScheduler" portions, but we will not regrade the "Randomized Stress Test" and "Memory Leak" portions.

However, we will not regrade if the bugfix is not obvious and straightforward.

Check Memory Leak

You can use Dr. Memory or Valgrind to check memory leak. After your program finishes, these tools will generate a report containing all the memory related issues.

Dr. Memory (For Windows, Mac and Linux)

Run the following in command line:
X:\path\to\drmemory\bin64\drmemory.exe X:\path\to\your\executable.exe

You will get following message:

Error #1: LEAK 16 direct bytes 0x0000000002fd0dc0-0x0000000002fd0dd0 + 0 indirect bytes
# 0 replace_operator_new                [d:\drmemory_package\common\alloc_replace.c:2900]
# 1 ProcessScheduler::add_process       [C:\memory_leak_tester\../ProcessScheduler.cpp:74]
# 2 main                                [C:\memory_leak_tester\../memory_leak_grader.cpp:18]

FINAL SUMMARY:

ERRORS FOUND:
	1 unique,  1023 total,  16368 byte(s) of leak(s)
                        
Note:
  • We ignore all errors that are not caused by Process, ProcessNode, ProcessQueue, or ProcessScheduler.
  • Some of the leak problems cannot be detected if your compiler is Visual Studio.
  • It may take quite long time when you run it for the first time.


Valgrind (For Mac and Linux)

Run the following in command line:
$ valgrind --tool=memcheck --leak-check=full path/to/your/executable

You will get the following message:

==10425== HEAP SUMMARY:
==10425==     in use at exit: 16,368 bytes in 1023 blocks
==10425==   total heap usage: 1023 allocs, 0 frees, 16,368 bytes allocated
==10425==
==10425== 16,368 bytes in 1023 blocks are definitely lost in loss record 1 of 1
==10425==    at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334)
==10425==    by 0x109146: ProcessScheduler::add_process() (in /some/dir/test)
==10425==    by 0x109152: main (in /some/dir/test)
Note: Valgrind doesn't support Windows.

Statistics (Including Bonus Task)

  • Total: 115%
  • Mean: 74.5%
  • SD: 33%
  • Median: 87%
  • Max: 115%
  • Min: 4%
Page maintained by
Homepage