-
Notifications
You must be signed in to change notification settings - Fork 118
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
Segfault 5.5.6 #49
Comments
are you able to provide a small reproduce script? |
I am trying to ;). I have 5.5.5 and 5.5.6 compiled. Will update when I find a way to trigger it again. |
Enjoy :). |
In some cases I also get a message about bad msgpack structure. For example... ["item"=>["str" =>["x" => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"]]] gives: Warning: msgpack Parse error in Command line code on line 1 |
It's the str8, you added encode support in the last revision. This shaves a byte for strings < 256.
da (str16) to d9 (str8) So 0.5.5 compatibility is broken but also it should not really segfault either :(. When making such a change I really think it would be a good idea to attribute it to a less minor version component. That is, 5.5.6 should be 5.6.0. |
Hey @laruence when looking at implementing this I think I have two options. I need to add a conditional on https://github.com/msgpack/msgpack-php/blob/master/msgpack/pack_template.h#L733 I have two ideas on how I could accomplish this. Either way I have to edit this 'upstream' header file. (I would like to avoid this, but it seems like other implementations are doing the same thing?) I could either make msgpack_pack_user a struct that contains the zend_string and a boolean Also what do you think of the STD_PHP_INI_BOOLEAN name |
… implementation guidelines. When msgpack.use_str8_serialization is set to 0 str serialization will never serialize a string using str8
… implementation guidelines. When msgpack.use_str8_serialization is set to 0 str serialization will never serialize a string using str8
Hey! The msgpack spec calls for a compatibility mode so serialization doesn't create data that older deserializers can't handle. @joeyhub @mattheworiordan thanks. |
Program received signal SIGSEGV, Segmentation fault.
0x00000000006e51d9 in gc_zval_possible_root ()
(gdb) bt
#0 0x00000000006e51d9 in gc_zval_possible_root ()
#1 0x00000000006d3628 in zend_hash_destroy ()
#2 0x00000000006c482b in _zval_dtor_func ()
#3 0x00000000006b694a in _zval_ptr_dtor ()
#4 0x00007fffee000d8a in msgpack_unserialize_var_destroy (var_hashx=var_hashx@entry=0x7fffffff1170, err=err@entry=1 '\001')
#5 0x00007fffedffb54a in php_msgpack_unserialize (return_value=return_value@entry=0x7fffedb82178, str=, str_len=2363631)
#6 0x00007fffedffb66d in zif_msgpack_unserialize (ht=, return_value=0x7fffedb82178, return_value_ptr=,
#7 0x000000000076d471 in ?? ()
#8 0x00000000007272e7 in execute ()
#9 0x00000000006c714c in zend_execute_scripts ()
#10 0x0000000000666fd3 in php_execute_script ()
#11 0x000000000076fe03 in ?? ()
#12 0x0000000000431c8f in ?? ()
#13 0x00007ffff503eead in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#14 0x0000000000431d25 in _start ()
The text was updated successfully, but these errors were encountered: