"debug build" for at least one image

Open
#807 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
docker, python

Research direction

Start by reviewing how the slim-bullseye image is built and where its ./configure options and LDFLAGS are set. Check the proposed Python debug-build flags, GDB installation, and GDB extensions against the existing image process. Done means the project has a documented debug image or a clear maintainer-approved alternative for producing core dumps and backtraces.

Written by the indexing model from the issue text.

Description

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?

Dominant language
Dockerfile
Stars
2.8k
Forks
1.1k
Avg merge
3d 1h
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from docker-library/python

All issues in docker-library/python

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.