| } | ||
|
|
||
| /* Run close() even with a pending exception, so the handler releases its resources; skip real exit()/die() (bug #60634). */ | ||
| if (EG(exception) && !zend_is_unwind_exit(EG(exception)) && !zend_is_graceful_exit(EG(exception))) { |
There was a problem hiding this comment.
This dance is never a good idea.
Sorry, something went wrong.
There was a problem hiding this comment.
When I use zend_exception_save()/zend_exception_restore() there is a test failing with the message Deprecated: Creation of dynamic property UnwindExit::$previous is deprecated. Should I fix those helpers and use them? Or is there another smart way for serving those exceptions?
Sorry, something went wrong.
There was a problem hiding this comment.
I believe zend_exception_save is even gone on master. But my point is that maybe close shouldn't be called anywya
Sorry, something went wrong.
There was a problem hiding this comment.
I don't think running usercode while an exception hasn't been caught is sensible.
This whole saving and restoring exceptions functions have been removed in master because it is a bad idea.
This just seems like a user error where an exception shouldn't be thrown in the handler functions. As I don't see why this problem can't happen if you throw an exception on one of the other handlers (e.g. read).
Sorry, something went wrong.
|
I don't think running usercode while an exception hasn't been caught is sensible. I don't see how your new code still doesn't do exactly that. We can't fix users writing bogus code. |
Sorry, something went wrong.
|
We can't fix users writing bogus code. But we can fix leaking locks of files in the built-in SessionHandler. I think it's a sound middle ground for this bug. I don't see any other alternatives for this bug than:
session_set_save_handler(new \SessionHandler, true);
session_start([
'save_path' => __DIR__,
]);
$_SESSION['test'] = function () {};
|
Sorry, something went wrong.
Fixes #16027