After the sigsetjmp change, this is patch #2 in an effort to get some
sanity restored to signal handling in PHP.
This patch does two things. First, it makes it possible to reset the
timeout without resetting the signal handlers. This is important for
cases where an extension may have deferred signals in its MINIT in order
to implement critical sections. It also lays the groundwork for cleaning
up our signal handling and perhaps eventually implementing our own
signal deferring mechanism so we can have true critical sections.
The second thing this does is to make it possible to terminate the current
child process (only for Apache1 at the moment) on a timeout. There are
a number of extensions that are unhappy about being longjmp'ed out of
and when this happens on a timeout they are left in an inconsistent state.
By turning on exit_on_timeout you can now force the process to terminate
on a timeout which will clean up any hanging locks and/or memory left
hanging after the longjmp.
sigsetjmp use setjmp. Windows is of course weird in that it seems to
have sigsetjmp but not sigjmp_buf (??) so force it to use setjmp in
config.w32.h.in
consistent in how we deal with the signal mask. POSIX doesn't specify
what to do with the signal mask in setjmp/longjmp which has resulted in
the signal mask getting saved on *BSD and not getting saved on Linux.
Making the behaviour explicit via sigsetjmp/siglongjmp gives us
consistency and saves expensive sigprocmask() syscalls on *BSD.
Bug #44352 mysqli_connect_error() false negative for host errors
From now on the mysqli object doesn't have that magic properties, like
error, which were readable but not visible through isset(), property_exists()
and var_dump(). All other ext/mysqli classes were fixed too.
Now it will be easier to debug mysqli based applications.
The following pseudo-code explains how it should be used in opcode cache.
function cache_compile_file($filename) {
if (!is_cached($filename)) {
...
orig_compiler_options = CG(compiler_optins);
CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES |
ZEND_COMPILE_DELAYED_BINDING;
$op_array = orig_compile_file($filename);
CG(compiler_options) = orig_copiler_options;
...
} else {
$op_array = restore_from_cache($filename);
}
zend_do_delayed_early_binding($op_array);
}
Never mind, it looks like ext/filter does an estrdup on everything it
gets which doesn't seem very efficient to me as most things it gets
passed will already be emalloc'ed. My custom version of the filter
extension doesn't do this which led to the confusion.
emalloc'ed data assigned to things like r->uri and having it get efree()'ed
on request shutdown which then means that if the Apache logging module
tries to log r->uri it would be reading from free'ed memory. So a simple
estrdup before the filter call takes care of that.