-
-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
follow on #50 #81
follow on #50 #81
Conversation
Still the same issue with this patch. Yes, I'm using an M1 but I've no idea if it's related or not. |
Here is a better trace:
|
@@ -302,7 +302,7 @@ uintptr_t frankenphp_request_shutdown() | |||
int i; | |||
|
|||
for (i=0; i<NUM_TRACK_VARS; i++) { | |||
zval_ptr_dtor(&PG(http_globals)[i]); | |||
zval_ptr_dtor_nogc(&PG(http_globals)[i]); | |||
} | |||
} zend_end_try(); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-adding a call to php_hash_environment()
after this line prevents the crash (but is likely not a good fix).
So, with fresh eyes this morning, things look a bit clearer. When request globals are reset, we need to leave them in an uninitialized (undef) state because request shutdown will unconditionally call dtors. So I've cleaned up that logic into a routine, which is called for worker request shutdown, and in the "unclean shutdown" case, just in case, should the routine be entered twice for some reason, nothing bad will happen. We should not apply anything to symbol table, it won't work as we want it too anyway; There may be symbols in the table which themselves hold references to super globals, and we don't want to recursively apply() to the symbol table. In any case we don't need too; if user code retains a ref to a super global (it must be at least rc=2), and we have destroyed the track vars ref, normal ref counting still works for the symbol in the user code, ie. we only have to take care of track vars. |
This works on Mac too now! Thank you very much for your time. |
Fix assertion error introduced in #76
I was not able to reproduce on (intel) mac running the normal suite, do I need to do something special to reproduce, m1 maybe (I have one) ?
This looks like the correct thing to do anyway.