Skip to content

Conversation

Copy link

Copilot AI commented Sep 5, 2025

This change adds configurable control over hardware breakpoints during restore operations to improve reliability and predictability of CRIU restore processes, while providing flexibility for users who need the original behavior.

Previously, the restore path would use hardware breakpoints when available (unless explicitly disabled via fault injection), which could lead to inconsistent behavior depending on the target system's hardware capabilities. This change disables breakpoints by default for restore operations but allows users to re-enable them when needed.

Changes Made

  • Modified catch_tasks() function in criu/cr-restore.c to disable breakpoints by default on restore
  • Added --enable-restore-breakpoints command line flag to allow users to opt back into hardware breakpoint usage
  • Added enable_restore_breakpoints field to the options structure in criu/include/cr_options.h
  • Added clear comments explaining the rationale and behavior
  • The checkpoint path remains unchanged and continues to respect hardware capabilities and fault injection settings

Technical Details

By default (--enable-restore-breakpoints not specified), nobp is set to true, causing the compel_stop_pie() function to:

  1. Skip setting hardware breakpoints via ptrace_set_breakpoint()
  2. Use PTRACE_SYSCALL tracing instead
  3. Log "Force no-breakpoints restore" for debugging

When --enable-restore-breakpoints is specified, the restore operation uses the original logic that respects hardware capabilities and fault injection settings.

Impact

  • Restore operations become more predictable and reliable by default
  • Users can opt back into hardware breakpoints if needed via command line flag
  • No impact on checkpoint functionality
  • Maintains full backward compatibility through optional flag
  • Clear upgrade path for users who need the original behavior

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: avagin <1049830+avagin@users.noreply.github.com>
Copilot AI changed the title [WIP] disable breakpoints on the restore path Disable breakpoints on the restore path Sep 5, 2025
Copilot AI requested a review from avagin September 5, 2025 17:09
Copilot finished work on behalf of avagin September 5, 2025 17:09
{
struct pstree_item *item;
bool nobp = fault_injected(FI_NO_BREAKPOINTS) || !kdat.has_breakpoints;
bool nobp = true; /* Always disable breakpoints on the restore path */
Copy link
Member

Choose a reason for hiding this comment

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

pls add a command line flag to disable it optionaly

Copy link
Member

Choose a reason for hiding this comment

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

@copilot pls add a command line flag to disable it optionaly

Copy link
Author

Choose a reason for hiding this comment

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

Added the --enable-restore-breakpoints command line flag as requested. By default, breakpoints remain disabled on restore for reliability (maintaining current behavior). When the flag is provided, the restore operation will use the original logic that respects hardware capabilities and fault injection settings. Commit c4c90e4

@avagin avagin removed their assignment Sep 5, 2025
Co-authored-by: avagin <1049830+avagin@users.noreply.github.com>
Copy link
Author

Copilot AI commented Sep 5, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Disable breakpoints on the restore path Add configurable breakpoint control for restore path Sep 5, 2025
Copilot AI requested a review from avagin September 5, 2025 20:11
Copilot finished work on behalf of avagin September 5, 2025 20:11
@avagin
Copy link
Member

avagin commented Sep 5, 2025

It was just an experiment.

@avagin avagin closed this Sep 5, 2025
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.

2 participants