Skip to content

crimson/common/fatal_signal: Rework signals - #63673

Merged
Matan-B merged 5 commits into
ceph:mainfrom
Matan-B:wip-matanb-crimson-signals-aborts
Jun 25, 2025
Merged

Matan-B merged 5 commits into
ceph:mainfrom
Matan-B:wip-matanb-crimson-signals-aborts

Conversation

@Matan-B

@Matan-B Matan-B commented Jun 3, 2025 •

Copy link
Copy Markdown
Contributor

Currently crashes caused by signals are very hard to detect, we only get a "Segmentation fault" which gets hidden in random log lines from other shards due to missing newlines:

Segmentation faultDEBUG 2025-05-29 12:03:35,878 [shard 2:main]
seastore_t - ...

Rework aborting from signals path to be more informative.

See segfaults trackers examples below:
https://tracker.ceph.com/issues/66818
https://tracker.ceph.com/issues/71457

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

@Matan-B
Matan-B requested a review from a team as a code owner June 3, 2025 13:16
@Matan-B Matan-B added this to Crimson Jun 3, 2025
@Matan-B Matan-B moved this to Awaits review in Crimson Jun 3, 2025
Comment thread src/crimson/common/fatal_signal.cc Resolved
@Matan-B Matan-B changed the title crimson/common/fatal_signal: ceph_abort wheh signaled crimson/common/fatal_signal: ceph_abort when signaled Jun 3, 2025
@Matan-B
Matan-B force-pushed the wip-matanb-crimson-signals-aborts branch 2 times, most recently from 3ace0ff to 704b214 Compare June 3, 2025 14:10
@Matan-B
Matan-B marked this pull request as draft June 3, 2025 15:00

@perezjosibm perezjosibm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread src/crimson/common/fatal_signal.cc Resolved

@cyx1231st cyx1231st left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! I did need to comment out FatalSignal to see the backtrace sometimes.

@Matan-B
Matan-B force-pushed the wip-matanb-crimson-signals-aborts branch from 4d4bd1d to c61f105 Compare June 4, 2025 11:04
@Matan-B Matan-B changed the title crimson/common/fatal_signal: ceph_abort when signaled crimson/common/fatal_signal: Rework signals Jun 4, 2025
@ceph ceph deleted a comment from github-actions Bot Jun 4, 2025
Matan-B added 2 commits June 8, 2025 14:15
To be used when prefix is not needed.

Signed-off-by: Matan Breizman <[email protected]>
* Move to GENERIC_ERROR
* Remove seastar's backtrace. It was never printted anyway due to
  missing "{}" when formatting. Moreover, Seastar's internal backtrace
  is not relevant to Ceph crashes.
* Fix formatting printing "%s"
* No need to call std::flush as this will be called when printing
  the backtrace later on.

Signed-off-by: Matan Breizman <[email protected]>
@Matan-B
Matan-B force-pushed the wip-matanb-crimson-signals-aborts branch from c61f105 to c550ded Compare June 9, 2025 08:30
@Matan-B
Matan-B marked this pull request as ready for review June 9, 2025 08:34
@Matan-B Matan-B moved this from Awaits review to Needs QA in Crimson Jun 9, 2025
@Matan-B

Matan-B commented Jun 9, 2025

Copy link
Copy Markdown
Contributor Author

Out of scope:

  • omit seastar internals from backtrace.

@Matan-B

Matan-B commented Jun 9, 2025

Copy link
Copy Markdown
Contributor Author

Example from log:

NFO  2025-06-09 08:39:05,831 [shard 0:main] osd - OSD::_send_boot: cluster_msgr: v2:172.21.64.5:6820/798299300                                                                               
ERROR 2025-06-09 08:39:05,832 [shard 0:main] osd - /home/matan/ceph/src/crimson/osd/osd.cc:686 : In function 'seastar::future<> crimson::osd::OSD::_send_boot()', abort(abort() called)       
                                                                                                                                                                                              
ERROR 2025-06-09 08:39:40,511 [shard 0:main] osd - Got SIGABRT on shard 0                                                                                                                     
Backtrace:                                                                                                                                                                                    
  0# raise in /lib64/libc.so.6                                                                                                                                                                
 1# abort in /lib64/libc.so.6                                                                                                                                                                 
 2# ceph::__ceph_abortf(char const*, int, char const*, char const*, ...) at /home/matan/ceph/src/crimson/common/assert.cc:53                                                                  
 3# crimson::osd::OSD::_send_boot() at /opt/rh/gcc-toolset-13/root/usr/include/c++/13/bits/basic_string.h:804 (discriminator 1)                                                               
 4# crimson::osd::OSD::_preboot(unsigned long, unsigned long) at /home/matan/ceph/src/crimson/common/config_proxy.h:228                                                                       
 5# crimson::osd::OSD::committed_osd_maps(unsigned long, unsigned long, boost::intrusive_ptr<MOSDMap>)::{lambda()#2}::operator()() const at /home/matan/ceph/src/crimson/osd/osd.cc:1340 

@Matan-B

Matan-B commented Jun 11, 2025

Copy link
Copy Markdown
Contributor Author

@Matan-B

Matan-B commented Jun 11, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test api

@Matan-B

Matan-B commented Jun 11, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@Matan-B Matan-B moved this from Needs QA to Tested in Crimson Jun 11, 2025
@Matan-B

Matan-B commented Jun 11, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test api

1 similar comment
@Matan-B

Matan-B commented Jun 11, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test api

@Matan-B

Matan-B commented Jun 11, 2025

Copy link
Copy Markdown
Contributor Author

Note: Waiting with the merge, I might have few more improvements to add here

@Matan-B
Matan-B force-pushed the wip-matanb-crimson-signals-aborts branch 2 times, most recently from 36a4602 to bc88831 Compare June 12, 2025 12:38
Comment thread src/crimson/common/fatal_signal.cc Resolved
Comment thread src/crimson/common/fatal_signal.cc Outdated

@cyx1231st cyx1231st Jun 16, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See above, sometimes it seems that parsing the stacktrace is extremely slow (it didn't stop in my env, yet). Can we also print raw stacktraces to std::cerr (and to seastar logger, perhaps) before calling boost::stacktrace::to_string() ?

(from ps, it was the command /usr/bin/addr2line -fe ./obj-x86_64-linux-gnu-debug/bin/crimson-osd 0x00000000000DF90D)

@Matan-B Matan-B Jun 16, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm ok with printing also raw stacktraces though I'm trying to understand how was it helpful to you. Did you refer to the scenario where boost's stacktrace parsing was stuck and you would prefer having unparsed stacktrace than none?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I suspect that in the scenario above even the unparsed stacktrack would be stuck. As following the stack backtrace is the most time consuming work.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems to me the blocking part is "addr2line" referring to ps above. And the seastar way to print stacktrace as raw addrs is instantly fast.

If the OSD-native addr2line is blocking, we can translate the addresses ourselves if available from the outputs.

It is possible to only parse partial of the addresses and seems to me somehow gdb can translate them faster.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Seastar doesn't expose print_with_backtrace which is the one you refer to above iiuc. We are able to use seastar::current_backtrace though this will not result in address output as described above.
It is possible that running addr2line from within gdb might be slow/stuck.
Are you ok with merging this PR as is - and working on printing raw addresses out of scope? Possibly with std::stacktrace.
Note: I've tried using ceph::ClibBackTrace but got the same results.

Matan-B added 3 commits June 22, 2025 09:08
* Move to GENERIC_LOG
* Print backtrace in log and in std out
* Switch to fmt::format

Signed-off-by: Matan Breizman <[email protected]>
@Matan-B
Matan-B force-pushed the wip-matanb-crimson-signals-aborts branch from bc88831 to ec75b36 Compare June 22, 2025 09:31
@Matan-B
Matan-B requested a review from cyx1231st June 22, 2025 09:38
@Matan-B

Matan-B commented Jun 23, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@Matan-B
Matan-B merged commit 43db733 into ceph:main Jun 25, 2025
@Matan-B Matan-B moved this from Tested to Merged (Main) in Crimson Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Merged (Pre Umbrella cutoff)

Development

Successfully merging this pull request may close these issues.

3 participants