Skip to content
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

fix core dump when key wasn’t string. #23

Merged
merged 3 commits into from
Dec 26, 2023
Merged

fix core dump when key wasn’t string. #23

merged 3 commits into from
Dec 26, 2023

Conversation

netyum
Copy link
Contributor

@netyum netyum commented Dec 22, 2023

{"('sum', '数量')":256.0,"('mean', '数量')":4.1967213115}
array(2) {
  ["('sum', '数量')"]=>
  float(256)
  ["('mean', '数量')"]=>
  float(4.19672131147541)
}

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `php pandas.php'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000055ffb2b60273 in add_assoc_zval_ex ()
[Current thread is 1 (Thread 0x7fd7cacc9e00 (LWP 9483))]
(gdb) bt
#0  0x000055ffb2b60273 in add_assoc_zval_ex ()
#1  0x00007fd7ca6ce55f in dict2array (pv=0x7fd7add88b00, zv=0x7fd7caa142f0) at /home/ubuntu/phpy/src/bridge/core.cc:252
#2  0x00007fd7ca6d2057 in zim_PyCore_scalar (execute_data=<optimized out>, return_value=0x7fd7caa142f0) at /home/ubuntu/phpy/src/php/core.cc:160
#3  0x000055ffb2cb0b74 in execute_ex ()
#4  0x000055ffb2cca1d7 in zend_execute ()
#5  0x000055ffb2b56ae2 in zend_execute_scripts ()
#6  0x000055ffb2a875f2 in php_execute_script ()
#7  0x000055ffb2df6fd7 in do_cli ()
#8  0x000055ffb2df85a5 in main ()

@matyhtf
Copy link
Member

matyhtf commented Dec 25, 2023

@netyum 需要加一个 phpunit 测试

@netyum
Copy link
Contributor Author

netyum commented Dec 25, 2023

添加到了DictTest里

@matyhtf matyhtf merged commit 5177330 into swoole:main Dec 26, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants