[Ubuntu18.04] qemu gets a trap when given a negative number to 'maxcpus' argument

Bug #1722495 reported by bugproxy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu-power-systems project
Fix Released
Low
David Britton
qemu (Ubuntu)
Fix Released
Low
Christian Ehrhardt 

Bug Description

== Comment: #0 - NAGESWARA R. SASTRY <email address hidden> - 2017-08-28 02:18:19 ==
---Problem Description---
When passed a -ve number to 'maxcpus' parameter. Qemu stops with a trap

Contact Information = <email address hidden>

---uname output---
Linux ltc-boston25 4.13.0-041300rc3-generic #201707301631 SMP Sun Jul 30 21:06:34 UTC 2017 ppc64le ppc64le ppc64le GNU/Linux

Machine Type = P9 Boston

---Debugger---
A debugger is not configured

---Steps to Reproduce---
Run the following command.
P.S. maxcpus is provided with a negative number.

/usr/bin/qemu-system-ppc64le --nographic -vga none -machine pseries,accel=kvm,kvm-type=HV -m size=200g -device virtio-blk-pci,drive=rootdisk -drive file=/var/lib/libvirt/images/avocado-fvt-wrapper/data/avocado-vt/images/ubuntu-17.10-ppc64le.qcow2,if=none,cache=none,id=rootdisk,format=qcow2 -monitor telnet:127.0.0.1:1234,server,nowait -net nic,model=virtio -net user -device nec-usb-xhci -smp 8,cores=1,threads=1,maxcpus=-12

Userspace tool common name: /usr/bin/qemu-system-ppc64le

The userspace tool has the following bit modes: 64-bit

Userspace rpm: qemu-kvm 1:2.10~rc3+dfsg-0ubuntu1

Userspace tool obtained from project website: na

*Additional Instructions for <email address hidden>:
-Attach ltrace and strace of userspace application.

P.S. Same issue seen on upstream with x86_64 and ppc64le architectures

Please pick

https://github.com/ehabkost/qemu/commit/c0dd10991903c552811d8cbe9231055b1b3a7ebd

bugproxy (bugproxy)
tags: added: architecture-ppc64le bugnameltc-158060 severity-medium targetmilestone-inin1710
Changed in ubuntu:
assignee: nobody → Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage)
affects: ubuntu → qemu (Ubuntu)
Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
assignee: nobody → Canonical Server Team (canonical-server)
importance: Undecided → Medium
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi,
that is upstream commit [1].
I thank you for the report but this only makes a fatal error a nice-error-msg error.
It will be nice to pick this up with the next release of qemu, but that will be a no-op when we merge the new version for 18.04.

IMHO this is:
- bad user input leads to error (well that is normal right)
- not unbreaking a use case (one still gets an error, just a nicer one after the fix)
Therefore I'd consider this not important enough for any backport, but instead would track it as low prio task for the next release.
Please feel free to discuss if you disagree with that assessment.

[1]: https://git.qemu.org/?p=qemu.git;a=commit;h=c0dd10991903c552811d8cbe9231055b1b3a7ebd

Changed in qemu (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
summary: - [Ubuntu17.10] qemu gets a trap when given a negative number to 'maxcpus'
+ [Ubuntu18.04] qemu gets a trap when given a negative number to 'maxcpus'
argument
tags: added: qemu-18.04
Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
status: New → Confirmed
Manoj Iyer (manjo)
tags: added: triage-g
Manoj Iyer (manjo)
Changed in qemu (Ubuntu):
assignee: Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage) → David Britton (davidpbritton)
Changed in ubuntu-power-systems:
assignee: Canonical Server Team (canonical-server) → David Britton (davidpbritton)
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Grabbing the qemu task, but as I said in comment #1 - not urgent on next merge.

Changed in qemu (Ubuntu):
assignee: David Britton (davidpbritton) → ChristianEhrhardt (paelzer)
bugproxy (bugproxy)
tags: added: targetmilestone-inin1804
removed: targetmilestone-inin1710
Changed in ubuntu-power-systems:
importance: Medium → Low
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

qemu 2.11 is in proposed

Changed in qemu (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.9 KiB)

This bug was fixed in the package qemu - 1:2.11+dfsg-1ubuntu1

