You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Vitali Lovich (JIRA)" <ji...@apache.org> on 2012/11/21 12:15:58 UTC

[jira] [Created] (THRIFT-1758) bad_lexical_cast using TJSONProtocol

Vitali Lovich created THRIFT-1758:
-------------------------------------

             Summary: bad_lexical_cast using TJSONProtocol
                 Key: THRIFT-1758
                 URL: https://issues.apache.org/jira/browse/THRIFT-1758
             Project: Thrift
          Issue Type: Bug
          Components: C++ - Library
    Affects Versions: 0.9
         Environment: boost 1.52.0
iOS 6.0
iOS simulator 6.0
            Reporter: Vitali Lovich
            Priority: Critical


try{
    std::string str("-0.003024283066062361")
    double d = boost::lexical_cast<double>(str);
    // bad_lexical_cast is thrown
} catch (const boost::bad_lexical_cast& e) {
    std::cerr << e.what() << std::endl;
}

bad_lexical_cast is thrown.  This is a problem for TJSONProtocol which relies on lexical_cast handling this properly.

Looking through the code, it looks to have to do something with the compile-time precision.

defining BOOST_LCAST_NO_COMPILE_TIME_PRECISION appears to resolve this issue (although at the cost of performance).

this problem also doesn't appear to happen all the time with the same input data.  sometime's it's reproducible every time, other times it isn't.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (THRIFT-1758) bad_lexical_cast using TJSONProtocol

Posted by "Vitali Lovich (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13501873#comment-13501873 ] 

Vitali Lovich commented on THRIFT-1758:
---------------------------------------

does not throw an exception in the simulator which is i386.  so arm issue?
                
> bad_lexical_cast using TJSONProtocol
> ------------------------------------
>
>                 Key: THRIFT-1758
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1758
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9
>         Environment: boost 1.52.0
> iOS 6.0
>            Reporter: Vitali Lovich
>            Priority: Critical
>
> try{
>     std::string str("-0.003024283066062361")
>     double d = boost::lexical_cast<double>(str);
>     // bad_lexical_cast is thrown
> } catch (const boost::bad_lexical_cast& e) {
>     std::cerr << e.what() << std::endl;
> }
> bad_lexical_cast is thrown.  This is a problem for TJSONProtocol which relies on lexical_cast handling this properly.
> Looking through the code, it looks to have to do something with the compile-time precision.
> defining BOOST_LCAST_NO_COMPILE_TIME_PRECISION appears to resolve this issue (although at the cost of performance).
> this problem also doesn't appear to happen all the time with the same input data.  sometime's it's reproducible every time, other times it isn't.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (THRIFT-1758) bad_lexical_cast using TJSONProtocol

Posted by "Henrique Mendonca (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1758?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henrique Mendonca resolved THRIFT-1758.
---------------------------------------

    Resolution: Cannot Reproduce

Hi Vitali,
I cannot reproduce your exception on boost 1.43.0, neither on x86 nor on ARM, which boost version are you using?
I think the correct resolution here would be to throw an TApplication exception back to the client, please let's us know if you have a working patch.
Cheers,
Henrique
                
> bad_lexical_cast using TJSONProtocol
> ------------------------------------
>
>                 Key: THRIFT-1758
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1758
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9
>         Environment: boost 1.52.0
> iOS 6.0
>            Reporter: Vitali Lovich
>            Priority: Critical
>
> try{
>     std::string str("-0.003024283066062361");
>     double d = boost::lexical_cast<double>(str);
>     // bad_lexical_cast is thrown
> } catch (const boost::bad_lexical_cast& e) {
>     std::cerr << e.what() << std::endl;
> }
> bad_lexical_cast is thrown.  This is a problem for TJSONProtocol which relies on lexical_cast handling this properly.
> Looking through the code, it looks to have to do something with the compile-time precision.
> defining BOOST_LCAST_NO_COMPILE_TIME_PRECISION appears to resolve this issue (potentially at the cost of performance?).
> this problem also doesn't appear to happen all the time with the same input data.  sometime's it's reproducible every time, other times it isn't.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (THRIFT-1758) bad_lexical_cast using TJSONProtocol

Posted by "Vitali Lovich (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13504498#comment-13504498 ] 

Vitali Lovich commented on THRIFT-1758:
---------------------------------------

as I put in the environment, boost 1.52.  I had to put in a workaround that uses stdtod instead & haven't had any issues with that.

I'm also using llvm + libc++ compiled with c++11 support if that matters.  maybe it's a compile issue.
                
