Skip to content
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

apport-retrace: Do not drop environment variables when calling GDB #147

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

bdrung
Copy link
Collaborator

@bdrung bdrung commented Mar 21, 2023

Running lay src in the GDB session opened by apport-retrace fails with:

(gdb) lay src
Cannot enable the TUI: error opening terminal [TERM=<unset>]

This is caused by calling gdb with a minimal environment that does not include TERM.

Keep the minimal environment for Report.add_gdb_info (for not translating the gdb output), but use the full environment when an interactive GDB session is started via apport-retrace.

Bug: https://launchpad.net/bugs/2012374

Running `lay src` in the GDB session opened by `apport-retrace` fails
with:

```
(gdb) lay src
Cannot enable the TUI: error opening terminal [TERM=<unset>]
```

This is caused by calling `gdb` with a minimal environment that does not
include `TERM`.

Keep the minimal environment for `Report.add_gdb_info` (for not
translating the gdb output), but use the full environment when an
interactive GDB session is started via `apport-retrace`.

Bug: https://launchpad.net/bugs/2012374
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

Merging #147 (85bc71f) into main (22f4525) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #147      +/-   ##
==========================================
+ Coverage   81.95%   81.97%   +0.01%     
==========================================
  Files          87       87              
  Lines       18197    18198       +1     
==========================================
+ Hits        14914    14917       +3     
+ Misses       3283     3281       -2     
Impacted Files Coverage Δ
apport/report.py 85.05% <100.00%> (-0.09%) ⬇️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@bdrung bdrung requested a review from schopin-pro March 22, 2023 09:58
@schopin-pro schopin-pro merged commit 5069fec into canonical:main Mar 30, 2023
@bdrung bdrung deleted the fix-2012374 branch March 30, 2023 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants