8000 Redis Cluster mget memory leak - V5.1.1 / PHP7.1.33 · Issue #1701 · phpredis/phpredis · GitHub
[go: up one dir, main page]

Skip to content

Redis Cluster mget memory leak - V5.1.1 / PHP7.1.33 #1701

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

Closed
sofire opened this issue Jan 14, 2020 · 3 comments
Closed

Redis Cluster mget memory leak - V5.1.1 / PHP7.1.33 #1701

sofire opened this issue Jan 14, 2020 · 3 comments
Assignees
Labels

Comments

@sofire
Copy link
sofire commented Jan 14, 2020

#0 0x0000000000977dd5 in zend_mm_find_leaks_small (p=0x7fa5afc00000, i=509, j=19, leak=0x7fff9cf9d4c0)
at /home/www/softwares/php-7.1.33/Zend/zend_alloc.c:1985
empty = 0
count = 0
bin_num = 20
dbg = 0x7fa5afe001e0

#1 0x0000000000977f3c in zend_mm_find_leaks (heap=0x7fa5b8a00040, p=0x7fa5afc00000, i=509, leak=0x7fff9cf9d4c0)
at /home/www/softwares/php-7.1.33/Zend/zend_alloc.c:2013
bin_num = 20
count = 0

#2 0x0000000000978413 in zend_mm_check_leaks (heap=0x7fa5b8a00040) at /home/www/softwares/php-7.1.33/Zend/zend_alloc.c:2117
bin_num = 5
dbg = 0x7fa5b8a5e6a0
list = 0x0
p = 0x7fa5b8a00000
leak = {addr = 0x7fa5b8a5e690, size = 16, filename = 0x7fa5b853f2c8 "/home/www/softwares/redis-5.1.1/redis_cluster.c", orig_filename = 0x0,
lineno = 1020, orig_lineno = 0}
repeated = 0
total = 0
i = 94
j = 35

#3 0x00000000009786ce in zend_mm_shutdown (heap=0x7fa5b8a00040, full=0, silent=0) at /home/www/softwares/php-7.1.33/Zend/zend_alloc.c:2182
p = 0x476fec <php_libxml_post_deactivate+167>
list = 0x7fff9cf9d710

#4 0x0000000000979446 in shutdown_memory_manager (silent=0, full_shutdown=0) at /home/www/softwares/php-7.1.33/Zend/zend_alloc.c:2607
No locals.

#5 0x000000000091db66 in php_request_shutdown (dummy=0x0) at /home/www/softwares/php-7.1.33/main/main.c:1925
__orig_bailout = 0x7fff9cf9d8d0
__bailout = {{__jmpbuf = {0, 5307750469741905538, 4391712, 140735827008704, 0, 0, 5307750469429429890, -5307542471060420990},
__mask_was_saved = 0, __saved_mask = {__val = {0, 0, 0, 0, 0, 0, 0, 0, 34359738368, 140349743833088, 140349743824960, 140349743833088, 140349743833136, 140735827007584, 9921893, 140735827007552}}}}
report_memleaks = 1 '\001'

#6 0x0000000000a9f111 in main (argc=1, argv=0x7fff9cf9dcc8) at /home/www/softwares/php-7.1.33/sapi/fpm/fpm/fpm_main.c:1994
primary_script = 0x7fa5b8a020f0 "p\303Ư\245\177"
__orig_bailout = 0x0
__bailout = {{__jmpbuf = {0, 5307750469844665986, 4391712, 140735827008704, 0, 0, 5307750469735614082, -5307542402033449342},
__mask_was_saved = 0, __saved_mask = {__val = {140349826666832, 4294967295, 140349770645592, 0, 140349770533904, 0, 140349826667688,
140735827007872, 140735827007856, 4131212846, 4298479, 4294967295, 140349826603456, 140349777666992, 140349826589896,
140735827008712}}}}
exit_status = 0
cgi = 0
c = -1
use_extended_info = 0
file_handle = {handle = {fd = 0, fp = 0x0, stream = {handle = 0x0, isatty = 8064, mmap = {len = 0, pos = 0, map = 0x0, buf = 0x0,
old_handle = 0x0, old_closer = 0x0}, reader = 0x0, fsizer = 0x0, closer = 0x0}}, filename = 0x7fa5b8a02000 "\360 \240\270\245\177",
opened_path = 0x0, type = ZEND_HANDLE_FILENAME, free_filename = 0 '\000'}
orig_optind = 1
orig_optarg = 0x0
ini_entries_len = 0
max_requests = 10000
requests = 5713
fcgi_fd = 12
request = 0x3128510
fpm_config = 0x0
fpm_prefix = 0x0
fpm_pid = 0x0
test_conf = 0
force_daemon = -1
force_stderr = 0
php_information = 0
php_allow_to_run_as_root = 0
func = "main"

redis_cluster.c

/* {{{ proto array RedisCluster::mget(array keys) */
PHP_METHOD(RedisCluster, mget) {
    zval *z_ret = emalloc(sizeof(*z_ret));   // line 1020 

    array_init(z_ret);

    // Parse args, process
    if (cluster_mkey_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, "MGET",
                        sizeof("MGET")-1, z_ret, cluster_mbulk_mget_resp) < 0)
    {
        zval_dtor(z_ret);
        efree(z_ret);
        RETURN_FALSE;
    }
}
@sofire
Copy link
Author
sofire commented Jan 14, 2020

php-fpm errors.

[14-Jan-2020 11:45:51] WARNING: [pool www] child 25872 said into stderr: "[Tue Jan 14 11:45:51 2020] Script: '-'"
[14-Jan-2020 11:45:51] WARNING: [pool www] child 25872 said into stderr: "/home/www/softwares/redis-5.1.1/redis_cluster.c(1020) : Freeing 0x00007fa5b8a5e690 (16 bytes), script=-"
[14-Jan-2020 11:45:51] WARNING: [pool www] child 25872 said into stderr: "Last leak repeated 3 times"
[14-Jan-2020 11:45:51] WARNING: [pool www] child 25872 said into stderr: "=== Total 4 memory leaks detected ==="

@michael-grunder
Copy link
Member

Thanks for the report, I can replicate the issue.

I'll take a proper look in the morning.

@michael-grunder
Copy link
Member

This is fixed in develop, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0