thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yuxuan Wang (Jira)" <>
Subject [jira] [Commented] (THRIFT-5322) Go compact_protocol allocating unreasonable buffer size
Date Thu, 10 Dec 2020 19:54:00 GMT


Yuxuan Wang commented on THRIFT-5322:

[~Shkuro] TProtocol doesn't have the knowledge of the actual message size. If the underlying
transport is actually framed (either TFramedTransport or framed THeaderTransport) then it
could be get there, but that's not always the case, and when it's framed it could be wrapped
by other TTransport to make it inaccessible.

I'll just follow java's and python's example of allowing manually set of the length limit
on the TProtocol implementations.

> Go compact_protocol allocating unreasonable buffer size
> -------------------------------------------------------
>                 Key: THRIFT-5322
>                 URL:
>             Project: Thrift
>          Issue Type: Bug
>          Components: Go - Library
>    Affects Versions: 0.13.0
>            Reporter: Juraci Paixão Kröhling
>            Assignee: Yuxuan Wang
>            Priority: Major
>         Attachments: main.go
> I don't yet know all the pieces to this puzzle, and it's quite possible that the problem
is on our side, but we use the Thrift Go library in the Jaeger Agent and we are seeing a case
where the memory consumption for a payload of 4k bytes to result in a buffer allocation in
the compact_protocol.go with unreasonable sizes. I found buffers of 1.4GiB while debugging
the issue.
> This is the code that we are seeing this memory usage:
> []
> Here's more information about this, including a reproducer and initial diagnostics:
> []
> As mentioned above, I'm still getting all the pieces together, but perhaps you've seen
this before or know what might be going on. What I know for sure at the moment is that this
happens on malformed payloads, but I would expect the library to have an upper limit on the
buffer size.

This message was sent by Atlassian Jira

View raw message