Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Debug Symbols

Đang mở
#666 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
docker, postgres
Lĩnh vực
database, devops

Hướng nghiên cứu

Bắt đầu với cấu hình build image và kiểm tra entry point của postgres bằng file và readelf; xem xét phương pháp configure CFLAGS và find-dbgsym-packages được đề xuất. Được xem là hoàn tất khi thiết lập được một cách được hỗ trợ để các image cung cấp các debug symbol có thể sử dụng, hoặc ghi lại một workflow image dẫn xuất có thể tái lập cùng các đánh đổi về image-size và flavor của image đó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Shell
Star
2.5k
Fork
1.2k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của docker-library/postgres

Tất cả issue của docker-library/postgres

Issue tương tự

Thêm issue về Shell/Bash

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.