I'm writing a Python fuzzer to fuzz some specific php functions. But i have both doubts and problems. Generally speaking the fuzzer works as follows: it generates some payloads and then invokes the php interpreter to call a given function passing the payloads as argument(s) using the syntax:
php -r "function('payload');"
My doubt is the following: let's suppose, for example, that function() is vulnerable to buffer overflow. Passing a long enough payload function() should crash. But would the PHP interpreter crash too? Or it would simply return an error (ex. fatal error)? Or maybe nothing? In fact the bug is not in the interpreter but in the function() code. And i don't know what happen in the interpreter if a function it calls crashes.
My problem is: how can i really and efficiently catch errors (especially memory violation/segfault) in function()? Until now, i used to read the return code of the interpreter. But, because of my doubt, i'm not sure that if function() crashes the interpreter would return something strange/would crash too. For example, i read about pydbg library which seems to catch errors deeply. But it seems not to be supported anymore and it is only for win32 while i'm using Unix OS. Do you have any ideas?
Can someone please clarify my doubts? Thanks in advance to everybody!