Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_PylibMC_deserialize_native error on Arm (M1) with ubuntu 20.04/Python 2.7 when retrieving empty string value. #291

Open
BillRamsey-minted opened this issue Jun 27, 2024 · 1 comment

Comments

@BillRamsey-minted
Copy link

When setting a key as an empty string, I'm getting a core dump trying to retrieve the value. The error is:

>>> import pylibmc
>>> client = pylibmc.Client(["127.0.0.1"], binary=True, behaviors={"ketama": True})
>>> client.set("hi", "")
>>> client.get("hi")
python2.7: src/_pylibmcmodule.c:642: _PylibMC_deserialize_native: Assertion `value || value_str' failed.
Aborted

This happens on both Vagrant/Vmware Fusion and docker ubuntu 20.04 on my Apple M. This does not happen on x86.

The easiest way to reproduce is with Docker.

docker run -ti --rm ubuntu:20.04 /bin/bash

apt update
yes w | apt-get -y install python2-dev libmemcached-dev wget memcached build-essential libz-dev

wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
/bin/python2.7 get-pip.py

/etc/init.d/memcached start

pip install pylibmc==1.6.1

/bin/python2.7

>>> import pylibmc
>>> client = pylibmc.Client(["127.0.0.1"], binary=True, behaviors={"ketama": True})
>>> client.set("hi", "")
>>> client.get("hi")
python2.7: src/_pylibmcmodule.c:642: _PylibMC_deserialize_native: Assertion `value || value_str' failed.
Aborted

Really not sure where the root problem is here, or if its even a pylibmc issue. I've tried removing zlibc compression in the pip install, turning off binary. Super appreciate your work on this project, and if I'm in the wrong place, many apologies.

@BillRamsey-minted
Copy link
Author

also, libmemcached-tools seem able to read it.

apt install libmemcached-tools

root@290b31153a34:/# memccat --servers localhost:11211 hi

root@290b31153a34:/#

and non empty strings are fine.

root@290b31153a34:/# /bin/python2.7
Python 2.7.18 (default, Jan 31 2024, 16:23:13)
[GCC 9.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylibmc
>>> client = pylibmc.Client(["127.0.0.1"], binary=True, behaviors={"ketama": True})
>>> client.set("works", "yes")
True
>>> client.get("works")
'yes'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant