Closed Qcloud1223 closed 2 years ago
Thanks to @SoullAngle, he pointed out that one could easily bypass test 6 by printf
when using lazy relocation.
Currently, I think this could be fixed by interposing printf
as well, but this is not the perfect way, for ultimately printf
is write
to stdout
, and syscalls cannot be interposed. Plus, I highly doubt that interposing printf
will crash gdb.
To make things broader, it seems that every test can be bypassed by simply printf
, depending on the library loaded. Should I work for ultimate automatically evaluation, or allow the imperfectness, manually inspecting the code?
Addressed in PR #14
A compromise I made during I writing this project is that a non-system dynamic linker is nearly impossible to correctly load
glibc
, so that I turn todlopen
anddlsym
to resolveglibc
symbols.This could cause questions, for example:
In a word, one may call
dlopen
on every shared object and get away with the autograder.I fully believe the students who are working on this project, and will still keep my grading policies. However, I do want to fix the imperfectness.
Possible solutions are as follows:
dlopen
. Using a wrapper to count how many timesdlopen
anddlsym
are called, and print it tostderr
. I can make sure how many times these functions need to be called. This seems alright, but needs to make sureMakefile
is not modified.