Skip to content

Conversation

godlygeek
Copy link
Contributor

We can fail to find any frames even without libdw reporting an error, and in that case dwfl_errmsg can return a nullptr, which we cannot pass to the std::string constructor.

This fixes a

Engine error: basic_string::_S_construct null not valid

when unwinding has failed.

@godlygeek godlygeek self-assigned this Jun 7, 2023
@codecov-commenter
Copy link

Codecov Report

Patch coverage has no change and project coverage change: -0.15 ⚠️

Comparison is base (2d2fa4b) 90.34% compared to head (7334208) 90.19%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
- Coverage   90.34%   90.19%   -0.15%     
==========================================
  Files          47       47              
  Lines        5480     5489       +9     
  Branches      863      863              
==========================================
  Hits         4951     4951              
- Misses        529      538       +9     
Flag Coverage Δ
cpp 74.87% <0.00%> (-0.32%) ⬇️
python_and_cython 99.97% <ø> (ø)

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

Impacted Files Coverage Δ
src/pystack/_pystack/unwinder.cpp 77.43% <0.00%> (-2.50%) ⬇️

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

We can fail to find any frames even without `libdw` reporting an error,
and in that case `dwfl_errmsg` can return a `nullptr`, which we cannot
pass to the `std::string` constructor.

This fixes a

    Engine error: basic_string::_S_construct null not valid

when unwinding has failed.

Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
@godlygeek godlygeek force-pushed the handle_unwind_failures_better branch from e212cbd to cd75978 Compare June 7, 2023 07:27
@pablogsal pablogsal merged commit a971a4c into bloomberg:main Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants