Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

How to debug snappy: corrupt input? #73

Open
@xiaoxiaoHe-E

Description

@xiaoxiaoHe-E

Hi team, we met an error snappy: corrupt input while using snappy to compress through a TCP connection.

How we build the connection:

On the source side:

conn.reader = snappy.NewReader(io.Reader(net.Conn))
conn.writeCloser = snappy.NewBufferedWriter(io.WriteCloser(net.Conn))
conn.Write(buf)

On the destination side:

conn.reader = snappy.NewReader(io.Reader(net.Conn))
conn.writeCloser = snappy.NewBufferedWriter(io.WriteCloser(net.Conn))
conn.Read(buf)

We get the error snappy: corrupt input when conn.Read(buf). And this error happens intermittently.

Is this caused by network problem?

We read some snappy code, and we know that this error is reported because the checksum or the decode result length is wrong. But we use snappy based on a TCP connection and TCP can guarantee data integrity. So if snappy needs several network packages to decode the complete data? Or this is caused by some problem with the network card, the hardware cannot verify the data correctly.

Is this caused by memory problem?

I also find some discussions on the network that suspect this is caused by memory overflow or runtime memory limit not enough. But I cannot make sure. Since we don't get any other error messages.

I'd appreciate any help or suggestions on how to debug. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions