Could not decompress text from MUD: -5

Posted by Fiendish on Mon 06 Jun 2011 08:28 PM — 13 posts, 36,858 views.

USA Global Moderator #0
It appears that under certain circumstances, calls to inflate() are returning Z_BUF_ERROR, which then pops up an error dialog and terminates the connection with the server. But the zlib manual states that Z_BUF_ERROR is not a fatal error, and that inflate() can be called again with more input and more output space to continue decompressing.


if (iCompressResult < 0)
{
   OnConnectionDisconnect ();    // close the world
...


in doc.cpp needs to take this into account.
Australia Forum Administrator #1
How do you know you are getting Z_BUF_ERROR and not Z_DATA_ERROR?

[EDIT] Oops. I withdraw the question.
Amended on Mon 06 Jun 2011 09:45 PM by Nick Gammon
USA Global Moderator #2
Nick Gammon said:

How do you know you are getting Z_BUF_ERROR and not Z_DATA_ERROR?

Oops. I withdraw the question.

*grin*
Australia Forum Administrator #3
Well I think I fixed it. See if you think this is OK:

https://github.com/nickgammon/mushclient/commit/bf9c23b
USA Global Moderator #4
It's difficult for me to say without spending a lot more time looking at the code, because I don't actually know how this problem occurs in the first place. I am surprised at the new second loop, though, since it's already inside of a

// decompress until something stops us (like the big goat)
while (true)

I was kind of expecting you to just re-up the buffer and continue instead of creating an inner loop.
Australia Forum Administrator #5
Well, then you have to bypass the other code that expects it to work, so 6 of one, half-a-dozen of the other I suppose. The loop really is because we don't know how much extra is enough.


And in case you are wondering:

Quote:

// decompress until something stops us (like the big goat)


http://en.wikipedia.org/wiki/List_of_races_and_species_in_The_Hitchhiker%27s_Guide_to_the_Galaxy

Search for "goat".


Quote:

... I don't actually know how this problem occurs in the first place ...


Now I look at it more closely, I'm a bit surprised it doesn't happen more often. As I read it, we are getting up to 999 (compressed) bytes from the packet at a time (perhaps packets are not normally that large). The decompression buffer is (was) 1024 bytes, and the inflate mode of Z_SYNC_FLUSH is the default whether you specify it or not. So a highly compressed packet would be quite likely to not fit.

I would have to guess that servers normally keep uncompressed packets fairly small (eg. under 1000 bytes) and thus they fit, after decompression, into 1024 bytes. For some reason this doesn't always happen. Maybe Lasher increased the maximum packet size in the sending routines.
Amended on Tue 07 Jun 2011 12:33 AM by Nick Gammon
USA Global Moderator #6
Quote:
And in case you are wondering...

Hahaha :)
USA Global Moderator #7
The same user who reported the "-5" decompression error is now getting:

Quote:
Could not decompress text from MUD: invalid stored block lengths


:\
Australia Forum Administrator #8
Sounds like a decompression error. I think it is fair to ask why this one user is getting these errors, and the other 99.9% are not?

Can you establish from them what they are doing around the time this happens? For example, playing with a script.

Template:summary

Please provide a summary of your world configuration:

  • Either use the scripting Immediate window (Ctrl+I) to execute: Debug ("summary")

    or

  • Install the Summary plugin (see "Summary" feature) and type "summary"

Then copy the resulting information from the output window, and paste into a Forum message.

You need version 4.55 onwards of MUSHclient to do this.



Do they have any "special" plugins, for example ones that modify incoming packets? Does the problem occur around a hotboot (or whatever Aardwolf calls it)?

I have noticed myself that sometimes when testing a script I can cause a decompression error, not quite sure why. Perhaps data is being injected into the incoming compressed text stream somehow.
USA Global Moderator #9
You have entered too much data - maximum is 6000 characters.
Australia Forum Administrator #10
Try again, I removed your post length restriction.
USA Global Moderator #11
Aside from my plugins, it looks like the other stuff is from Bast's package, and he says he doesn't modify any incoming packets.


-------------- MUSHclient summary --------------

MUSHclient version: 4.75
Compiled: Jun 12 2011.
Time now: Friday, June 17, 2011, 5:38 PM
Operating system: Windows Vista
Libraries: Lua 5.1.4, PCRE 8.12, PNG 1.5.2, SQLite3 3.7.6.3, Zlib 1.2.5
World name: 'Aardwolf', ID: e0eb198d8d5698e3b2f61483
-- Scripting --
Script language: Lua, enabled: yes
Scripting active: yes
Lua sandbox is 127 characters, DLL loading allowed: yes
Scripting prefix: '\\\'. External editor in use: NO.
Scripting for: 1810.727875 seconds.
-- Triggers, aliases, timers, variables --
** Triggers: 74 in world file, triggers enabled: yes. [Triggers]
   50 enabled, 29 regexp, 4658519 attempts, 25 matched, 6.158511 seconds.
