Skip to content

tests: create a tmp image that has coredumps enabled for testing #1754

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

Draft
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

samrose
Copy link
Collaborator

@samrose samrose commented Aug 12, 2025

these changes will NOT be merged into develop or promoted to production

The purpose of this draft pr is to create an image that has coredumps enabled per our internal playbook, for testing segfault issues. We will not merge this PR, or release the images created with it. It will be closed without merging when testing is completed.

these changes will NOT be merged into develop or promoted to production
  1. Removed the notify: update grub lines from the GRUB update tasks
  2. Added register variables to track if changes were made
  3. Added a conditional task to run update-grub only when changes occurred
  4. Removed the invalid handler definition at the end of the file
## Using GDB:
To analyze a coredump:
```
sudo gdb postmaster -c /pg_coredump_debug/<core_file>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to pass full path instead of just postmaster:

sudo gdb /nix/store/56va3gd07cakgapybcw4iq1irhx9lryx-postgresql-and-plugins-17_11/bin/.postgres-wrapped -c /pg_coredump_debug/core..postgres-wrapp.2150.1755075766

I'm not sure how properly can I find the path. One can try:

ls -lh /nix/store/*/bin/.postgres-wrapped
-r-xr-xr-x 3 root root 11M Jan  1  1970 /nix/store/56va3gd07cakgapybcw4iq1irhx9lryx-postgresql-and-plugins-17_11/bin/.postgres-wrapped

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can also find it in /var/lib/postgresql/.nix-profile/bin so there actually is already a conventional location (I just used the same "home" dir for the postgres user that infra team created before I did all the nix packaging, to make it easier for people to orient themselves who were already familiar with /var/lib/postgresql homedir)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my case I had to use the .postgres-wrapped file which isn't in /var/lib/postgresql/.nix-profile/bin. TBH not sure how it is related to the original postgres binary file.

@samrose
Copy link
Collaborator Author

samrose commented Aug 13, 2025

We'll end up converting this from ansible to a nix package configuration that can be installed/uninstalled this was just a short term measure/test to see if this would work

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

Successfully merging this pull request may close these issues.

2 participants