Project

General

Profile

Bug #746878

Decoding error

Added by Marko Lindqvist almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Category:
General
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Reported by meynaf at http://forum.freeciv.org/f/viewtopic.php?f=15&t=89967

Both the server and client remains operational, but the connection between them gets closed because of decoding error in client end.

bugtst.sav (885 KB) bugtst.sav Marko Lindqvist, 2018-04-13 03:01 PM
0001-Make-uncompressed-buffer-size-150-x-compressed-size.patch (1.27 KB) 0001-Make-uncompressed-buffer-size-150-x-compressed-size.patch Marko Lindqvist, 2018-04-13 03:26 PM

History

#1 Updated by Marko Lindqvist almost 2 years ago

  • Category set to General
  • Status changed from New to In Progress
  • Target version set to 2.5.12

uncompress() returns Z_BUF_ERR. It seems the buffer size for uncompressed output is too small. We currently set it to 100*compressed size before uncompression.

#3 Updated by Máximo Castañeda almost 2 years ago

Idle talking as the bug is fixed and I'm not up to writing a patch, but how about starting with a less extreme case that works most times and checking Z_BUF_ERROR to try again with a bigger buffer when there's not enough space? Would that complicate the code too much or be highly inefficient?

#4 Updated by Marko Lindqvist almost 2 years ago

Máximo Castañeda wrote:

how about starting with a less extreme case that works most times and checking Z_BUF_ERROR to try again with a bigger buffer when there's not enough space? Would that complicate the code too much or be highly inefficient?

That would be ideal, mainly because just increasing the max factor to 150 leaves us open to a possibility that it's still not enough for even better compressing sequence in the future. However, that does require someone to implement it, so I've planned to just open a new ticket about the rewrite and fix the current issue with the simple solution. I don't see urgency in getting the better implementation done as factor '100' has served us decades with just this one now reported case of failure.

#5 Updated by Marko Lindqvist almost 2 years ago

Marko Lindqvist wrote:

just open a new ticket about the rewrite

-> Feature #747319

#6 Updated by Marko Lindqvist almost 2 years ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF