-
Notifications
You must be signed in to change notification settings - Fork 227
Segmentation fault when calling getbuffer() on Packer object #479
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
Comments
Thank you for report with snippets. But I can not reproduce it. |
Thank you for your reply. I was able to reproduce the bug using the following Debian Docker image. FROM python:3.9.5-slim-buster
RUN pip install --no-input msgpack==1.0.2
RUN echo "\
import msgpack\n\
\n\
def do_the_job():\n\
packer = msgpack.Packer(autoreset=False)\n\
packer.pack(1)\n\
return packer.getbuffer()\n\
\n\
bytes(do_the_job())\
" > script.py Can you try to reproduce the bug with the above setup? docker build . -t test-msgpack
docker run -it test-msgpack bash
python script.py |
Thank you, I can reproduce it now! I will investigate it in tomorrow. |
I got it. Memoryview object don't have reference to Packer. |
Great! Do you think it will be easy to fix in an upcoming release? |
It's not easy to fix. I can not release the fix anytime soon.
You shouldn't use the buffer after the Packer is released. It is unintended
usage.
2021年6月17日(木) 23:04 Thibaud Martinez ***@***.***>:
… Great! Do you think it will be easy to fix in an upcoming release?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#479 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABQXKBKC2YKCVDUSYJS4B3TTH6G5ANCNFSM46W57B6Q>
.
|
I think this can be fixed relatively easily. Replace
In particular,
So keeping a reference to the exporting object is exactly the use case for this field. |
The best way is implementing the buffer protocol. |
Oh wow... that's really convoluted. So you need to implement |
Hi there,
I'm trying to get the internal data of the Packer object in order to avoid unneeded copying, as documented here.
The code is as follow :
When running this snippet, I get the following error :
I am using Ubuntu 18.04.5 LTS together with msgpack 1.0.2.
Thanks in advance for your help and for your work on this package !
The text was updated successfully, but these errors were encountered: