-
Notifications
You must be signed in to change notification settings - Fork 50
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
Invalid pointer to free on import #423
Comments
Hi @stumpylog, It sounds like a library version conflict, you'd need to give more details about how you made the runtime. Can you make a dockerfile that reproduces this issue, for example? |
Since celery depends on a broker, like Redis, it's going to be hard to get a minimal example. I know this version was build from the sdist, against the libvips-dev provided by Bookworm, and libvips aka libvips42 is installed. Both are the same version: 8.14.1-3 |
I should also note, entering a shell in the container, importing and generating a thumbnail there works fine. If I move the import from the top of the file, to just the function used, that's also fine. |
Overriding the logging, I get this several times during container startup:
No logging from the worker itself, that I can tell |
You can have issues if you mix fork() and threads, could that be it? You need to not do any image processing outside the request handler. This should work:
And this as well:
But this will fail badly:
Though I'm a big vague about ngx, perhaps it uses persistent request handlers rather than forking each time? |
You could also try reordering your imports and see if that makes a difference. |
I don't think anything is mixing processes and threads. The application doesn't ever directly control those, it's up to gunicorn and celery I think. The processing isn't done from the request at all. It's packaged there and stored in Redis for the worker to get. At startup, there's 1 worker already up as a process. It's this process that dies with SIGABORT. Unfortunately, without being a celery developer, I don't know when or if this worker has done |
I've just found a slightly similar issue in rails caused by a clash between pdfium and libheif. Could that be it? What do you see for |
Hope it helps:
|
Thanks! But it's not pdfium :( |
I don't know if this will be helpful or not, but I was experiencing |
I'm investingating switching to libvips over convert for generating thumbnails from PDFs, using pyvips. However, when pyvips is imported into my celery worker, the worker dies with a signal 6 and a single log:
free(): invalid pointer
.This is simply from the import, it happens even after removing the code to read the PDF and make the thumbnail. I suspect this is something with the code being run inside a celery worker, though I'm not quite sure how that works.
The text was updated successfully, but these errors were encountered: