You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by nsuke <gi...@git.apache.org> on 2016/01/18 20:13:41 UTC

[GitHub] thrift pull request: THRIFT-3568 THeader server crashes on readSlo...

GitHub user nsuke opened a pull request:

    https://github.com/apache/thrift/pull/807

    THRIFT-3568 THeader server crashes on readSlow

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nsuke/thrift THRIFT-3568

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/807.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #807
    
----
commit 27a377ba1e2fa208643da0bd3fcd1483ae39ed9b
Author: Nobuaki Sukegawa <ns...@apache.org>
Date:   2016-01-18T19:12:45Z

    THRIFT-3568 THeader server crashes on readSlow

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3568 THeader server crashes on readSlo...

Posted by nsuke <gi...@git.apache.org>.
Github user nsuke commented on the pull request:

    https://github.com/apache/thrift/pull/807#issuecomment-174164904
  
    @andrewcox here you are.
    Critical flaw lies in `TFramedTransport::readSlow` -> `TFramedTransport::readFrame`.
    Where **THeaderTransport**::readFrame should have been called.
    Seems to be a simple transplant issue.
    
        __assert_fail () from /usr/lib/libc.so.6
        boost::shared_ptr<apache::thrift::transport::ttransport>::operator-> (this=0x7f8248001af8) at /usr/include/boost/smart_ptr/shared_ptr.hpp:693
        apache::thrift::transport::tframedtransport::readframe (this=0x7f8248001ad0) at src/thrift/transport/tbuffertransports.cpp:183
        apache::thrift::transport::tframedtransport::readslow (this=0x7f8248001ad0, buf=0x7f82517207d0 "\360\arq", len=4) rt/tbuffertransports.cpp:154
        apache::thrift::transport::theadertransport::readslow (this=0x7f8248001ad0, buf=0x7f82517207d0 "\360\arq", len=4) at src/thrift/transport/theadertransport.cpp:55
        apache::thrift::transport::tbufferbase::read (this=0x7f8248001ad0, buf=0x7f82517207d0 "\360\arq", len=4) thrift/transport/tbuffertransports.h:71
        apache::thrift::transport::readall<apache::thrift::transport::tbufferbase> (trans=..., buf=0x7f82517207d0 "\360\arq", len=4) thrift/transport/ttransport.h:41
        apache::thrift::transport::tbufferbase::readall (this=0x7f8248001ad0, buf=0x7f82517207d0 "\360\arq", len=4) thrift/transport/tbuffertransports.h:84
        apache::thrift::transport::theadertransport::readall (this=0x7f8248001ad0, buf=0x7f82517207d0 "\360\arq", len=4) at src/thrift/transport/theadertransport.cpp:46
        apache::thrift::protocol::tbinaryprotocolt<apache::thrift::transport::theadertransport, apache::thrift::protocol::tnetworkbigendian>::readi32 ( i32=@0x7f825172081c: 0) at ./src/thrift/protocol/tbinaryprotocol.tcc:373
        apache::thrift::protocol::tbinaryprotocolt<apache::thrift::transport::theadertransport, apache::thrift::protocol::tnetworkbigendian>::readmessagebegin ( name="", messagetype=@0x7f82517209fc: 32642, seqid=@0x7f82517209f8: 1207967376) at ./src/thrift/protocol/tbinaryprotocol.tcc:205
        apache::thrift::protocol::tvirtualprotocol<apache::thrift::protocol::tbinaryprotocolt<apache::thrift::transport::theadertransport, apache::thrift::protocol::tnetworkbigendian>, apache::thrift::protocol::tprotocoldefaults>::readmessagebegin_virt (this=0x7f8248001e40, name="", messagetype=@0x7f82517209fc: 32642, seqid=@0x7f82517209f8: 1207967376) col/tvirtualprotocol.h:403
        apache::thrift::protocol::tprotocol::readmessagebegin (this=0x7f8248001e40, name="", messagetype=@0x7f82517209fc: 32642, seqid=@0x7f82517209f8: 1207967376) thrift/protocol/tprotocol.h:431
        apache::thrift::protocol::theaderprotocol::readmessagebegin (this=0x7f8248001190, name="", messagetype=@0x7f82517209fc: 32642, seqid=@0x7f82517209f8: 1207967376) l/theaderprotocol.cpp:172
        apache::thrift::protocol::tvirtualprotocol<apache::thrift::protocol::theaderprotocol, apache::thrift::protocol::tprotocoldefaults>::readmessagebegin_virt ( name="", messagetype=@0x7f82517209fc: 32642, seqid=@0x7f82517209f8: 1207967376) at ../../lib/cpp/src/thrift/protocol/tvirtualprotocol.h:403
        apache::thrift::protocol::tprotocol::readmessagebegin (this=0x7f8248001190, name="", messagetype=@0x7f82517209fc: 32642, seqid=@0x7f82517209f8: 1207967376) thrift/protocol/tprotocol.h:431
        apache::thrift::tdispatchprocessor::process (this=0x270ce00, in=..., out=..., connectioncontext=0x0) at ../../lib/cpp/src/thrift/tdispatchprocessor.h:114
        apache::thrift::server::tconnectedclient::run (this=0x7f8248001210) at src/thrift/server/tconnectedclient.cpp:62
        apache::thrift::server::tsimpleserver::onclientconnected (this=0x270d920, pclient=...) at src/thrift/server/tsimpleserver.cpp:90
        apache::thrift::server::tserverframework::newlyconnectedclient (this=0x270d920, pclient=...) at src/thrift/server/tserverframework.cpp:222
        apache::thrift::server::tserverframework::serve (this=0x270d920) at src/thrift/server/tserverframework.cpp:164
        apache::thrift::server::tserver::run (this=0x270d920) at ../../lib/cpp/src/thrift/server/tserver.h:108
        apache::thrift::concurrency::pthreadthread::threadmain (arg=0x270db30) at src/thrift/concurrency/posixthreadfactory.cpp:208
        start_thread () from /usr/lib/libpthread.so.0
        clone () from /usr/lib/libc.so.6


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3568 THeader server crashes on readSlo...

