19 Jul 2012 20:14
[PHP-DEV] How to track down an APC bug
Rasmus Lerdorf <rasmus <at> lerdorf.com>
2012-07-19 18:14:47 GMT
2012-07-19 18:14:47 GMT
The goal of this message is to encourage and motivate a few people to give me a hand with tracking down APC bugs. There are still a few outstanding bugs that is slowing PHP 5.4 adoption and it would be really nice to plow through these instead of wasting cycles on some of the other discussions going on here. The example bug I will use is one I just fixed. Bug http://php.net/62398 which was that with apc.stat=0 the second request (eg. the cached request) to a certain script would have include filenames replaced with an empty string. Clue #1 here is that we are dealing with string literals and those obviously changed a lot in 5.4. Clue #2 I got lucky with. I was able to reproduce it locally which makes everything much simpler because then Valgrind can do most of the thinking for us. So, knowing it has to do with string literals and taking my reproduce case, I first eliminated all non-php code by using the built-in web server in 5.4. I have a little memcheck shell script that runs Valgrind with my preferred options. It looks like this: #!/bin/bash USE_ZEND_ALLOC=0 valgrind --tool=memcheck --suppressions=/home/rasmus/.suppressions --leak-check=yes --track-origins=yes --num-callers =30 --show-reachable=yes "$ <at> " And my .suppressions file can be found here:(Continue reading)
RSS Feed