---------------
qemu (1:2.11+dfsg-1ubuntu1) bionic; urgency=medium

  * Merge with Debian testing, among other fixes this includes
    - fix fatal error on negative maxcpus (LP: #1722495)
    - fix segfault on dump-guest-memory on guests without memory (LP: #1723381)
    - linux user threading issues (LP: #1350435)
    - TOD-Clock Epoch Extension Support on s390x (LP: #1732691)
    Remaining changes:
    - qemu-kvm to systemd unit
      - d/qemu-kvm-init: script for QEMU KVM preparation modules, ksm,
        hugepages and architecture specifics
      - d/qemu-kvm.service: systemd unit to call qemu-kvm-init
      - d/qemu-system-common.install: install systemd unit and helper script
      - d/qemu-system-common.maintscript: clean old sysv and upstart scripts
      - d/qemu-system-common.qemu-kvm.default: defaults for
        /etc/default/qemu-kvm
      - d/rules: install /etc/default/qemu-kvm
    - Enable nesting by default
      - set nested=1 module option on intel. (is default on amd)
      - re-load kvm_intel.ko if it was loaded without nested=1
      - d/p/ubuntu/expose-vmx_qemu64cpu.patch: expose nested kvm by default
        in qemu64 cpu type.
      - d/p/ubuntu/enable-svm-by-default.patch: Enable nested svm by default
        in qemu64 on amd
    - libvirt/qemu user/group support
      - qemu-system-common.postinst: remove acl placed by udev, and add udevadm
        trigger.
      - qemu-system-common.preinst: add kvm group if needed
    - Distribution specific machine type
      - d/p/ubuntu/define-ubuntu-machine-types.patch: define distro machine
        types to ease future live vm migration.
      - d/qemu-system-x86.NEWS Info on fixed machine type defintions
    - improved dependencies
      - Make qemu-system-common depend on qemu-block-extra
      - Make qemu-utils depend on qemu-block-extra
      - let qemu-utils recommend sharutils
    - s390x support
      - Create qemu-system-s390x package
      - Include s390-ccw.img firmware
      - Enable numa support for s390x
    - ppc64[le] support
      - d/qemu-system-ppc.links provide usr/bin/qemu-system-ppc64le symlink
    - arch aware kvm wrappers
  * Added Changes
    - update VCS-git to match the bionic branch
    - sdl2 is yet too unstable for the LTS Ubuntu release given the reports
      we still see upstream and in Debian - furthermore sdl2 isn't in main yet,
      so we revert related changes to stick with the proven for now:
      - 0fd25810 - do not build-depend on libx11-dev (libsdl2-dev already
                   depends on it)
      - 9594f820 - switch from sdl1.2 to sdl2 (#870025)
    - d/qemu-system-x86.README.Debian: document intention of nested being
      default is comfort, not full support
    - update Ubuntu machine types for qemu 2.11
    - qemu-guest-agent: freeze-hook fixes (LP: #1484990)
      - d/p/guest-agent-freeze-hook-skip-dpkg-artifacts.patch
      - d/qemu-guest-agent.install: provide /etc/qemu/fsfreeze-hook
      - d/qemu-guest-agent.dirs: provide /etc/qemu/fsfreeze-hook.d
    - Create and install pxe netboot images for KVM s390x (LP: #1732094)
      - d/rules enable install s390x-netbo...

Read more...

Changed in qemu (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2018-02-12 01:48 EDT-------
With 2.11 qemu not seeing the reported issue. This bugzilla can be closed.

# /usr/bin/qemu-system-ppc64le --nographic -vga none -machine pseries,accel=kvm,kvm-type=HV -m size=20g -device virtio-blk-pci,drive=rootdisk -drive file=/home/nasastry/ubuntu-18.04-ppc64le.qcow2,if=none,cache=none,id=rootdisk,format=qcow2 -monitor telnet:127.0.0.1:1234,server,nowait -net nic,model=virtio -net user -device nec-usb-xhci -smp 8,cores=1,threads=1,maxcpus=-12
qemu-system-ppc64le: Invalid SMP CPUs -12. The max CPUs supported by machine 'pseries-bionic' is 1024

# dpkg -l qemu-system-ppc

||/ Name Version Architecture Description
+++-================================-=====================-=====================-======================================================================
ii qemu-system-ppc 1:2.11+dfsg-1ubuntu1 ppc64el QEMU full system emulation binaries (ppc)

Manoj Iyer (manjo)
Changed in ubuntu-power-systems:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.