Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-2500

sending random data crashes thrift(golang) service

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 0.9.1
    • Fix Version/s: 0.9.2
    • Component/s: Go - Library
    • Labels:

      Description

      Sending random data to a go thrift service causes it to crash with extreme prejudice.

      dd if=/dev/urandom count=1 | nc $host 9160

      ... produces ...

      throw: runtime: out of memory

      goroutine 8 [running]:
      git.apache.org/thrift.git/lib/go/thrift.(*TFramedTransport).readFrame(0xf8400b1020, 0x7fb7cd49eb00, 0xf84007f000, 0x40894d)
              /home/liming/go/src/nefs/thrift_util/go_test/src/git.apache.org/thrift.git/lib/go/thrift/framed_transport.go:118 +0x2bf
      git.apache.org/thrift.git/lib/go/thrift.(*TFramedTransport).Read(0xf8400b1020, 0xf8400b1072, 0x800000004, 0x26eb068, 0xf84005bc00, ...)
              /home/liming/go/src/nefs/thrift_util/go_test/src/git.apache.org/thrift.git/lib/go/thrift/framed_transport.go:77 +0xe2
      io.ReadAtLeast(0xf840062810, 0xf8400b1020, 0xf8400b1072, 0x800000004, 0x4, ...)
              /usr/lib/go/src/pkg/io/io.go:254 +0xc3
      io.ReadFull(0xf840062810, 0xf8400b1020, 0xf8400b1072, 0x800000004, 0xf8400b1020, ...)
              /usr/lib/go/src/pkg/io/io.go:273 +0x69
      git.apache.org/thrift.git/lib/go/thrift.(*TBinaryProtocol).readAll(0xf8400b1060, 0xf8400b1072, 0x800000004, 0x41513c, 0xf8400b1040, ...)
              /home/liming/go/src/nefs/thrift_util/go_test/src/git.apache.org/thrift.git/lib/go/thrift/binary_protocol.go:430 +0x5f
      git.apache.org/thrift.git/lib/go/thrift.(*TBinaryProtocol).ReadI32(0xf8400b1060, 0x0, 0x0, 0x0, 0x8, ...)
              /home/liming/go/src/nefs/thrift_util/go_test/src/git.apache.org/thrift.git/lib/go/thrift/binary_protocol.go:379 +0x66
      git.apache.org/thrift.git/lib/go/thrift.(*TBinaryProtocol).ReadMessageBegin(0xf8400b1060, 0x0, 0x0, 0x0, 0x0, ...)
              /home/liming/go/src/nefs/thrift_util/go_test/src/git.apache.org/thrift.git/lib/go/thrift/binary_protocol.go:222 +0x64
      tutorial.(*AddServiceProcessor).Process(0xf84005cb00, 0xf8400af000, 0xf8400b1060, 0xf8400af000, 0xf8400b1080, ...)
              /home/liming/go/src/nefs/thrift_util/go_test/src/tutorial/add_service.go:137 +0x5a
      thrift_util.(*TNefsServer).processRequest(0xf84005de80, 0xf84005f900, 0xf84005bae0, 0x0, 0x0, ...)
              /home/liming/go/src/nefs/thrift_util/go_test/src/thrift_util/nefs_server.go:212 +0x316
      thrift_util._func_001(0xf840074278, 0xf84006d8e0, 0x0, 0x0)
              /home/liming/go/src/nefs/thrift_util/go_test/src/thrift_util/nefs_server.go:182 +0x37
      created by thrift_util.(*TNefsServer).Serve
              /home/liming/go/src/nefs/thrift_util/go_test/src/thrift_util/nefs_server.go:186 +0x46e
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jensg Jens Geyer
                Reporter:
                hzliming2013 LiMing
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: