Key: MSGPACK-63
URL: http://jira.msgpack.org/browse/MSGPACK-63
Project: MessagePack
Issue Type: Bug
Environment: PHP CLI/Apache, Debian Linux 64
Reporter: Nico Poggi
Assignee: FURUHASHI Sadayuki
Priority: Critical
Attachments: MSGPACK_44.txt
When performing:
msgpack_unserialize('string');
I get a segmentation fault, both when run from command-line (CLI) or from Apache, using the attached file content as 'string'.
I mark it as critical, as we cannot use msgpack in our production enviroment because of this error.
The attached file is the first 10KB of a 1.3MB serialized object in PHP, but reproduces the error. Contact to email for more testing or details.
Thanks,
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
INADA Naoki commented on MSGPACK-63:
------------------------------------
I tried your data with msgpack from git.
But I can't reproduce segfault.
BTW, I don't recommend to use serialize/unserialize. pack/unpack is simple, solid and language independent.
php > $data = file_get_contents('MSGPACK_44.txt');
php > $obj = msgpack_unserialize($data);
Warning: [msgpack] (php_msgpack_unserialize) Insufficient data for unserializing in php shell code on line 1
php > var_dump($obj);
array(7) {
[4902]=>
*RECURSION*
["ts_hgbgscns"]=>
string(1) "0"
[5003]=>
*RECURSION*
[5357]=>
*RECURSION*
[6729]=>
*RECURSION*
[7057]=>
*RECURSION*
[7177]=>
*RECURSION*
}
php >
> Segmentation fault on PHP msgpack_unserialize()
> -----------------------------------------------
>
> Key: MSGPACK-63
> URL: http://jira.msgpack.org/browse/MSGPACK-63
> Project: MessagePack
> Issue Type: Bug
> Environment: PHP CLI/Apache, Debian Linux 64
> Reporter: Nico Poggi
> Assignee: FURUHASHI Sadayuki
> Priority: Critical
> Labels: fault, php, segmentation, unserialize
Nico Poggi commented on MSGPACK-63:
-----------------------------------
Hi Inada, I have just emailed you the full serialized string. I will try now the _pack method to see what happens and report back. What would be the performance difference/final size between serialize and pack?
> Segmentation fault on PHP msgpack_unserialize()
> -----------------------------------------------
>
> Key: MSGPACK-63
> URL: http://jira.msgpack.org/browse/MSGPACK-63
> Project: MessagePack
> Issue Type: Bug
> Environment: PHP CLI/Apache, Debian Linux 64
> Reporter: Nico Poggi
> Assignee: FURUHASHI Sadayuki
> Priority: Critical
> Labels: fault, php, segmentation, unserialize
Nico Poggi commented on MSGPACK-63:
-----------------------------------
same with _unpack
> Segmentation fault on PHP msgpack_unserialize()
> -----------------------------------------------
>
> Key: MSGPACK-63
> URL: http://jira.msgpack.org/browse/MSGPACK-63
> Project: MessagePack
> Issue Type: Bug
> Environment: PHP CLI/Apache, Debian Linux 64
> Reporter: Nico Poggi
> Assignee: FURUHASHI Sadayuki
> Priority: Critical
> Labels: fault, php, segmentation, unserialize
INADA Naoki commented on MSGPACK-63:
------------------------------------
OK, I can reproduce segv with your data and fixed it.
Could you try newest version from git?
> Segmentation fault on PHP msgpack_unserialize()
> -----------------------------------------------
>
> Key: MSGPACK-63
> URL: http://jira.msgpack.org/browse/MSGPACK-63
> Project: MessagePack
> Issue Type: Bug
> Environment: PHP CLI/Apache, Debian Linux 64
> Reporter: Nico Poggi
> Assignee: FURUHASHI Sadayuki
> Priority: Critical
> Labels: fault, php, segmentation, unserialize
Nico Poggi commented on MSGPACK-63:
-----------------------------------
Works fine, thanks for the quick fix. Will continue to test the rest of our code once the server is updated, and reopen if we find anything. Still, what will be the difference between pack and unserialize in terms of performance and data size?
Thanks,
> Segmentation fault on PHP msgpack_unserialize()
> -----------------------------------------------
>
> Key: MSGPACK-63
> URL: http://jira.msgpack.org/browse/MSGPACK-63
> Project: MessagePack
> Issue Type: Bug
> Environment: PHP CLI/Apache, Debian Linux 64
> Reporter: Nico Poggi
> Assignee: FURUHASHI Sadayuki
> Priority: Critical
> Labels: fault, php, segmentation, unserialize
INADA Naoki commented on MSGPACK-63:
------------------------------------
I'm sorry about I said. msgpack_unpack is alias for msgpack_unserialize.
I thought about PHP_ONLY option.
> Segmentation fault on PHP msgpack_unserialize()
> -----------------------------------------------
>
> Key: MSGPACK-63
> URL: http://jira.msgpack.org/browse/MSGPACK-63
> Project: MessagePack
> Issue Type: Bug
> Environment: PHP CLI/Apache, Debian Linux 64
> Reporter: Nico Poggi
> Assignee: FURUHASHI Sadayuki
> Priority: Critical
> Labels: fault, php, segmentation, unserialize