-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Ignore memory leaks reported for some libc-client functions #6326
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
Conversation
At least on Windows, some static variables are lazily initialized during `mail_open()` and `mail_lsub()`, which are reported as memory leaks. We suppress these false positives.
BTW, is it sufficient to document that ext/imap is not thread-safe? |
Isn't this how other extensions deal with it? Or do they fail during configuration is the build is a ZTS build? |
Well, I think that most extensions are thread-safe. If there is no better solution, you can always deploy synchronization primitives to enforce thread-safety. I doubt that it's worth to bother with this regarding libc-client, though. |
Yeah I agree, we probably should attempt to get IMAP out of php-src as it's kinda on life-support from what I see. :-/ |
We do seem to have at least one extension that checks for ZTS in config.m4: Lines 34 to 37 in 12f33a3
|
Not sure if we should stop shipping ext/imap for ZTS on Windows in stable releases. I'll ask PHPonWindows team. |
@cmb69 Do you have any further info on the thread-safety issues? Were there any bugs reported with regard to that? |
I'm not aware of any reported bugs in this regard, but libc-client has a lot of global state which appear to be read and written without any guards, and apparently there is no
AIUI, that shouldn't be an issue, since the streams are not shared. However, the lazily initialized functions statics (which have been reported as mem-leaks) could likely cause issues (excerpt from c-client/ip_nt.c): static struct addrinfo *hints;
if (!hints) { /* hints set up yet? */
hints = (struct addrinfo *) /* one-time setup */
memset (fs_get (sizeof (struct addrinfo)),0,sizeof (struct addrinfo));
/* allow any address family */
hints->ai_family = AF_UNSPEC;
hints->ai_socktype = SOCK_STREAM;
/* need canonical name */
hints->ai_flags = AI_CANONNAME;
} |
Cf. <php/php-src#6326 (comment)>. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350865 c90b9560-bf6c-de11-be94-00142212c4b1
At least on Windows, some static variables are lazily initialized
during
mail_open()
andmail_lsub()
, which are reported as memoryleaks. We suppress these false positives.