-
Notifications
You must be signed in to change notification settings - Fork 7.8k
No ext/com-dotnet resources #14282
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
No ext/com-dotnet resources #14282
Conversation
@cmb69 In case you are interested in the resource to object migration of ext/com_dotnet |
Will this still land for 8.4? |
I don't really care about this, I mainly made this PR to help Máté further because he wasn't familiar with Windows. |
I'll have a look at this (probably tomorrow). |
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.
probably tomorrow
Oops.
I think that for these internal data structures, moving them away from resources has a downside: if for example a fatal error occurs during execution, then they won't be cleaned up now whereas they would've been cleaned up if they were resources.
Yeah, that is somewhat an issue, but sooner or later we need to rid resources anyway (https://wiki.php.net/rfc/resource_to_object_conversion); it seems to me the proper solution would keep track of the structures in a self made list.
But looking back at https://bugs.php.net/79332 (apparently nobody reported that issue for ~15years), and assuming that com_dotnet is rarely used nowadays, I think we can just merge this PR, and maybe add an item about a cleaner solution to the TODO list for 5.1:
php-src/ext/com_dotnet/com_persist.c
Lines 19 to 20 in 9b41c8b
* TODO: Magic __wakeup and __sleep handlers for serialization | |
* (can wait till 5.1) */ |
fc2872e
to
904dc63
Compare
Ok I rebased and updated the TODO list. |
I should have better marked my comment as irony. :) After all, this TODO comment is there for 20 years, and apparently nobody cared about it, so … But having an additional comment certainly won't hurt.
Indeed, that is an issue. And at least some tests require even software, which is often not available. For instance, I don't have Word, and neither has CI (and I'm not sure what's actually going on in CI; there are a couple of Zend tests which are supposed to fail, because they instantiate the com_array_proxy class, which doesn't really support this, and likely hit a segfault; unfortunately segfaults do no longer appear to be explicitly signalled by run-tests.php, although the code is still there).
I can try again with using the MS debug heap; a quick attempt yielded no issues, but that might have been a bogus attempt; I would need to actually check that this still works. ASan is likely of no help, and as far as I know, MSan is not available on Windows (neither VS nor clang toolchains). |
Doesn't break here either, but you never know ... I'll go ahead and merge it. We can add the list destruction later. |
Note: I think that for these internal data structures, moving them away from resources has a downside: if for example a fatal error occurs during execution, then they won't be cleaned up now whereas they would've been cleaned up if they were resources.
Also need to check if the refcount can be > 0 at the end of script execution.