> bad_lexical_cast using TJSONProtocol
> ------------------------------------
>
>                 Key: THRIFT-1758
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1758
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9
>         Environment: boost 1.52.0
> iOS 6.0
>            Reporter: Vitali Lovich
>            Priority: Critical
>
> try{
>     std::string str("-0.003024283066062361");
>     double d = boost::lexical_cast<double>(str);
>     // bad_lexical_cast is thrown
> } catch (const boost::bad_lexical_cast& e) {
>     std::cerr << e.what() << std::endl;
> }
> bad_lexical_cast is thrown.  This is a problem for TJSONProtocol which relies on lexical_cast handling this properly.
> Looking through the code, it looks to have to do something with the compile-time precision.
> defining BOOST_LCAST_NO_COMPILE_TIME_PRECISION appears to resolve this issue (potentially at the cost of performance?).
> this problem also doesn't appear to happen all the time with the same input data.  sometime's it's reproducible every time, other times it isn't.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (THRIFT-1758) bad_lexical_cast using TJSONProtocol

Posted by "Vitali Lovich (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13502229#comment-13502229 ] 

Vitali Lovich commented on THRIFT-1758:
---------------------------------------

actually still seeing the issue even with BOOST_LCAST_NO_COMPILE_TIME_PRECISION defined.
                
> bad_lexical_cast using TJSONProtocol
> ------------------------------------
>
>                 Key: THRIFT-1758
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1758
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9
>         Environment: boost 1.52.0
> iOS 6.0
>            Reporter: Vitali Lovich
>            Priority: Critical
>
> try{
>     std::string str("-0.003024283066062361")
>     double d = boost::lexical_cast<double>(str);
>     // bad_lexical_cast is thrown
> } catch (const boost::bad_lexical_cast& e) {
>     std::cerr << e.what() << std::endl;
> }
> bad_lexical_cast is thrown.  This is a problem for TJSONProtocol which relies on lexical_cast handling this properly.
> Looking through the code, it looks to have to do something with the compile-time precision.
> defining BOOST_LCAST_NO_COMPILE_TIME_PRECISION appears to resolve this issue (potentially at the cost of performance?).
> this problem also doesn't appear to happen all the time with the same input data.  sometime's it's reproducible every time, other times it isn't.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (THRIFT-1758) bad_lexical_cast using TJSONProtocol

Posted by "Vitali Lovich (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1758?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vitali Lovich updated THRIFT-1758:
----------------------------------

    Environment: 
boost 1.52.0
iOS 6.0

  was:
boost 1.52.0
iOS 6.0
iOS simulator 6.0

    
> bad_lexical_cast using TJSONProtocol
> ------------------------------------
>
>                 Key: THRIFT-1758
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1758
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9
>         Environment: boost 1.52.0
> iOS 6.0
>            Reporter: Vitali Lovich
>            Priority: Critical
>
> try{
>     std::string str("-0.003024283066062361")
>     double d = boost::lexical_cast<double>(str);
>     // bad_lexical_cast is thrown
> } catch (const boost::bad_lexical_cast& e) {
>     std::cerr << e.what() << std::endl;
> }
> bad_lexical_cast is thrown.  This is a problem for TJSONProtocol which relies on lexical_cast handling this properly.
> Looking through the code, it looks to have to do something with the compile-time precision.
> defining BOOST_LCAST_NO_COMPILE_TIME_PRECISION appears to resolve this issue (although at the cost of performance).
> this problem also doesn't appear to happen all the time with the same input data.  sometime's it's reproducible every time, other times it isn't.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (THRIFT-1758) bad_lexical_cast using TJSONProtocol

Posted by "Henrique Mendonca (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1758?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henrique Mendonca closed THRIFT-1758.
-------------------------------------

    
> bad_lexical_cast using TJSONProtocol
> ------------------------------------
>
>                 Key: THRIFT-1758
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1758
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9
>         Environment: boost 1.52.0
> iOS 6.0
>            Reporter: Vitali Lovich
>            Priority: Critical
>
> try{
>     std::string str("-0.003024283066062361");
>     double d = boost::lexical_cast<double>(str);
>     // bad_lexical_cast is thrown
> } catch (const boost::bad_lexical_cast& e) {
>     std::cerr << e.what() << std::endl;
> }
> bad_lexical_cast is thrown.  This is a problem for TJSONProtocol which relies on lexical_cast handling this properly.
> Looking through the code, it looks to have to do something with the compile-time precision.
> defining BOOST_LCAST_NO_COMPILE_TIME_PRECISION appears to resolve this issue (potentially at the cost of performance?).
> this problem also doesn't appear to happen all the time with the same input data.  sometime's it's reproducible every time, other times it isn't.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (THRIFT-1758) bad_lexical_cast using TJSONProtocol

Posted by "Henrique Mendonca (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1758?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henrique Mendonca updated THRIFT-1758:
--------------------------------------

    Description: 
try{
    std::string str("-0.003024283066062361");
    double d = boost::lexical_cast<double>(str);
    // bad_lexical_cast is thrown
} catch (const boost::bad_lexical_cast& e) {
    std::cerr << e.what() << std::endl;
}

bad_lexical_cast is thrown.  This is a problem for TJSONProtocol which relies on lexical_cast handling this properly.

Looking through the code, it looks to have to do something with the compile-time precision.

defining BOOST_LCAST_NO_COMPILE_TIME_PRECISION appears to resolve this issue (potentially at the cost of performance?).

this problem also doesn't appear to happen all the time with the same input data.  sometime's it's reproducible every time, other times it isn't.

  was:
try{
    std::string str("-0.003024283066062361")
    double d = boost::lexical_cast<double>(str);
    // bad_lexical_cast is thrown
} catch (const boost::bad_lexical_cast& e) {
    std::cerr << e.what() << std::endl;
}

bad_lexical_cast is thrown.  This is a problem for TJSONProtocol which relies on lexical_cast handling this properly.

Looking through the code, it looks to have to do something with the compile-time precision.

defining BOOST_LCAST_NO_COMPILE_TIME_PRECISION appears to resolve this issue (potentially at the cost of performance?).

this problem also doesn't appear to happen all the time with the same input data.  sometime's it's reproducible every time, other times it isn't.

    
> bad_lexical_cast using TJSONProtocol
> ------------------------------------
>
>                 Key: THRIFT-1758
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1758
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9
>         Environment: boost 1.52.0
> iOS 6.0
>            Reporter: Vitali Lovich
>            Priority: Critical
>
> try{
>     std::string str("-0.003024283066062361");
>     double d = boost::lexical_cast<double>(str);
>     // bad_lexical_cast is thrown
> } catch (const boost::bad_lexical_cast& e) {
>     std::cerr << e.what() << std::endl;
> }
> bad_lexical_cast is thrown.  This is a problem for TJSONProtocol which relies on lexical_cast handling this properly.
> Looking through the code, it looks to have to do something with the compile-time precision.
> defining BOOST_LCAST_NO_COMPILE_TIME_PRECISION appears to resolve this issue (potentially at the cost of performance?).
> this problem also doesn't appear to happen all the time with the same input data.  sometime's it's reproducible every time, other times it isn't.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (THRIFT-1758) bad_lexical_cast using TJSONProtocol

Posted by "Vitali Lovich (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1758?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vitali Lovich updated THRIFT-1758:
----------------------------------

    Description: 
try{
    std::string str("-0.003024283066062361")
    double d = boost::lexical_cast<double>(str);
    // bad_lexical_cast is thrown
} catch (const boost::bad_lexical_cast& e) {
    std::cerr << e.what() << std::endl;
}

bad_lexical_cast is thrown.  This is a problem for TJSONProtocol which relies on lexical_cast handling this properly.

Looking through the code, it looks to have to do something with the compile-time precision.

defining BOOST_LCAST_NO_COMPILE_TIME_PRECISION appears to resolve this issue (potentially at the cost of performance?).

this problem also doesn't appear to happen all the time with the same input data.  sometime's it's reproducible every time, other times it isn't.

  was:
try{
    std::string str("-0.003024283066062361")
    double d = boost::lexical_cast<double>(str);
    // bad_lexical_cast is thrown
} catch (const boost::bad_lexical_cast& e) {
    std::cerr << e.what() << std::endl;
}

bad_lexical_cast is thrown.  This is a problem for TJSONProtocol which relies on lexical_cast handling this properly.

Looking through the code, it looks to have to do something with the compile-time precision.

defining BOOST_LCAST_NO_COMPILE_TIME_PRECISION appears to resolve this issue (although at the cost of performance).

this problem also doesn't appear to happen all the time with the same input data.  sometime's it's reproducible every time, other times it isn't.

    
> bad_lexical_cast using TJSONProtocol
> ------------------------------------
>
>                 Key: THRIFT-1758
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1758
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9
>         Environment: boost 1.52.0
> iOS 6.0
>            Reporter: Vitali Lovich
>            Priority: Critical
>
> try{
>     std::string str("-0.003024283066062361")
>     double d = boost::lexical_cast<double>(str);
>     // bad_lexical_cast is thrown
> } catch (const boost::bad_lexical_cast& e) {
>     std::cerr << e.what() << std::endl;
> }
> bad_lexical_cast is thrown.  This is a problem for TJSONProtocol which relies on lexical_cast handling this properly.
> Looking through the code, it looks to have to do something with the compile-time precision.
> defining BOOST_LCAST_NO_COMPILE_TIME_PRECISION appears to resolve this issue (potentially at the cost of performance?).
> this problem also doesn't appear to happen all the time with the same input data.  sometime's it's reproducible every time, other times it isn't.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira