Yermo,
Essentially, what Andi was saying is that we need your help in order for us to help you. To put it more clearly - even if there is a bug in the language engine or some other component of PHP - it's impossible for us to figure out what it is, unless we're provided with a reproducible test case that's small enough to analyze.
At 05:08 06/03/2005, Yermo Lamers wrote:
> It also means that instead of you > spending the time to try and reproduce it, one of the PHP Development > team would have to do it because in most cases it's the only way to > really understand what's going wrong.
Not what I was asking for. I was asking for some direction. What do you guys do when you've got a buffer overrun by 10 error that happens randomnly?
How do you guys track it down?
There's usually no magic there, just a lot of work narrowing things down (as opposed to trying and guess where the problem is and create a new test case). To narrow it down, create a copy of the app that's causing the problem, and start cutting out parts gradually, while checking in every step of the way that the problem is still occurring. This is the time consuming part, that you're probably more qualified to do than any of us, since you know your code best. Make sure you keep the editor window open, so that you can undo a change that causes the problem to disappear. An important thing is actually not to stop when you find the line or block that appears to trigger the error - but continue and try to remove other parts of the code. Essentially, what would help us best is a piece of code that:
(a) reproduces the problem
(b) is a derivative of the original code that went through the above mentioned process, rather than a bottom-up written script that reproduces a similar problem
(c) anything removed from that piece of code will cause the problem to disappear
Disabling the Zend memory manager (change USE_ZEND_ALLOC to 0 in zend_alloc.h) and using valgrind can also sometimes shed light on the source of the problem, although it's usually only practical once you already have a stripped down version of the script.
Maybe there should be a "What to do when you can't reproduce it in a few lines of code" page to help guys like me out.
That's not a bad idea!
Hope this helps,
Zeev
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php