Skip to content

Assertion `memcached_failed(rc)' failed #156

@christopheg

Description

@christopheg

Hi,

We might be hitting a bug here when using PHP to connect tot Memcached:

Nov 21 15:41:47 job0.myapplication.net application_service[2627697]: account_import (15242218): ./src/libmemcached/storage.cc:257: memcached_return_t memcached_send_ascii(Memcached*, memcached_instance_st*, const char*, size_t, const char*, size_t, time_t, uint32_t, uint64_t, bool, bool, memcached_storage_action_t): Assertion `memcached_failed(rc)' failed.
Dec 02 18:12:05 job0.myapplication.net application_service[1667523]: account_import (15860032): ./src/libmemcached/storage.cc:257: memcached_return_t memcached_send_ascii(Memcached*, memcached_instance_st*, const char*, size_t, const char*, size_t, time_t, uint32_t, uint64_t, bool, bool, memcached_storage_action_t): Assertion `memcached_failed(rc)' failed.
Dec 03 11:37:50 job0.myapplication.net application_service[1885508]: order_execute (15912452): ./src/libmemcached/storage.cc:257: memcached_return_t memcached_send_ascii(Memcached*, memcached_instance_st*, const char*, size_t, const char*, size_t, time_t, uint32_t, uint64_t, bool, bool, memcached_storage_action_t): Assertion `memcached_failed(rc)' failed.
Dec 03 13:14:59 job0.myapplication.net application_service[1924822]: order_execute (15944444): ./src/libmemcached/storage.cc:257: memcached_return_t memcached_send_ascii(Memcached*, memcached_instance_st*, const char*, size_t, const char*, size_t, time_t, uint32_t, uint64_t, bool, bool, memcached_storage_action_t): Assertion `memcached_failed(rc)' failed.
Dec 03 14:44:02 job0.myapplication.net application_service[1958669]: order_execute (15971006): ./src/libmemcached/storage.cc:257: memcached_return_t memcached_send_ascii(Memcached*, memcached_instance_st*, const char*, size_t, const char*, size_t, time_t, uint32_t, uint64_t, bool, bool, memcached_storage_action_t): Assertion `memcached_failed(rc)' failed.
Dec 03 18:12:40 job0.myapplication.net application_service[2037836]: order_execute (16030452): ./src/libmemcached/storage.cc:257: memcached_return_t memcached_send_ascii(Memcached*, memcached_instance_st*, const char*, size_t, const char*, size_t, time_t, uint32_t, uint64_t, bool, bool, memcached_storage_action_t): Assertion `memcached_failed(rc)' failed.

When looking in the code, this seems to be the line we are triggering:
https://github.com/awesomized/libmemcached/blame/v1.x/src/libmemcached/storage.cc#L257
which calls
https://github.com/awesomized/libmemcached/blob/v1.x/include/libmemcached-1.0/return.h#L24

Can somebody explain me the purpose of this? I don't understand why the library should do an 'assert' here.
It seems this line has been here for 14 years. Before this commit, this function would return 'rc':
https://github.com/awesomized/libmemcached/blame/v1.x/src/libmemcached/storage.cc#L257
For my understanding, this stops the code execution in rc is not within one define constants.

A similar issue was already opened before (#49) but I fail to understand how the proposed commit solved this issue.

Another user posted a similar problem: https://stackoverflow.com/questions/16067307/weird-memcached-issue-with-apache
One of the proposed solutions was to switch to binary protocol.

pylibmc seems to have an issue which looks similar: lericson/pylibmc#218
Also here, they think libmemcached should not trigger an abort.

Would it be able for someone to have a look at it?

Kind regards,
Christophe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions