Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

struct.error: unpack_from requires a buffer of at least 80 bytes #701

Closed
ichorid opened this issue Mar 13, 2020 · 4 comments
Closed

struct.error: unpack_from requires a buffer of at least 80 bytes #701

ichorid opened this issue Mar 13, 2020 · 4 comments
Labels
priority: high Bugs, broken functionality or critical features

Comments

@ichorid
Copy link
Contributor

ichorid commented Mar 13, 2020

Latest Tribler devel just after starting:

[PID:24757] 2020-03-13 17:30:46,432 - ERROR <community:334> DiscoveryCommunity.on_packet(): Exception occurred while handling packet!
Traceback (most recent call last):
  File "/home/tribler/src/pyipv8/ipv8/messaging/serialization.py", line 314, in unpack_multiple
    unpacked, unpacked_size = self.unpack(format, data, current_offset)
  File "/home/tribler/src/pyipv8/ipv8/messaging/serialization.py", line 291, in unpack
    return self._packers[format].unpack_from(data, offset)
  File "/home/tribler/src/pyipv8/ipv8/messaging/serialization.py", line 155, in unpack_from
    out, = unpack_from('>%ds' % length, data, offset + self.format_size)
struct.error: unpack_from requires a buffer of at least 80 bytes

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tribler/src/pyipv8/ipv8/messaging/serialization.py", line 341, in unpack_to_serializables
    serializable.optional_format_list, offset)
  File "/home/tribler/src/pyipv8/ipv8/messaging/serialization.py", line 321, in unpack_multiple
    type(e).__name__, str(e))) from e
ipv8.messaging.serialization.PackError: Could not pack item 1: varlenHx20
error: unpack_from requires a buffer of at least 80 bytes

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tribler/src/pyipv8/ipv8/community.py", line 329, in on_packet
    result = handler(source_address, data)
  File "/home/tribler/src/pyipv8/ipv8/lazy_community.py", line 33, in wrapper
    unpacked = self.serializer.ez_unpack_serializables(payloads, remainder[23:])
  File "/home/tribler/src/pyipv8/ipv8/messaging/serialization.py", line 360, in ez_unpack_serializables
    unpacked = self.unpack_to_serializables(serializables, data)
  File "/home/tribler/src/pyipv8/ipv8/messaging/serialization.py", line 344, in unpack_to_serializables
    type(e).__name__, str(e))) from e
ipv8.messaging.serialization.PackError: Failed to unserialize SimilarityResponsePayload
PackError: Could not pack item 1: varlenHx20
error: unpack_from requires a buffer of at least 80 bytes
@ichorid ichorid added the priority: high Bugs, broken functionality or critical features label Mar 13, 2020
@ichorid
Copy link
Contributor Author

ichorid commented Mar 13, 2020

@qstokkink , @egbertbouman , could someone comment on this?

@qstokkink
Copy link
Collaborator

Is this a crash or log output?

I know some people are playing with the wire format, so getting garbage in from the network is expected. Crashing on it is unacceptable though.

@ichorid
Copy link
Contributor Author

ichorid commented Mar 13, 2020

That's a log output.

@qstokkink
Copy link
Collaborator

That's fine then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high Bugs, broken functionality or critical features
Development

No branches or pull requests

2 participants