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

"debug build" for at least one image #807

Open
gtoonstra opened this issue Mar 6, 2023 · 2 comments
Open

"debug build" for at least one image #807

gtoonstra opened this issue Mar 6, 2023 · 2 comments

Comments

@gtoonstra
Copy link

Recently we had a C extension for python failing in production in an environment that we do not own ourselves. The data in that environment was causing the issues. Because for that reason, it was complicated to reproduce it in different environments, we looked into running a debug version of python in that environment to understand where it was crashing, but that turned out quite complicated to do.

In the end I managed to home in on the data issues, set up data locally to reproduce it and build a debug version of the slim-bullseye image that I could use as a source for our application image. This allowed us to dump a core and investigate the back traces.

Would it be helpful to have at least one image that contains a debug build of python in this stack, so that it's easier for developers to switch to that image and do this analysis?

An image that adds these lines to .,/configure

--with-pydebug \ CFLAGS="-g -O0" \

and sets LDFLAGS="" instead of LDFLAGS="-Wl,--strip-all"; \ ,

installs gdb and gdb extensions (# enable GDB to load debugging data: https://github.com/docker-library/python/pull/701)

If that's not a good idea, could you let me know what you'd recommend otherwise as a better process?

@tianon
Copy link
Member

tianon commented Dec 18, 2023

Sorry for the delay. 🙇

The matrix of supported variants for this image is already pretty large (multiplied by base image combinations and supported architectures), and compiling Python from source is kind of heavy, so we're not super comfortable supporting even more variance. 😅

@Luiz-Monad
Copy link

Luiz-Monad commented Mar 2, 2024

It wasn't too hard to add the gtoonsta changes to a matrix of build and push it to DockerHub.

I've made this fork https://github.com/Luiz-Monad/docker-python/ with the changes Luiz-Monad@fe752b6

And this is the reason it wasn't a good idea. ( Luiz-Monad@af7b613 ) . Alpine didn't have the package for systemtap (aka dtrace), oh well.

An idea would be for the debug image to be only available for the latest platforms on x64 only, that would cut the amount of extra images. Also, when you have a problem its a good thing to just update the image to see if it solves itself before attempting to actually debug inside the container, or just fork the repository and add specifically the images you need.

You could at least have the option in the script for the debug so we can do that ourselves if we needed, but that would also be extra thing to maintain.

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

3 participants