Skip to content

Assertion failed in reader.cc line 198 #126

Closed

Description

@jhurliman

Looks like an assertion was thrown in hiredis but I'm not sure if it's a bug in hiredis or unexpected usage of the lib by node_redis so I'm filing here.

Assertion failed: (redisReaderFeed(r->reader, data, length) == REDIS_OK), function Feed, file ../reader.cc, line 198.
Abort trap

Activity

  1. mranney commented on Aug 10, 2011

    @mranney
    Contributor

    Do you have a way to reproduce this?

    @pietern any thoughts?

  2. pietern commented on Aug 10, 2011

    @pietern
    Contributor

    This is only possible on an OOM condition, or when the reader object was already in an erroneous state. When you catch an error related to a protocol error or something, a new instance of the reader should be created because hiredis can't fix a broken data stream. This is where redisReaderFeed returns REDIS_ERR and the assertion fails.

  3. jhurliman commented on Aug 10, 2011

    @jhurliman
    Author

    The latter is what happened here. There was a protocol error before the crash.

    John

    On Aug 10, 2011, at 7:36 AM, [email protected] wrote:

    This is only possible on an OOM condition, or when the reader object was already in an erroneous state. When you catch an error related to a protocol error or something, a new instance of the reader should be created because hiredis can't fix a broken data stream. This is where redisReaderFeed returns REDIS_ERR and the assertion fails.

    Reply to this email directly or view it on GitHub:
    #126 (comment)

  4. pietern commented on Aug 10, 2011

    @pietern
    Contributor

    Did this happen after normal use of node_redis/hiredis? Protocol errors are very rare (unless you connect to something different than Redis).

  5. jhurliman commented on Aug 10, 2011

    @jhurliman
    Author

    I filed a separate ticket showing example stack traces. The problem is after node_redis autoreconnects the queries will hang indefinitely except for the occasional protocol error. Then once in a while that will crash hiredis. So I think one bug is uncovering 2-3 others.

    John

    On Aug 10, 2011, at 9:39 AM, [email protected] wrote:

    Did this happen after normal use of node_redis/hiredis? Protocol errors are very rare (unless you connect to something different than Redis).

    Reply to this email directly or view it on GitHub:
    #126 (comment)

  6. jhurliman commented on Aug 10, 2011

    @jhurliman
    Author

    The other relevant piece here is that queries hang after auto-reconnect when connecting over a UNIX socket. I haven't tried over a TCP socket yet, I can do that today.

    On Aug 10, 2011, at 9:39 AM, pietern wrote:

    Did this happen after normal use of node_redis/hiredis? Protocol errors are very rare (unless you connect to something different than Redis).

    Reply to this email directly or view it on GitHub:
    #126 (comment)

  7. jhurliman commented on Aug 12, 2011

    @jhurliman
    Author

    I believe this was fixed with commit 3e95c55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions