{"action":"opened","issue":{"url":"https://api.github.com/repos/msgpack/msgpack-php/issues/75","labels_url":"https://api.github.com/repos/msgpack/msgpack-php/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/msgpack/msgpack-php/issues/75/comments","events_url":"https://api.github.com/repos/msgpack/msgpack-php/issues/75/events","html_url":"https://github.com/msgpack/msgpack-php/issues/75","id":121030295,"number":75,"title":"PHP7 msgpack_unserialize_map_item illegal key type","user":{"login":"caleblloyd","id":2414837,"avatar_url":"https://avatars.githubusercontent.com/u/2414837?v=3","gravatar_id":"","url":"https://api.github.com/users/caleblloyd","html_url":"https://github.com/caleblloyd","followers_url":"https://api.github.com/users/caleblloyd/followers","following_url":"https://api.github.com/users/caleblloyd/following{/other_user}","gists_url":"https://api.github.com/users/caleblloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/caleblloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caleblloyd/subscriptions","organizations_url":"https://api.github.com/users/caleblloyd/orgs","repos_url":"https://api.github.com/users/caleblloyd/repos","events_url":"https://api.github.com/users/caleblloyd/events{/privacy}","received_events_url":"https://api.github.com/users/caleblloyd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-08T15:28:09Z","updated_at":"2015-12-08T15:28:09Z","closed_at":null,"body":"Hit this when unserilaizing an item.  PHP-FPM throws warning \"[msgpack (msgpack_unserialize_map_item) illegal key type\".  PHP CLI segfaults, backtrace is here:\r\n\r\n\t#0  i_zval_ptr_dtor (zval_ptr=zval_ptr@entry=0x7fe948a8af70)\r\n\t\tat /usr/local/php7/src/php-src/Zend/zend_variables.h:57\r\n\t57\t\t\tif (!Z_DELREF_P(zval_ptr)) {\r\n\tTraceback (most recent call last):\r\n\tFile \"/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py\", line 63, in <module>\r\n\t\tfrom libstdcxx.v6.printers import register_libstdcxx_printers\r\n\tImportError: No module named 'libstdcxx'\r\n\t(gdb) bt\r\n\t#0  i_zval_ptr_dtor (zval_ptr=zval_ptr@entry=0x7fe948a8af70)\r\n\t\tat /usr/local/php7/src/php-src/Zend/zend_variables.h:57\r\n\t#1  _zval_ptr_dtor (zval_ptr=zval_ptr@entry=0x7fe948a8af70)\r\n\t\tat /usr/local/php7/src/php-src/Zend/zend_execute_API.c:527\r\n\t#2  0x00007fe9485c2e70 in msgpack_unserialize_var_destroy (\r\n\t\tvar_hashx=var_hashx@entry=0x7ffcd8c0c3c0, err=err@entry=0 '\\000')\r\n\t\tat /usr/local/php7/src/msgpack-php/msgpack_unpack.c:301\r\n\t#3  0x00007fe9485be633 in php_msgpack_unserialize (\r\n\t\treturn_value=return_value@entry=0x7fe948a130d0, \r\n\t\tstr=0x7fe948a85018 \"\\222\\201\\257authAssignments\\215\\265company_administrator\\210\\300\\257CAuthAssignment\\266\", str_len=4315) at /usr/local/php7/src/msgpack-php/msgpack.c:238\r\n\t#4  0x00007fe9485be808 in zif_msgpack_unserialize (execute_data=<optimized out>, \r\n\t\treturn_value=0x7fe948a130d0) at /usr/local/php7/src/msgpack-php/msgpack.c:285\r\n\t#5  0x000000000089698d in ZEND_DO_ICALL_SPEC_HANDLER ()\r\n\t\tat /usr/local/php7/src/php-src/Zend/zend_vm_execute.h:586\r\n\t#6  0x0000000000888edb in execute_ex (ex=<optimized out>)\r\n\t\tat /usr/local/php7/src/php-src/Zend/zend_vm_execute.h:414\r\n\t#7  0x00000000008d1aa7 in zend_execute (op_array=0x7fe948a7c000, op_array@entry=0x7fe93da38990, \r\n\t\treturn_value=return_value@entry=0x7fe948a13030)\r\n\t\tat /usr/local/php7/src/php-src/Zend/zend_vm_execute.h:458\r\n\t#8  0x000000000084d9b4 in zend_execute_scripts (type=type@entry=8, retval=0x7fe948a13030, \r\n\t\tretval@entry=0x0, file_count=file_count@entry=3)\r\n\t---Type <return> to continue, or q <return> to quit---\r\n\t\tat /usr/local/php7/src/php-src/Zend/zend.c:1428\r\n\t#9  0x00000000007f1da8 in php_execute_script (primary_file=primary_file@entry=0x7ffcd8c18900)\r\n\t\tat /usr/local/php7/src/php-src/main/main.c:2471\r\n\t#10 0x00000000008d3673 in do_cli (argc=2, argv=0x1500770)\r\n\t\tat /usr/local/php7/src/php-src/sapi/cli/php_cli.c:974\r\n\t#11 0x000000000044cc50 in main (argc=2, argv=0x1500770)\r\n\t\tat /usr/local/php7/src/php-src/sapi/cli/php_cli.c:1345\r\n\r\nI noticed that in the function in question, msgpack_unserialize_var_destroy, the Master branch has some code commented out:\r\n\r\nhttps://github.com/msgpack/msgpack-php/blob/master/msgpack_unpack.c#L346\r\n\r\nBut on the PHP7 branch that code is not commented out:\r\n\r\nhttps://github.com/msgpack/msgpack-php/blob/php7/msgpack_unpack.c#L288\r\n\r\nI'd prefer to not post the packed code on GitHub, if you need it to debug though please email me caleblloyd on gmail."}}