** Aliases: 449 in world file, aliases enabled: yes. [Aliases]
   449 enabled, 442 regexp, 1230139 attempts, 26 matched, 1.495057 seconds.
** Timers: 0 in world file, timers enabled: yes.
   0 enabled, 0 fired.
   Timers checked every 0.1 seconds.
** Variables: 0.
-- MCCP --
MCCP active, took 0.306527 seconds to decompress
MCCP received 1268622 compressed bytes, decompressed to 24359977 bytes.
MCCP compression ratio was:    5.2% (lower is better)
-- Plugins (Processing order) --
ID: 3e7dedbe37e44942dd46d264, 'GMCP_handler', (Lua, 451.772 s) Enabled [Al Va Cb]
ID: 462b665ecb569efbf261422f, 'Miniwindow_Z_Order_Monitor', (Lua, 0.001 s) Enabled [Va Cb]
ID: c293f9e7f04dde889f65cb90, 'Aardwolf_Main_Layout', (Lua, 0.367 s) Enabled [Al Va Cb]
ID: b11c1b7fe961558d6f6aba5e, 'Aardwolf_Helper_Aliases', (Lua, 0.000 s) Enabled [Al]
ID: ef4a86dbc9cd4dd6f4c69386, 'Aardwolf_Statmon', (Lua, 92.248 s) Enabled [Va Cb]
ID: f178e68512c685b3be1e9b07, 'Aardwolf_Group_Monitor', (Lua, 244.146 s) Enabled [Al Va Cb]
ID: ef4a86dbc9cd4dd6f4c69385, 'Aardwolf_Health_Bars', (Lua, 13.489 s) Enabled [Va Cb]
ID: b6eae87ccedd84f510b74714, 'Aardwolf_GMCP_Mapper', (Lua, 36.030 s) Enabled [Tr Al Ti Va Cb]
ID: 04d9e64f835452b045b427a7, 'Copy_Colour_Output', (Lua, 0.002 s) Enabled [Al]
ID: 3f498d929793c12cb70fb59e, 'Aardwolf_Ascii_Mapper', (Lua, 28.643 s) Enabled [Tr Va Cb]
ID: e50b1d08a0cfc0ee9c44947b, 'Aardwolf_Tick_Timer', (Lua, 2.042 s) Enabled [Ti Va Cb]
ID: 60840c9013c7cc57777ae0ac, 'Aardwolf_BigMap_Graphical', (Lua, 1.149 s) Enabled [Tr Al Va Cb]
ID: abc1a0944ae4af7586ce88dc, 'Repaint_Buffer', (Lua, 407.503 s) Enabled [Cb]
ID: 9f796334ab9ed476ef44f1dc, 'Aardwolf_New_Connection', (Lua, 0.006 s) Enabled [Va Cb]
ID: 162bba4a5ecef2bb32b5652f, 'Aardwolf_Package_Update_Checker', (Lua, 0.682 s) Enabled [Al Cb]
ID: aaa72f3b5453567e2bba9d50, 'xBroadcast_SpellSkills', (Lua, 40.388 s) Enabled [Tr Al Va Cb]
ID: e8520531407cb4281bea544e, 'PluginFunctions', (Lua, 0.927 s) Enabled [Al Va Cb]
ID: aaaf0c555a44169e0f1d9674, 'bast_spellup', (Lua, 30.194 s) Enabled [Al Va Cb]
ID: a8f5b1a3b1373cd99d6bfb47, 'StatMonitor', (Lua, 1.682 s) Enabled [Al Ti Va Cb]
ID: aaa2beeda10fa11787c6b438, 'xBroadcast_Area', (Lua, 0.827 s) Enabled [Tr Al Va Cb]
ID: aaa66f81c50828bbbfda7100, 'xBroadcast_CP', (Lua, 2.915 s) Enabled [Tr Al Ti Va Cb]
ID: aaafc15678afa22343c5a327, 'xBroadcast_Double', (Lua, 1.845 s) Enabled [Tr Al Ti Va Cb]
ID: aaa77f81c5408278ccda7100, 'xBroadcast_GQ', (Lua, 2.735 s) Enabled [Tr Al Va Cb]
ID: aaa61c4570508448e19c7c14, 'xBroadcast_Kills', (Lua, 113.027 s) Enabled [Tr Al Va Cb]
ID: aaa0ab9ed92f8fc614664bd1, 'xBroadcast_Level', (Lua, 30.532 s) Enabled [Tr Al Va Cb]
ID: aaa8a9eda20fa11787c6b438, 'xBroadcast_Quest', (Lua, 9.339 s) Enabled [Al Ti Va Cb]
ID: eeed33165bd63fe12e148e5d, 'miniwin_double', (Lua, 1.810 s) Enabled [Al Va Cb]
ID: eee4b4fa021c1bee534ef093, 'miniwin_events', (Lua, 11.340 s) Enabled [Tr Al Va Cb]
ID: eee9913955ee86427355ad5e, 'miniwin_moonbot', (Lua, 10.189 s) Enabled [Tr Al Va Cb]
ID: eeef0c555a44169e0f1d9674, 'miniwin_spellup', (Lua, 30.561 s) Enabled [Al Ti Va Cb]
ID: eee96e233d11e6910f1d9e8e, 'miniwin_tabwin', (Lua, 10.840 s) Enabled [Al Va Cb]
ID: c4510331407cb4281bea544e, 'Aardwolf_Planes_Mobs', (Lua, 0.843 s) Enabled [Al Va Cb]
ID: a7a2f5a3b1373cd99d6bfb47, 'xBastmush_Update_Checker', (Lua, 1.579 s) Enabled [Al Va Cb]
ID: a749d26f1cb3e00282727e55, 'StatDB', (Lua, 154.151 s) Enabled [Al Ti Va Cb]
ID: aaa7dc9ed92ffc6146964abc, 'xBroadcast_Inventory', (Lua, 1.206 s) Enabled [Tr Al Va Cb]
ID: aaa65ac8122d795ad5348dcd, 'xBroadcast_Noexp', (Lua, 0.813 s) Enabled [Tr Al Va Cb]
ID: aaaf9a8dc92f8fc614663ac0, 'xBroadcast_Whois', (Lua, 1.165 s) Enabled [Tr Al Va Cb]
ID: 900f47ba035b9a912dae0a39, 'Items', (Lua, 0.000 s) Enabled [Tr Al Va]
ID: e5ba9d8d543592b7ae80926b, 'Aardwolf_cphunterLUA', (Lua, 0.001 s) Enabled [Tr Al Va Cb]
ID: b555825a4a5700c35fa80780, 'Aardwolf_Chat_Capture_Miniwindow', (Lua, 64.537 s) Enabled [Tr Al Va Cb]
ID: 33b7d8bfb9765e35e60ea086, 'QReporter', (Lua, 0.007 s) Enabled [Tr Al Va Cb]
ID: db6e9ed958c05658b5d7d5ea, 'Tetris', (Lua, 9.119 s) Enabled [Cb]
ID: 520bc4f29806f7af0017985f, 'Hyperlink_URL2', (Lua, 0.006 s) Enabled [Tr]
ID: 71a90acddb14f784437b8b80, 'Summary', (Lua, 0.000 s) Enabled [Al]
** Plugins: 44 loaded, 44 enabled.
-- Comms --
Connect phase: 8 (Open). NAWS wanted: NO
Received: 1270490 bytes (1240 Kb)
Sent: 69652 bytes (68 Kb)
Received 12508 packets, sent 3299 packets.
Total lines received: 70027
This connection: Sent 3188 lines, received 94512 lines.
Telnet (IAC) received: DO: 3, DONT: 0, WILL: 6, WONT: 1, SB: 19747 [Telnet]
-- MXP --
MXP active: NO, Pueblo mode: NO, Activated: On command
MXP tags received: 0
MXP entities received: 0
MXP errors: 0
-- Commands --
Commands in command history: 556
Speed walking enabled: NO. Speed walking prefix: #
Command stacking enabled: yes. Command stack character: ';'
Accelerators defined: 5 [Accelerators]
-- Miniwindows --
Window: '      c293f9e7f04dde889f65cb90text_background', at (194,2,961,811), shown: yes
        width: 767, height: 809, position: 12, hotspots: 0, fonts: 0, images: 1
Window: '      c293f9e7f04dde889f65cb90txtdragger', at (193,0,719,10), shown: yes
        width: 526, height: 10, position: 0, hotspots: 1, fonts: 0, images: 0
Window: '      c293f9e7f04dde889f65cb90txtresize', at (946,796,961,811), shown: yes
        width: 15, height: 15, position: 0, hotspots: 1, fonts: 0, images: 0
Window: '3f498d929793c12cb70fb59e', at (0,0,193,242), shown: yes
        width: 193, height: 242, position: 0, hotspots: 3, fonts: 2, images: 0
Window: '60840c9013c7cc57777ae0ac_offscreen_buffer', at (0,0,0,0), shown: NO
        width: 420, height: 105, position: 0, hotspots: 0, fonts: 0, images: 1
Window: 'a7a2f5a3b1373cd99d6bfb47-Update', at (0,0,0,0), shown: NO
        width: 0, height: 0, position: 0, hotspots: 0, fonts: 2, images: 0
Window: 'b555825a4a5700c35fa80780', at (918,350,1275,499), shown: yes
        width: 357, height: 149, position: 0, hotspots: 6, fonts: 2, images: 0
Window: 'b6eae87ccedd84f510b74714_mapper', at (918,22,1263,368), shown: yes
        width: 345, height: 346, position: 0, hotspots: 66, fonts: 3, images: 12
Window: 'b6eae87ccedd84f510b74714_z_config_win', at (0,0,0,0), shown: NO
        width: 0, height: 0, position: 0, hotspots: 0, fonts: 2, images: 0
Window: 'db6e9ed958c05658b5d7d5ea', at (1042,629,1216,913), shown: yes
        width: 174, height: 284, position: 0, hotspots: 1, fonts: 2, images: 0
Window: 'eee4b4fa021c1bee534ef093-Events', at (837,35,1265,371), shown: yes
        width: 428, height: 336, position: 0, hotspots: 10, fonts: 5, images: 0
Window: 'eee96e233d11e6910f1d9e8e-tabwin', at (917,512,1026,614), shown: yes
        width: 109, height: 102, position: 0, hotspots: 9, fonts: 4, images: 0
Window: 'eee9913955ee86427355ad5e-Moons', at (0,0,0,0), shown: NO
        width: 491, height: 89, position: 0, hotspots: 4, fonts: 5, images: 0
Window: 'eeed33165bd63fe12e148e5d-Double', at (1161,384,1259,429), shown: NO
        width: 98, height: 45, position: 7, hotspots: 4, fonts: 5, images: 0
Window: 'eeef0c555a44169e0f1d9674-SpellUp', at (1067,520,1243,579), shown: yes
        width: 176, height: 59, position: 0, hotspots: 20, fonts: 5, images: 0
Window: 'ef4a86dbc9cd4dd6f4c69385', at (193,0,1260,24), shown: yes
        width: 1067, height: 24, position: 0, hotspots: 7, fonts: 1, images: 0
Window: 'ef4a86dbc9cd4dd6f4c69386', at (0,301,191,619), shown: yes
        width: 191, height: 318, position: 0, hotspots: 2, fonts: 1, images: 0
Window: 'f178e68512c685b3be1e9b07', at (0,615,192,1115), shown: yes
        width: 192, height: 500, position: 0, hotspots: 32, fonts: 2, images: 0
Window: 'z_a749d26f1cb3e00282727e55-StatDB_help', at (0,0,0,0), shown: NO
        width: 982, height: 590, position: 12, hotspots: 22, fonts: 6, images: 0
Window: 'z_a7a2f5a3b1373cd99d6bfb47-xBastmush_Update_Checker_help', at (0,0,0,0), shown: NO
        width: 618, height: 530, position: 12, hotspots: 19, fonts: 6, images: 0
Window: 'z_a8f5b1a3b1373cd99d6bfb47-StatMonitor_help', at (0,0,0,0), shown: NO
        width: 625, height: 530, position: 12, hotspots: 18, fonts: 6, images: 0
Window: 'z_aaa0ab9ed92f8fc614664bd1-xBroadcast_Level_help', at (0,0,0,0), shown: NO
        width: 499, height: 515, position: 12, hotspots: 17, fonts: 6, images: 0
Window: 'z_aaa2beeda10fa11787c6b438-xBroadcast_Area_help', at (0,0,0,0), shown: NO
        width: 499, height: 515, position: 12, hotspots: 17, fonts: 6, images: 0
Window: 'z_aaa61c4570508448e19c7c14-xBroadcast_Kills_help', at (0,0,0,0), shown: NO
        width: 499, height: 515, position: 12, hotspots: 17, fonts: 6, images: 0
Window: 'z_aaa65ac8122d795ad5348dcd-xBroadcast_Noexp_help', at (0,0,0,0), shown: NO
        width: 499, height: 515, position: 12, hotspots: 17, fonts: 6, images: 0
Window: 'z_aaa66f81c50828bbbfda7100-xBroadcast_CP_help', at (0,0,0,0), shown: NO
        width: 513, height: 515, position: 12, hotspots: 17, fonts: 6, images: 0
Window: 'z_aaa72f3b5453567e2bba9d50-xBroadcast_SpellSkills_help', at (0,0,0,0), shown: NO
        width: 548, height: 530, position: 12, hotspots: 18, fonts: 6, images: 0
Window: 'z_aaa77f81c5408278ccda7100-xBroadcast_GQ_help', at (0,0,0,0), shown: NO
        width: 513, height: 515, position: 12, hotspots: 17, fonts: 6, images: 0
Window: 'z_aaa7dc9ed92ffc6146964abc-xBroadcast_Inventory_help', at (0,0,0,0), shown: NO
        width: 499, height: 515, position: 12, hotspots: 17, fonts: 6, images: 0
Window: 'z_aaa8a9eda20fa11787c6b438-xBroadcast_Quest_help', at (0,0,0,0), shown: NO
        width: 513, height: 515, position: 12, hotspots: 17, fonts: 6, images: 0
Window: 'z_aaaf0c555a44169e0f1d9674-bast_spellup_help', at (0,0,0,0), shown: NO
        width: 949, height: 634, position: 12, hotspots: 38, fonts: 6, images: 0
Window: 'z_aaaf9a8dc92f8fc614663ac0-xBroadcast_Whois_help', at (0,0,0,0), shown: NO
        width: 499, height: 515, position: 12, hotspots: 17, fonts: 6, images: 0
Window: 'z_aaafc15678afa22343c5a327-xBroadcast_Double_help', at (0,0,0,0), shown: NO
        width: 499, height: 515, position: 12, hotspots: 17, fonts: 6, images: 0
Window: 'z_c4510331407cb4281bea544e-Aardwolf_Planes_Mobs_help', at (0,0,0,0), shown: NO
        width: 499, height: 530, position: 12, hotspots: 18, fonts: 6, images: 0
Window: 'z_e8520531407cb4281bea544e-PluginFunctions_help', at (0,0,0,0), shown: NO
        width: 884, height: 620, position: 12, hotspots: 24, fonts: 6, images: 0
Window: 'z_eee4b4fa021c1bee534ef093-miniwin_events_help', at (0,0,0,0), shown: NO
        width: 499, height: 515, position: 12, hotspots: 18, fonts: 6, images: 0
Window: 'z_eee96e233d11e6910f1d9e8e-miniwin_tabwin_help', at (0,0,0,0), shown: NO
        width: 499, height: 515, position: 12, hotspots: 18, fonts: 6, images: 0
Window: 'z_eee9913955ee86427355ad5e-miniwin_moonbot_help', at (0,0,0,0), shown: NO
        width: 499, height: 590, position: 12, hotspots: 23, fonts: 6, images: 0
Window: 'z_eeed33165bd63fe12e148e5d-miniwin_double_help', at (0,0,0,0), shown: NO
        width: 499, height: 515, position: 12, hotspots: 18, fonts: 6, images: 0
Window: 'z_eeef0c555a44169e0f1d9674-miniwin_spellup_help', at (0,0,0,0), shown: NO
        width: 499, height: 530, position: 12, hotspots: 19, fonts: 6, images: 0
Window: '~~~~~~3f498d929793c12cb70fb59e:info', at (321,25,724,380), shown: NO
        width: 403, height: 355, position: 4, hotspots: 0, fonts: 2, images: 0
** Miniwindows: 41 loaded, 13 shown.
-- Output window --
Output pixels: width 1259, height: 813, font width: 6, font height: 17
               can show 209 characters, wrapping at column 126, height 47 lines.
Output buffer: 66427 of 500000 lines.
-- Miscellaneous --
Logging: NO, tracing: NO
** SQLite3 databases: 0
Sound buffers in use: 0

---------------------- End summary ----------------------

Amended on Sat 18 Jun 2011 01:14 AM by Nick Gammon
Australia Forum Administrator #12
Hmm, well that looks OK.

I've tried a "torture test" by changing the zLib buffer size, both to a very small size (like 100 bytes) and a larger size (like 2000 bytes) and in no case can I reproduce this.

I don't know what to suggest, except that if this particular player is getting zLib errors, to configure the output window tab to disable compression.

It is not as if we are getting reports about this from many people.