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

bug: fix core dump if the terminal is closed while bottom is open #1230

Merged
merged 2 commits into from
Jun 27, 2023

Conversation

ClementTsang
Copy link
Owner

Description

A description of the change, what it does, and why it was made. If relevant (such as any change that modifies the UI), please provide screenshots of the changes:

The cause was:

  • bottom thinks it's panicking if the terminal is closed.
  • The panic hook tried to print out to the terminal - but the terminal was closed! It would unwrap and thus panic even harder.
  • To solve this, we just make the panic hook calls not unwrap, since honestly if they fail it's whatever as far as I understand it.

Issue

If applicable, what issue does this address?

Closes: #1227

Testing

If relevant, please state how this was tested. All changes must be tested to work:

If this is a code change, please also indicate which platforms were tested:

  • Windows
  • macOS
  • Linux

Checklist

If relevant, ensure the following have been met:

  • Areas your change affects have been linted using rustfmt (cargo fmt)
  • The change has been tested and doesn't appear to cause any unintended breakage
  • Documentation has been added/updated if needed (README.md, help menu, doc pages, etc.)
  • The pull request passes the provided CI pipeline
  • There are no merge conflicts
  • If relevant, new tests were added (don't worry too much about coverage)

The cause was:

- bottom thinks it's panicking if the terminal is closed.
- The panic hook tried to print out to the terminal - but the terminal
  was closed! It would unwrap and thus panic even harder.
- To solve this, we just make the panic hook calls not unwrap, since
  honestly if they fail it's whatever as far as I understand it.
@ClementTsang ClementTsang changed the title bug: fix core dump if the terminal is closed bug: fix core dump if the terminal is closed while bottom is open Jun 27, 2023
@codecov
Copy link

codecov bot commented Jun 27, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (0902abf) 31.84% compared to head (dc3bcf2) 31.85%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1230   +/-   ##
=======================================
  Coverage   31.84%   31.85%           
=======================================
  Files          97       97           
  Lines       16581    16576    -5     
=======================================
  Hits         5281     5281           
+ Misses      11300    11295    -5     
Flag Coverage Δ
macos-12 33.44% <0.00%> (+0.01%) ⬆️
ubuntu-latest 33.44% <0.00%> (+0.01%) ⬆️
windows-2019 33.70% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/lib.rs 2.94% <0.00%> (+0.04%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ClementTsang ClementTsang merged commit aa191a9 into master Jun 27, 2023
@ClementTsang ClementTsang deleted the fix_dumped_core branch June 27, 2023 05:57
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.

Closing terminal with running btm leads to critical errors in system journal
1 participant