Posted by andrewcox <gi...@git.apache.org>.
Github user andrewcox commented on the pull request:

    https://github.com/apache/thrift/pull/807#issuecomment-173754745
  
    One mitigating factor here is our "ThriftServer" class (our most used server) doesn't use "THeaderTransport" at all, it uses the "THeader" core.
    
    And then some of our servers that *do* use THeaderTransport do it through TAsyncChannel in a way that it ends up reading a buffer that already contains a full message, so it would never stall in the middle of a message.
    
    Still though, I believe at least some of our legacy servers still use THeaderTransport and synchronous I/O, and we've never seen this AFAICT. That's why I'd like to see the callstack.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3568 THeader server crashes on readSlo...

Posted by bufferoverflow <gi...@git.apache.org>.
Github user bufferoverflow commented on the pull request:

    https://github.com/apache/thrift/pull/807#issuecomment-173733541
  
    +1 
    Thanks for the details, I've never used THeader...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3568 THeader server crashes on readSlo...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/thrift/pull/807


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3568 THeader server crashes on readSlo...

Posted by andrewcox <gi...@git.apache.org>.
Github user andrewcox commented on the pull request:

    https://github.com/apache/thrift/pull/807#issuecomment-173735565
  
    Could we get a callstack for the crash this was fixing?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3568 THeader server crashes on readSlo...

Posted by andrewcox <gi...@git.apache.org>.
Github user andrewcox commented on the pull request:

    https://github.com/apache/thrift/pull/807#issuecomment-173755016
  
    (I should clarify when I say "our" I'm talking about the fbthrift codebase)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3568 THeader server crashes on readSlo...

Posted by nsuke <gi...@git.apache.org>.
Github user nsuke commented on the pull request:

    https://github.com/apache/thrift/pull/807#issuecomment-172909649
  
    This bug causes server to SegFault whenever it has a client that is not writing for a while (like milliseconds).
    So basically the THeader is not functional at all without this patch.
    I don't think fbthrift THeader has such an obvious bug.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3568 THeader server crashes on readSlo...

Posted by bufferoverflow <gi...@git.apache.org>.
Github user bufferoverflow commented on the pull request:

    https://github.com/apache/thrift/pull/807#issuecomment-172632943
  
    @andrewcox similar issues at fb with this code?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---