-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Many segment faults in multi-exec #960
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
Comments
@yushengery, could you test on the latest commit from php7 brunch? |
@yatsukhnenko |
@yatsukhnenko |
@yushengery, interesting... Could you show |
@yatsukhnenko , I guess it should be p z_keys[4] , is that right? |
@yushengery, I don't know exactly how it can happens and can't reproduce this bug.
|
I did hmget hmset mget in the multi pipeline contex |
redis_hmget_cmd
It seems like we allocate some number of elements, but not all of them are valid string/long so we skip them
But further we use all allocated elements without reordering
|
@yatsukhnenko |
This issue should be caused by the reason I mentioned, I changed the persistence connection the short connection , there is not any coredump more. |
Greetings ,
I am using multi(pipeline) a lot , however I found a lot of coredump in the PHP-fpm redis.so
OS: Amazon Linux AMI release 2016.03 64Bit
PHP: 7.0.9
phpredis git commit : a224ed3
coredump info:
[root@ip-172-31-0-147 ~]# gdb /usr/local/php-7.0.9/sbin/php-fpm /data/coredump/core.php-fpm.11.1474621822.20576
GNU gdb (GDB) Amazon Linux (7.6.1-64.33.amzn1)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-amazon-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /usr/local/php-7.0.9/sbin/php-fpm...done.
[New LWP 20576]
Missing separate debuginfo for /usr/lib64/libpq.so.5
Try: yum --enablerepo='debug' install /usr/lib/debug/.build-id/bc/283b2d932e2d4651c4235ba91dd47e921b7d58.debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Missing separate debuginfo for /usr/lib64/libstdc++.so.6
Try: yum --enablerepo='debug' install /usr/lib/debug/.build-id/0a/90c35d3174805453ea67a785446d628e298b59.debug
Missing separate debuginfo for /lib64/libgcc_s.so.1
Try: yum --enablerepo='debug' install /usr/lib/debug/.build-id/00/fa2883fb47b1327397bbf167c52f51a723d013.debug
Core was generated by `php-fpm: pool php7 '.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f9985061949 in redis_mbulk_reply_assoc (execute_data=0x7f998ba136e0, return_value=0x7f998ba136b0, redis_sock=0x7f998ba5e240, z_tab=0x7ffd2a57b3c0, ctx=0x7f998ba6b380)
1924 add_assoc_stringl_ex(&z_multi_result, Z_STRVAL(z_keys[i]), Z_STRLEN(z_keys[i]), response, response_len);
Missing separate debuginfos, use: debuginfo-install cyrus-sasl-lib-2.1.23-13.16.amzn1.x86_64 glibc-2.17-106.167.amzn1.x86_64 keyutils-libs-1.5.8-3.12.amzn1.x86_64 krb5-libs-1.13.2-12.40.amzn1.x86_64 libcom_err-1.42.12-4.40.amzn1.x86_64 libcurl-7.40.0-8.58.amzn1.x86_64 libidn-1.18-2.8.amzn1.x86_64 libmcrypt-2.5.8-9.1.2.amzn1.x86_64 libselinux-2.1.10-3.22.amzn1.x86_64 libssh2-1.4.2-2.13.amzn1.x86_64 libxml2-2.9.1-6.3.49.amzn1.x86_64 nspr-4.11.0-1.37.amzn1.x86_64 nss-3.21.0-9.76.amzn1.x86_64 nss-softokn-freebl-3.16.2.3-14.2.38.amzn1.x86_64 nss-util-3.21.0-2.2.50.amzn1.x86_64 openldap-2.4.40-7.28.amzn1.x86_64 openssl-1.0.1k-14.91.amzn1.x86_64 xz-libs-5.1.2-12alpha.12.amzn1.x86_64 zlib-1.2.8-7.18.amzn1.x86_64
(gdb) bt
#0 0x00007f9985061949 in redis_mbulk_reply_assoc (execute_data=0x7f998ba136e0, return_value=0x7f998ba136b0, redis_sock=0x7f998ba5e240, z_tab=0x7ffd2a57b3c0, ctx=0x7f998ba6b380)
#1 0x00007f998503d450 in fold_this_item (execute_data=0x7f998ba136e0, return_value=0x7f998ba136b0, item=0x31130f0, redis_sock=0x7f998ba5e240, z_tab=0x7ffd2a57b3c0)
#2 0x00007f998503d4af in redis_sock_read_multibulk_multi_reply_loop (execute_data=0x7f998ba136e0, return_value=0x7f998ba136b0, redis_sock=0x7f998ba5e240, z_tab=0x7ffd2a57b3c0,
#3 0x00007f998503ccdd in redis_sock_read_multibulk_pipeline_reply (execute_data=0x7f998ba136e0, return_value=0x7f998ba136b0, redis_sock=0x7f998ba5e240)
#4 0x00007f998503d319 in zim_Redis_exec (execute_data=0x7f998ba136e0, return_value=0x7f998ba136b0) at /usr/local/soft/php-7.0.9/ext/phpredis/redis.c:2439
#5 0x0000000000857dab in ZEND_DO_FCALL_SPEC_HANDLER () at /usr/local/soft/php-7.0.9/Zend/zend_vm_execute.h:842
#6 0x000000000081a2eb in execute_ex (ex=) at /usr/local/soft/php-7.0.9/Zend/zend_vm_execute.h:414
#7 0x00000000008635f7 in zend_execute (op_array=0x7f998ba6b000, op_array@entry=0x7f9980d8a8d8, return_value=return_value@entry=0x7f998ba135b0)
#8 0x00000000007ddf34 in zend_execute_scripts (type=type@entry=8, retval=0x7f998ba135b0, retval@entry=0x0, file_count=file_count@entry=3)
#9 0x0000000000782850 in php_execute_script (primary_file=primary_file@entry=0x7ffd2a57d910) at /usr/local/soft/php-7.0.9/main/main.c:2494
#10 0x000000000044055c in main (argc=, argv=) at /usr/local/soft/php-7.0.9/sapi/fpm/fpm/fpm_main.c:1968
(gdb) l
1919 if(response != NULL) {
1920 zval z;
1921 if(redis_unserialize(redis_sock, response, response_len, &z) == 1) {
1922 add_assoc_zval_ex(&z_multi_result, Z_STRVAL(z_keys[i]), Z_STRLEN(z_keys[i]), &z);
1923 } else {
1924 add_assoc_stringl_ex(&z_multi_result, Z_STRVAL(z_keys[i]), Z_STRLEN(z_keys[i]), response, response_len);
1925 }
1926 efree(response);
1927 } else {
1928 add_assoc_bool_ex(&z_multi_result, Z_STRVAL(z_keys[i]), Z_STRLEN(z_keys[i]), 0);
(gdb) p numElems
$8 = 38
(gdb) p i
$9 = 13
(gdb) p z
$10 = {value = {lval = 140297449616832, dval = 6.931615005481985e-310, counted = 0x7f998ba5b5c0, str = 0x7f998ba5b5c0, arr = 0x7f998ba5b5c0, obj = 0x7f998ba5b5c0,
res = 0x7f998ba5b5c0, ref = 0x7f998ba5b5c0, ast = 0x7f998ba5b5c0, zv = 0x7f998ba5b5c0, ptr = 0x7f998ba5b5c0, ce = 0x7f998ba5b5c0, func = 0x7f998ba5b5c0, ww = {w1 = 2342892992,
w2 = 32665}}, u1 = {v = {type = 120 'x', type_flags = 26 '\032', const_flags = 161 '\241', reserved = 139 '\213'}, type_info = 2342591096}, u2 = {var_flags = 32665,
next = 32665, cache_slot = 32665, lineno = 32665, num_args = 32665, fe_pos = 32665, fe_iter_idx = 32665}}
(gdb) p z_keys[i]
$11 = {value = {lval = 140295106723846, dval = 6.9314992511883585e-310, counted = 0x7f9900000006, str = 0x7f9900000006, arr = 0x7f9900000006, obj = 0x7f9900000006,
res = 0x7f9900000006, ref = 0x7f9900000006, ast = 0x7f9900000006, zv = 0x7f9900000006, ptr = 0x7f9900000006, ce = 0x7f9900000006, func = 0x7f9900000006, ww = {w1 = 6,
w2 = 32665}}, u1 = {v = {type = 0 '\000', type_flags = 0 '\000', const_flags = 0 '\000', reserved = 0 '\000'}, type_info = 0}, u2 = {var_flags = 32665, next = 32665,
cache_slot = 32665, lineno = 32665, num_args = 32665, fe_pos = 32665, fe_iter_idx = 32665}}
(gdb) p response
$12 = 0x7f998ba01060 "0"
(gdb) p response_len
$13 = 1
(gdb) info args
execute_data = 0x7f998ba136e0
return_value = 0x7f998ba136b0
redis_sock = 0x7f998ba5e240
z_tab = 0x7ffd2a57b3c0
ctx = 0x7f998ba6b380
(gdb) info registers
rax 0x7f9900000006 140295106723846
rbx 0x7f998ba136e0 140297449322208
rcx 0x7ffd2a57ae80 140725313842816
rdx 0xd0 208
rsi 0x7f998ba01060 140297449246816
rdi 0x1 1
rbp 0x7ffd2a57b300 0x7ffd2a57b300
rsp 0x7ffd2a57ae50 0x7ffd2a57ae50
r8 0x7f998f35b060 140297509384288
r9 0x7f9985635a4c 140297344604748
r10 0x1 1
r11 0x7f998f120730 140297507047216
r12 0x1 1
r13 0x1114f60 17911648
r14 0x7f998ba135b0 140297449321904
r15 0x7f9980d8a8d8 140297268406488
rip 0x7f9985061949 0x7f9985061949 <redis_mbulk_reply_assoc+568>
eflags 0x10206 [ PF IF RF ]
cs 0x33 51
ss 0x2b 43
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0
(gdb) p z_keys
$14 = (zval *) 0x7f998ba6b380
(gdb) p z_keys@38
$15 = {0x7f998ba6b380, 0xd03105670, 0x7ffd2a57b340, 0x7f998503d450 <fold_this_item+73>, 0xffff8002d5a84c71, 0x7ffd2a57b3c0, 0x7f998ba5e240, 0x31130f0, 0x7f998ba136b0, 0x7f998ba136e0,
0x7ffd2a57b390, 0x7f998503d4af <redis_sock_read_multibulk_multi_reply_loop+93>, 0xc, 0x0, 0x7ffd2a57b3c0, 0x7f998ba5e240, 0x7f998ba136b0, 0x7f998ba136e0, 0x31130f0, 0x31130f0,
0x7ffd2a57b400, 0x7f998503ccdd <redis_sock_read_multibulk_pipeline_reply+67>, 0x7f998ba136e0, 0x7f998ba5e240, 0x7f998ba136b0, 0x7f998ba136e0, 0x7f998ba82818, 0x1c07,
0x7f998ba136e0, 0x7f998ba136e0, 0x7ffd2a57b460, 0x1, 0x1114f60 <executor_globals>, 0x7f998ba135b0, 0x7ffd2a57b460, 0x7f998503d319 <zim_Redis_exec+770>, 0x7f998ba136b0,
0x7f998ba136e0}
(gdb) p numElems
$16 = 38
The text was updated successfully, but these errors were encountered: