-
Notifications
You must be signed in to change notification settings - Fork 185
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
[WIP][RFC] Add a mini-guide for debugging packages and programs, to help with better issue reports #530
Open
ericonr
wants to merge
3
commits into
void-linux:master
Choose a base branch
from
ericonr:debug
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[WIP][RFC] Add a mini-guide for debugging packages and programs, to help with better issue reports #530
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Troubleshooting badly behaving apps | ||
|
||
Despite the best efforts of Void Linux maintainers, it is possible that you will | ||
have issues with packages from the official repositories. On such cases, there | ||
are some steps you can follow in order to provide as complete a bug report as | ||
possible. | ||
|
||
Some of these steps can even help you find the cause of the issue yourself! | ||
|
||
## Look at error messages attentively | ||
|
||
It is possible the program's output tells you why it errors out, so you can try | ||
to run it in a terminal. For example: | ||
|
||
- Python programs complain loudly about missing modules or resources. | ||
- If you're using a compiled binary, and it can't find the libraries it depends | ||
on, your dynamic linker will tell you about it. | ||
|
||
## Check for issues in the package database | ||
|
||
You can use the `-a` flag for | ||
[xbps-pkgdb(1)](https://man.voidlinux.org/xbps-pkgdb.1) to run a complete check | ||
on all systems packages, which can detect any files that may have been altered | ||
when they shouldn't have been. You should attempt to reinstall all the packages | ||
listed in this step, using the `-f` flag for | ||
[xbps-install(1)](https://man.voidlinux.org/xbps-install.1). For example: | ||
|
||
``` | ||
# xbps-pkgdb -a | ||
ERROR: p7zip: hash mismatch for /usr/bin/7z. | ||
ERROR: p7zip: files check FAILED. | ||
# xbps-install -f p7zip | ||
``` | ||
|
||
After this is done, you should check if the issue persists. | ||
|
||
## Strace the program | ||
|
||
If the issue is caused by a program, you can run it under the | ||
[strace(1)](https://man.voidlinux.org/strace.1) utility to check if it's trying, | ||
for example, to access files that don't exist but that it expects to exist. | ||
|
||
## Debug the program NEEDS WORK | ||
|
||
If a look at `strace` wasn't enough, it is possible to use a debugger like | ||
[gdb(1)](https://man.voidlinux.org/gdb.1) to step through the program's | ||
execution. You can [install debug packages](../xbps/repositories/index.md) or | ||
use Void's [Debuginfod](https://sourceware.org/elfutils/Debuginfod.html) server. | ||
To use the Debuginfod server, you need to export the `DEBUGINFOD_URLS` | ||
environment variable with a value of `https://debugingod.s.voidlinux.org` or | ||
`https://debuginfod.elfutils.org/`. | ||
|
||
GDB is especially useful when an application crashes abnormally, since it will | ||
stop execution at that point, and you can gather relevant information there. The | ||
syntax for using `gdb` is shown below, including the Debuginfod variable: | ||
|
||
``` | ||
$ DEBUGINFOD_URLS="https://debugingod.s.voidlinux.org" gdb --args <program> [arguments] | ||
``` | ||
|
||
Inside GDB, a usual session will run the following commands: | ||
|
||
- `run` to start the application; | ||
- `set logging on`, to create a `gdb.txt` file which can be shared easily; | ||
- `backtrace`, to show the function calls made until the application got to that | ||
place; | ||
- `quit`, to close `gdb`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.