Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Debug Symbols

Aperta
#666 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
docker, postgres
Ambito
database, devops

Direzione di ricerca

Iniziare dalla configurazione della build dell’immagine e ispezionare l’entry point di postgres usando file e readelf; esaminare l’approccio proposto configure CFLAGS e find-dbgsym-packages. Il lavoro è completato quando viene stabilito un modo supportato per consentire alle immagini di fornire simboli di debug utilizzabili, oppure viene documentato un workflow riproducibile per un’immagine derivata e i relativi compromessi in termini di image-size e flavor.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

question

Problem

The postgres binaries shipped with the docker images in this repo seem to be stripped:

root@0d42c3d8cd06:/# postgres --version
postgres (PostgreSQL) 12.1 (Debian 12.1-1.pgdg100+1)
root@0d42c3d8cd06:/# file $(which postgres)
/usr/lib/postgresql/12/bin/postgres: ELF 64-bit LSB shared object, x86-64, version 1
(SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux
3.2.0, BuildID[sha1]=e775eb7dcaa0306329f0624056df0fa892d48f03, stripped
-----------------------------------------------------------------^

This makes it difficult to use tools such as gdb or perf to debug problems as the resulting stack traces will often be useless.

See my tweet here for a practical example of what can be done when symbols are present.

Proposal

It'd be great if this image would start to ship with debug symbols by default, e.g. by compiling with ./configure CFLAGS="-fno-omit-frame-pointer -ggdb".

If not, it'd be great to document how to derive an image that includes symbols. My first attempts at doing so below have failed. I still get the same output for file $(which postgres) as above, and readelf -s $(which postgres) | wc -l gives me the same ~9k symbols contained in this image, rather than the ~30k symbols usually available for a non-stripped postgres binary.

FROM postgres
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
  debian-goodies \
  binutils
RUN apt-get install -y $(find-dbgsym-packages $(which postgres))

I suspect the image above doesn't work because postgres is pulled from apt.postgresql.org, but find-dbgsym-packages is not smart enough to search that repo for debug package, if those even exist.

I'd be happy to try to help with creating a PR to improve the debugging/symbol situation once the direction is clear.

From my PoV the only downside to including symbols is image size, so maybe they shouldn't go into the alpine flavor of this image.

Lingua principale
Shell
Stelle
2.5k
Fork
1.2k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di docker-library/postgres

Tutte le issue di docker-library/postgres

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.