steelThread / redmon

A web interface for managing redis: cli, admin, and live monitoring
http://steelthread.github.com/redmon/
1.57k stars 127 forks source link

Crash if SLOWLOG Contains Non-Ascii Characters #49

Open dcartoon opened 11 years ago

dcartoon commented 11 years ago

This may be a bit of an edge-case for most people, but Redmon crashes if the results of SLOWLOG contain non-ascii characters. The occurred after using the MIGRATE command(since this does serialization + DUMP/RESTORE).

I'll see if I can submit a repro/bug fix later.

[13-04-27 00:02:41] !!! Redmon has shit the bed, restarting... "\x80" on US-ASCII [13-04-27 00:02:41] /var/lib/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/json/encoding.rb:123:in encode' [13-04-27 00:02:41] /var/lib/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/json/encoding.rb:123:inescape' [13-04-27 00:02:41] /var/lib/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/json/encoding.rb:69:in escape' [13-04-27 00:02:41] /var/lib/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/json/encoding.rb:171:inencode_json' [13-04-27 00:02:41] /var/lib/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/json/encoding.rb:48:in block in encode ' [13-04-27 00:02:41] /var/lib/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/json/encoding.rb:77:incheck_for_circu lar_references' [13-04-27 00:02:41] /var/lib/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/json/encoding.rb:46:in encode' [13-04-27 00:02:41] /var/lib/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/json/encoding.rb:246:inblock in encod.....

And here's a SLOWLOG entry that I think is reponsible:

9) 1) (integer) 61 2) (integer) 1367003879 3) (integer) 502592 4) 1) "RESTORE" 2) "[key]" 3) "470222651" 4) "\x03\x80\x00\x01\xb8\x9b\x18........ (3012027 more bytes)"