- 0
PHP extension exceptions (and segfault)
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
Western Digital pricing error had hard drives selling for just $1, $3, $5, $10 and more
By hellowalkman,
- pricing error
- mistakenly
- (and 11 more)
- 14 replies
- 3 views
-
- 5 replies
- 4,248 views
-
Microsoft explains the August and September 2018 monthly rollup, security install issues 1 2
By Ruel Revales,
- 37 replies
- 1,273 views
-
- 1 reply
- 3,411 views
-
- 14 replies
- 946 views
-
Question
n_K
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