logging - Why would a log statement change the output of a program? -
During the interview I asked the following questions, and I am still not quite clear on the answer. I was wondering if anyone knew where I could learn more, googling is not helping much:
Say you have a program that you want to test. You add a single log statement and suddenly, the program that produced the expected output would stop the expected production output.
Ah I really did that.
Let's consider a program that is a bug that has to expose the heap. If you present a log or print statement, call the log may change the stack enough to change the behavior.
This is an interesting problem, perhaps one of the easiest to do this with a bad format in a printf ...
OK, at least one example would look like this in the framework .
int parent () {... printf ("% s \ n", itao (child ()); Int kids () {int num; Scanf ("% d% d", num); / * Notice to the format; Scanf will eat as much as it should * be compared to stack * / return number; / * But this return can successfully open the stack
If you insert a printf ()
before return, then your case will be.
Comments
Post a Comment