• 0

PHP extension exceptions (and segfault)


Question

So I've done this PHP extension... It uses libtiff, but one thing that's actually been really ****ing me off for the past few hours and I'm unable to fix, is exceptions..

Libtiff sometime's throws an exception like if it's not a valid TIFF file, so I've tried various ways to try and stop this from happening because it causes PHP to segfault.

e.g. TIFFSetWarningHandler (0); TIFFSetErrorHandler (0); and TIFFSetWarningHandler (MyTiffError); TIFFSetErrorHandler (MyTiffError);

void MyTiffError(const char* module, const char* fmt, va_list argptr)

{

//Tried all of this seperately

return;

php_set_error_handling(EH_THROW, zend_exception_get_default() TSRMLS_CC);

zend_throw_exception(zend_exception_get_default(TSRMLS_C), "blah blah", 0 TSRMLS_CC);

i_push_errorvf(0, fmt, argptr);

}

But no matter what I do, it's still segfaulting PHP. So I'm at a loss of how to the hell I get it to stop segfaulting and just quit the function it's running but allow PHP to keep executing, any ideas?

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.