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

consider leaving qemu acceleration enabled when running with debugging enabled #1317

Open
wjhun opened this issue Apr 8, 2022 · 1 comment

Comments

@wjhun
Copy link
Contributor

wjhun commented Apr 8, 2022

ops implicitly disables hardware acceleration when the '-d' flag is specified, yet there are still legitimate uses for running remote gdb with acceleration enabled. For example, it is still possible to interrupt a running instance and inspect the machine state while running with kvm enabled.

Instead of the existing behavior, ops could print a warning to the effect of "breakpoints and other features may not correctly function with acceleration enabled", but ultimately leave it up to the user whether to leave acceleration enabled.

Incidentally, it is not clear from ops usage how to go about disabling acceleration, as there is the "--accel" flag to enable it, yet it is also enabled by default:

Usage:
  ops pkg load [packagename] [flags]

Flags:
      --accel                  use cpu virtualization extension (default true)
  -a, --args stringArray       command line arguments
  -b, --bridged                bridge networking
      --bridgename string      bridge name
  -c, --config string          ops config file
  -d, --debug                  enable interactive debugger
      --disable-args-copy      disable copying of files passed as arguments
  -e, --envs stringArray       env arguments
  -f, --force                  update images
      --gateway string         network gateway
  -g, --gdbport int            qemu TCP port used for GDB interface
  -h, --help                   help for load
  -i, --imagename string       image name
      --ip-address string      static ip address
      --ipv6-address string    static ipv6 address
  -l, --local                  load local package
  -m, --memory string          RAM size
      --missing-files          print list of files not found on image at exit
      --mounts stringArray     mount <volume_id:mount_path>
      --nanos-version string   uses nanos tools version
      --netmask string         network mask (default "255.255.255.0")
  -n, --nightly                nightly build
      --no-trace stringArray   do not trace syscall
  -p, --port stringArray       port to forward
  -s, --skipbuild              skip building image
      --smp int                number of threads to use (default 1)
      --syscall-summary        print syscall summary on exit
  -t, --tapname string         tap device name
  -r, --target-root string     target root
      --trace                  enable required flags to trace
      --type string            image type (target platform-specific)
  -v, --verbose                verbose

Global Flags:
  -j, --json            display json messages
      --show-debug      display debug messages
      --show-errors     display error messages
      --show-warnings   display warning messages
@eyberg
Copy link
Contributor

eyberg commented Apr 8, 2022

@wjhun I think that's why it was turned off by default was the lack of breakpoints and a few other things, also it does other things by default when debug is turned on like turning off aslr #715

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

No branches or pull requests

2 participants