Thrift
  1. Thrift
  2. THRIFT-1538

Error during deserialization int64 on 32-bit architecture

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 0.2, 0.8
    • Fix Version/s: None
    • Component/s: PHP - Library
    • Environment:

      Ubuntu 10.04

      Description

      Value 5718813258875302619 deserialized as 5718813261021839359

      1. hello.php
        1 kB
        Dmitry Zolotarev
      2. thrift_test1.tar.bz2
        12 kB
        Dmitry Zolotarev

        Activity

        Hide
        Alexey Sviridov added a comment - - edited

        On 32-bit architecture, in php client, value 5718813258875302619 threated not as int64, but as float. Then this value wrongly converted to byte array before sended to net. Java server recieved value 5718813261021839359.

        Show
        Alexey Sviridov added a comment - - edited On 32-bit architecture, in php client, value 5718813258875302619 threated not as int64, but as float. Then this value wrongly converted to byte array before sended to net. Java server recieved value 5718813261021839359.
        Hide
        Dmitry Zolotarev added a comment -

        The tarball contains generated code by Thrift 0.8 and server implemented on Python.
        hello.php - client code
        This code shows described error.
        To server sent value 5718813258875302619, but server received value 5718813258875302912

        Show
        Dmitry Zolotarev added a comment - The tarball contains generated code by Thrift 0.8 and server implemented on Python. hello.php - client code This code shows described error. To server sent value 5718813258875302619, but server received value 5718813258875302912
        Hide
        Alexey Sviridov added a comment -

        Actually this is bug in thrift php code. There is wrong converting from float to int64 on 32-bit systems.

        Show
        Alexey Sviridov added a comment - Actually this is bug in thrift php code. There is wrong converting from float to int64 on 32-bit systems.
        Hide
        Roger Meier added a comment -

        do you have a patch? see http://thrift.apache.org/docs/HowToContribute

        Would be greate to have a better test/test.sh based on test/ThriftTest.thrift

        https://builds.apache.org/view/S-Z/view/Thrift/job/Thrift/lastSuccessfulBuild/artifact/thrift/test/test.log

        Show
        Roger Meier added a comment - do you have a patch? see http://thrift.apache.org/docs/HowToContribute Would be greate to have a better test/test.sh based on test/ThriftTest.thrift https://builds.apache.org/view/S-Z/view/Thrift/job/Thrift/lastSuccessfulBuild/artifact/thrift/test/test.log
        Hide
        Alexey Sviridov added a comment -

        @Roger
        Unfortunately we don't have enough time to make good patch right now. We partially fix thrift code to meet our needs at work. But we can give full explain of this error and way how to fix it. We planning release full patch some time later but it would be nice if this error will be fixed in 0.9

        Show
        Alexey Sviridov added a comment - @Roger Unfortunately we don't have enough time to make good patch right now. We partially fix thrift code to meet our needs at work. But we can give full explain of this error and way how to fix it. We planning release full patch some time later but it would be nice if this error will be fixed in 0.9

          People

          • Assignee:
            Unassigned
            Reporter:
            Dmitry Zolotarev
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Development