-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Tests failing under Valgrind #14806
Comments
For union {
struct sockaddr common;
struct sockaddr_in in4;
#ifdef HAVE_IPV6
struct sockaddr_in6 in6;
#endif
} local_address;
int local_address_len = 0;
if (sa->sa_family == AF_INET) {
if (inet_pton(AF_INET, bindto, &local_address.in4.sin_addr) == 1) {
local_address_len = sizeof(struct sockaddr_in);
local_address.in4.sin_family = sa->sa_family;
local_address.in4.sin_port = htons(bindport);
memset(&(local_address.in4.sin_zero), 0, sizeof(local_address.in4.sin_zero));
}
}
#ifdef HAVE_IPV6
else { /* IPV6 */
if (inet_pton(AF_INET6, bindto, &local_address.in6.sin6_addr) == 1) {
local_address_len = sizeof(struct sockaddr_in6);
local_address.in6.sin6_family = sa->sa_family;
local_address.in6.sin6_port = htons(bindport);
}
}
#endif
#ifdef IP_BIND_ADDRESS_NO_PORT
{
int val = 1;
(void) setsockopt(sock, SOL_IP, IP_BIND_ADDRESS_NO_PORT, &val, sizeof(val));
}
#endif
if (local_address_len == 0) {
php_error_docref(NULL, E_WARNING, "Invalid IP Address: %s", bindto);
} else if (bind(sock, &local_address.common, local_address_len)) {
php_error_docref(NULL, E_WARNING, "Failed to bind to '%s:%d', system said: %s", bindto, bindport, strerror(errno));
} |
Fixes one issue in phpGH-14806.
@NattyNarwhal Yes that seems to be the most simple fix, just adding |
I can't reproduce the results for |
My configure command was:
Frustratingly, I don't have the test command as I was forced to reset my computer as it got very unresponsive and losing the terminal history/command. But I cannot reproduce them either now... |
Description
Some of our tests when run under Valgrind seem to be leaking because of mistakes within php-src.
I ran those tests while attempting to determine another issue, but those seem very unlikely related to my specific issue.
ext/standard/tests/network/bug74764.phpt
ext/standard/tests/strings/strtr_with_reference.phpt
Zend/tests/generators/errors/generator_extend_error.phpt
Zend/tests/weakrefs/weakrefs_004.phpt
PHP Version
master
Operating System
No response
The text was updated successfully, but these errors were encountered: