Skip to content

gdb: fix issue "Debug not enabled" when gdb feature was enabled #678

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

Merged
merged 1 commit into from
Jul 1, 2025

Conversation

dblnz
Copy link
Contributor

@dblnz dblnz commented Jun 30, 2025

Description

This pull request addresses an issue with the gdb feature.

NOTE: Additionally, I have modified the guest-debugging example to use two sandboxes(one with debugging enabled and one without) to help find similar issues in the future.

Behavior

When the gdb feature is turned on for hyperlight and a sandbox is not configured to enable debugging, it receives Debug not enabled error.

Root cause

This happens because of a message that is sent, during the Hypervisor construction phase, from the Hypervisor to the gdb thread.
The problem is that the signal is sent even if the sandbox has no debug enabled.
The transmission fails because there is no gdb thread to receive it and returns this error.

Fix

Add a condition before sending the signal to ensure the sandbox has debugging enabled

- This happened due to a message that was sent from the Hypervisor to
  the `gdb` thread even if the sandbox had no debug enabled. The
  transmission failed and returned this error.
- The fix checks a condition before sending this signal so that to
  ensure the sandbox has debugging enabled

Signed-off-by: Doru Blânzeanu <[email protected]>
@dblnz dblnz requested review from danbugs and ludfjig as code owners June 30, 2025 18:00
@dblnz dblnz added the kind/bugfix For PRs that fix bugs label Jun 30, 2025
Copy link
Contributor

@ludfjig ludfjig left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Member

@syntactically syntactically left a comment

Choose a reason for hiding this comment

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

LGTM

@dblnz dblnz merged commit 5560b9c into hyperlight-dev:main Jul 1, 2025
33 checks passed
@dblnz dblnz deleted the fix-debug-not-enabled-issue branch July 1, 2025 09:35
@dblnz dblnz restored the fix-debug-not-enabled-issue branch July 2, 2025 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bugfix For PRs that fix bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants