kvm_stat : missing python dependency

Bug #1798776 reported by bugproxy on 2018-10-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu on IBM z Systems
Medium
Canonical Kernel Team
linux (Ubuntu)
Undecided
Skipper Bug Screeners
Bionic
Undecided
Unassigned
Cosmic
Undecided
Unassigned

Bug Description

After installing linux-tools-host, the included kvm_stat utility won't work:

root@ubuntu:~# kvm_stat
-bash: /usr/bin/kvm_stat: /usr/bin/python: bad interpreter: No such file or directory

Reason is that there is apparently no dependency on a python package from the linux-tools-host package.

bugproxy (bugproxy) on 2018-10-19
tags: added: architecture-s39064 bugnameltc-172466 severity-high targetmilestone-inin1810
Changed in ubuntu:
assignee: nobody → Skipper Bug Screeners (skipper-screen-team)
affects: ubuntu → linux (Ubuntu)
Changed in ubuntu-z-systems:
importance: Undecided → High
status: New → Triaged
assignee: nobody → Canonical Kernel Team (canonical-kernel-team)
Frank Heimes (frank-heimes) wrote :

A minimal Ubuntu 18.10 installation comes by default with python3 only:
$ ls /usr/bin/python*
/usr/bin/python3 /usr/bin/python3.6 /usr/bin/python3.6m /usr/bin/python3m

The 'shebang' in /usr/bin/kvm_stat points to /usr/bin/python:
$ grep \#\! /usr/bin/kvm_stat
#!/usr/bin/python
Which is usually python version 2.x.

kvm_stat should work with python 2 or 3.
Since python3 is the default and because python 2 is legacy, the shebang in kvm_stat should better point to python3.

As a workaround create a link or an alias
or install python-minimal (which is python2):
$ sudo apt install python-minimal
...
and 'sudo kvm_stat' will work again.

Changed in ubuntu-z-systems:
importance: High → Medium

I agree that adding a dependency and pulling in python2 from the kernel seems very wrong.

Per https://www.python.org/dev/peps/pep-0394/#recommendation I think the right header would be
  #!/usr/bin/env python3

That would be a (trivial) upstream change to the kernel as code is held there.
Unless it is still important to keep it also py2 executable - is it?

Per last commits on that file Stefan Raspl <email address hidden> should be best to decide where the upstream code should go to.
Even if it is py2 it should use the "env" sheband btw, see above pep link.

------- Comment From <email address hidden> 2018-10-19 16:03 EDT-------
Uh, now that would be me :O
Two aspects:
kvm_stat would need commit 58f33cfe73076 "tools/kvm_stat: fix python3 issues" from the kernel tree, which came with 4.19. I believe it was pulled into the stable kernels, but upon checking it doesn't appear to be present in cosmic.
The other thing is that the kernel community is quite conservative when it comes to backwards compatibility. I'm not sure if a switch to a later python version would go down too well with that crowd...

Dimitri John Ledkov (xnox) wrote :

Given that python2 is effectively EOL soon, and python3 has been available since forever... the switch must happen. Including stable releases of kernel, imho.

bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-10-22 16:40 EDT-------
According to https://legacy.python.org/dev/peps/pep-0373/, end of life for Python 2.7 was moved to 2020 - that's still a wee bit!
Still, since kvm_stat should be Python 3 compatible by now, why not just go a head and try to convert to "#!/usr/bin/env python3" upstream? Are you folks up to submitting a respective patch upstream, or do you want me to...?

Frank Heimes (frank-heimes) wrote :

Hi Stefan, since you recently brought some changes to kvm_stats upstream (iirc), I think it would be good if you can push for the python 'shebang' change to pythong3, too.
The code itself already runs fine on python3.

bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-10-24 15:44 EDT-------
OK, patch postet, see https://marc.info/?l=kvm&m=154041011320484&w=2
Let's see what happens next...

Frank Heimes (frank-heimes) wrote :

Thx Stefan, yes - let's wait and see. Hope upstream will agree.

bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-11-16 08:42 EDT-------
No feedback from upstream at all, sent a ping on the mailing list.

bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-11-26 08:47 EDT-------
In discussions with upstream now.

bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-12-14 16:44 EDT-------
Patch is queued according to maintainer, should be part of 4.21.

Frank Heimes (frank-heimes) wrote :

Hi Stefan, that would be fantastic, since this is the target for disco ...

Changed in linux (Ubuntu):
status: New → In Progress
Changed in ubuntu-z-systems:
status: Triaged → In Progress
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-12-18 03:35 EDT-------
Changed target milestone to 19.04, due to inclusion within kernel 4.21.
@Can: Is this also required for 18.04 LTS?

tags: added: targetmilestone-inin1904
removed: targetmilestone-inin1810
Frank Heimes (frank-heimes) wrote :

Yes, once it landed in 19.04,
it should be changed in 18.10 and 18.04, too.
All these have python3 per default.

bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2019-01-09 04:06 EDT-------
fixed in upstream kernel

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/tools/kvm/kvm_stat
/kvm_stat?id=09f70c3b70e7d9e209a820b54dda42502fa40711

author Stefan Raspl <email address hidden> 2018-10-24 21:41:34 +0200
committer Paolo Bonzini <email address hidden> 2018-11-27 12:53:44 +0100
commit 09f70c3b70e7d9e209a820b54dda42502fa40711 (patch)
tree c58cbc7296cb398b41914b76314f88e6a1571e43 /tools/kvm/kvm_stat/kvm_stat
parent 45c3af974ec6c22d7392e15eb5d755e3c0079bd1 (diff)
download linux-09f70c3b70e7d9e209a820b54dda42502fa40711.tar.gz
tools/kvm_stat: switch to python3

Seth Forshee (sforshee) wrote :

Applied to disco.

Changed in linux (Ubuntu):
status: In Progress → Fix Committed
Changed in linux (Ubuntu Bionic):
status: New → Fix Committed
Changed in linux (Ubuntu Cosmic):
status: New → Fix Committed
Changed in ubuntu-z-systems:
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :
Download full text (14.1 KiB)

This bug was fixed in the package linux - 4.19.0-12.13

---------------
linux (4.19.0-12.13) disco; urgency=medium

  * linux: 4.19.0-12.13 -proposed tracker (LP: #1813664)

  * kernel oops in bcache module (LP: #1793901)
    - SAUCE: bcache: never writeback a discard operation

  * Disco update: 4.19.18 upstream stable release (LP: #1813611)
    - ipv6: Consider sk_bound_dev_if when binding a socket to a v4 mapped address
    - mlxsw: spectrum: Disable lag port TX before removing it
    - mlxsw: spectrum_switchdev: Set PVID correctly during VLAN deletion
    - net: dsa: mv88x6xxx: mv88e6390 errata
    - net, skbuff: do not prefer skb allocation fails early
    - qmi_wwan: add MTU default to qmap network interface
    - ipv6: Take rcu_read_lock in __inet6_bind for mapped addresses
    - net: clear skb->tstamp in bridge forwarding path
    - netfilter: ipset: Allow matching on destination MAC address for mac and
      ipmac sets
    - gpio: pl061: Move irq_chip definition inside struct pl061
    - drm/amd/display: Guard against null stream_state in set_crc_source
    - drm/amdkfd: fix interrupt spin lock
    - ixgbe: allow IPsec Tx offload in VEPA mode
    - platform/x86: asus-wmi: Tell the EC the OS will handle the display off
      hotkey
    - e1000e: allow non-monotonic SYSTIM readings
    - usb: typec: tcpm: Do not disconnect link for self powered devices
    - selftests/bpf: enable (uncomment) all tests in test_libbpf.sh
    - of: overlay: add missing of_node_put() after add new node to changeset
    - writeback: don't decrement wb->refcnt if !wb->bdi
    - serial: set suppress_bind_attrs flag only if builtin
    - bpf: Allow narrow loads with offset > 0
    - ALSA: oxfw: add support for APOGEE duet FireWire
    - x86/mce: Fix -Wmissing-prototypes warnings
    - MIPS: SiByte: Enable swiotlb for SWARM, LittleSur and BigSur
    - crypto: ecc - regularize scalar for scalar multiplication
    - arm64: perf: set suppress_bind_attrs flag to true
    - drm/atomic-helper: Complete fake_commit->flip_done potentially earlier
    - clk: meson: meson8b: fix incorrect divider mapping in cpu_scale_table
    - samples: bpf: fix: error handling regarding kprobe_events
    - usb: gadget: udc: renesas_usb3: add a safety connection way for
      forced_b_device
    - fpga: altera-cvp: fix probing for multiple FPGAs on the bus
    - selinux: always allow mounting submounts
    - ASoC: pcm3168a: Don't disable pcm3168a when CONFIG_PM defined
    - scsi: qedi: Check for session online before getting iSCSI TLV data.
    - drm/amdgpu: Reorder uvd ring init before uvd resume
    - rxe: IB_WR_REG_MR does not capture MR's iova field
    - efi/libstub: Disable some warnings for x86{,_64}
    - jffs2: Fix use of uninitialized delayed_work, lockdep breakage
    - clk: imx: make mux parent strings const
    - pstore/ram: Do not treat empty buffers as valid
    - media: uvcvideo: Refactor teardown of uvc on USB disconnect
    - powerpc/xmon: Fix invocation inside lock region
    - powerpc/pseries/cpuidle: Fix preempt warning
    - media: firewire: Fix app_info parameter type in avc_ca{,_app}_info
    - ASoC: use dma_ops of parent device for acp_audio_dma
    - media: ve...

Changed in linux (Ubuntu):
status: Fix Committed → Fix Released
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-cosmic' to 'verification-done-cosmic'. If the problem still exists, change the tag 'verification-needed-cosmic' to 'verification-failed-cosmic'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-cosmic
Frank Heimes (frank-heimes) wrote :

Successfully verified after moving to latest kernel in proposed and installing corresponding linux-tools-host package - see attachment.
Adjusting tags accordingly ...

tags: added: verification-done-cosmic
removed: verification-needed-cosmic
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-bionic' to 'verification-done-bionic'. If the problem still exists, change the tag 'verification-needed-bionic' to 'verification-failed-bionic'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-bionic
Frank Heimes (frank-heimes) wrote :

Successfully verified on bionic, too - see attachment.
Adjusting tags accordingly ...

tags: added: verification-done-bionic
removed: verification-needed-bionic
Launchpad Janitor (janitor) wrote :
Download full text (11.4 KiB)

This bug was fixed in the package linux - 4.15.0-46.49

---------------
linux (4.15.0-46.49) bionic; urgency=medium

  * linux: 4.15.0-46.49 -proposed tracker (LP: #1814726)

  * mprotect fails on ext4 with dax (LP: #1799237)
    - x86/speculation/l1tf: Exempt zeroed PTEs from inversion

  * kernel BUG at /build/linux-vxxS7y/linux-4.15.0/mm/slub.c:296! (LP: #1812086)
    - iscsi target: fix session creation failure handling
    - scsi: iscsi: target: Set conn->sess to NULL when iscsi_login_set_conn_values
      fails
    - scsi: iscsi: target: Fix conn_ops double free

  * user_copy in user from ubuntu_kernel_selftests failed on KVM kernel
    (LP: #1812198)
    - selftests: user: return Kselftest Skip code for skipped tests
    - selftests: kselftest: change KSFT_SKIP=4 instead of KSFT_PASS
    - selftests: kselftest: Remove outdated comment

  * RTL8822BE WiFi Disabled in Kernel 4.18.0-12 (LP: #1806472)
    - SAUCE: staging: rtlwifi: allow RTLWIFI_DEBUG_ST to be disabled
    - [Config] CONFIG_RTLWIFI_DEBUG_ST=n
    - SAUCE: Add r8822be to signature inclusion list

  * kernel oops in bcache module (LP: #1793901)
    - SAUCE: bcache: never writeback a discard operation

  * CVE-2018-18397
    - userfaultfd: use ENOENT instead of EFAULT if the atomic copy user fails
    - userfaultfd: shmem: allocate anonymous memory for MAP_PRIVATE shmem
    - userfaultfd: shmem/hugetlbfs: only allow to register VM_MAYWRITE vmas
    - userfaultfd: shmem: add i_size checks
    - userfaultfd: shmem: UFFDIO_COPY: set the page dirty if VM_WRITE is not set

  * Ignore "incomplete report" from Elan touchpanels (LP: #1813733)
    - HID: i2c-hid: Ignore input report if there's no data present on Elan
      touchpanels

  * Vsock connect fails with ENODEV for large CID (LP: #1813934)
    - vhost/vsock: fix vhost vsock cid hashing inconsistent

  * SRU: Fix thinkpad 11e 3rd boot hang (LP: #1804604)
    - ACPI / LPSS: Force LPSS quirks on boot

  * Bionic update: upstream stable patchset 2019-01-17 (LP: #1812229)
    - scsi: sd_zbc: Fix variable type and bogus comment
    - KVM/Eventfd: Avoid crash when assign and deassign specific eventfd in
      parallel.
    - x86/apm: Don't access __preempt_count with zeroed fs
    - x86/events/intel/ds: Fix bts_interrupt_threshold alignment
    - x86/MCE: Remove min interval polling limitation
    - fat: fix memory allocation failure handling of match_strdup()
    - ALSA: hda/realtek - Add Panasonic CF-SZ6 headset jack quirk
    - ARCv2: [plat-hsdk]: Save accl reg pair by default
    - ARC: Fix CONFIG_SWAP
    - ARC: configs: Remove CONFIG_INITRAMFS_SOURCE from defconfigs
    - ARC: mm: allow mprotect to make stack mappings executable
    - mm: memcg: fix use after free in mem_cgroup_iter()
    - mm/huge_memory.c: fix data loss when splitting a file pmd
    - cpufreq: intel_pstate: Register when ACPI PCCH is present
    - vfio/pci: Fix potential Spectre v1
    - stop_machine: Disable preemption when waking two stopper threads
    - drm/i915: Fix hotplug irq ack on i965/g4x
    - drm/nouveau: Use drm_connector_list_iter_* for iterating connectors
    - drm/nouveau: Avoid looping through fake MST connectors
    - gen_stats: Fix netl...

Changed in linux (Ubuntu Bionic):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :
Download full text (3.3 KiB)

This bug was fixed in the package linux - 4.18.0-16.17

---------------
linux (4.18.0-16.17) cosmic; urgency=medium

  * linux: 4.18.0-16.17 -proposed tracker (LP: #1814749)

  * Packaging resync (LP: #1786013)
    - [Packaging] update helper scripts

  * CVE-2018-16880
    - vhost: fix OOB in get_rx_bufs()

  * RTL8822BE WiFi Disabled in Kernel 4.18.0-12 (LP: #1806472)
    - SAUCE: staging: rtlwifi: allow RTLWIFI_DEBUG_ST to be disabled
    - [Config] CONFIG_RTLWIFI_DEBUG_ST=n
    - SAUCE: Add r8822be to signature inclusion list

  * kernel oops in bcache module (LP: #1793901)
    - SAUCE: bcache: never writeback a discard operation

  * CVE-2018-18397
    - userfaultfd: use ENOENT instead of EFAULT if the atomic copy user fails
    - userfaultfd: shmem: allocate anonymous memory for MAP_PRIVATE shmem
    - userfaultfd: shmem/hugetlbfs: only allow to register VM_MAYWRITE vmas
    - userfaultfd: shmem: add i_size checks
    - userfaultfd: shmem: UFFDIO_COPY: set the page dirty if VM_WRITE is not set

  * Ignore "incomplete report" from Elan touchpanels (LP: #1813733)
    - HID: i2c-hid: Ignore input report if there's no data present on Elan
      touchpanels

  * Vsock connect fails with ENODEV for large CID (LP: #1813934)
    - vhost/vsock: fix vhost vsock cid hashing inconsistent

  * Fix non-working pinctrl-intel (LP: #1811777)
    - pinctrl: intel: Do pin translation in other GPIO operations as well

  * ip6_gre: fix tunnel list corruption for x-netns (LP: #1812875)
    - ip6_gre: fix tunnel list corruption for x-netns

  * Backported commit breaks audio (fixed upstream) (LP: #1811566)
    - ASoC: intel: cht_bsw_max98090_ti: Add quirk for boards using pmc_plt_clk_0
    - ASoC: intel: cht_bsw_max98090_ti: Add pmc_plt_clk_0 quirk for Chromebook
      Clapper
    - ASoC: intel: cht_bsw_max98090_ti: Add pmc_plt_clk_0 quirk for Chromebook
      Gnawty

  * kvm_stat : missing python dependency (LP: #1798776)
    - tools/kvm_stat: switch to python3

  * [SRU] Fix Xorg crash with nomodeset when BIOS enable 64-bit fb addr
    (LP: #1812797)
    - vgaarb: Add support for 64-bit frame buffer address
    - vgaarb: Keep adding VGA device in queue

  * Fix non-working QCA Rome Bluetooth after S3 (LP: #1812812)
    - USB: Add new USB LPM helpers
    - USB: Consolidate LPM checks to avoid enabling LPM twice

  * [SRU] IO's are issued with incorrect Scatter Gather Buffer (LP: #1795453)
    - scsi: megaraid_sas: Use 63-bit DMA addressing

  * x86/mm: Found insecure W+X mapping at address (ptrval)/0xc00a0000
    (LP: #1813532)
    - x86/mm: Do not warn about PCI BIOS W+X mappings

  * CVE-2019-6133
    - fork: record start_time late

  * Fix not working Goodix touchpad (LP: #1811929)
    - HID: i2c-hid: Disable runtime PM on Goodix touchpad

  * bluetooth controller not detected with 4.15 kernel (LP: #1810797)
    - SAUCE: btqcomsmd: introduce BT_QCOMSMD_HACK
    - [Config] arm64: snapdragon: BT_QCOMSMD_HACK=y

  * X1 Extreme: only one of the two SSDs is loaded (LP: #1811755)
    - nvme-core: rework a NQN copying operation
    - nvme: pad fake subsys NQN vid and ssvid with zeros
    - nvme: introduce NVME_QUIRK_IGNORE_DEV_SUBNQN

  * Crash on "ip link add f...

Read more...

Changed in linux (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Changed in ubuntu-z-systems:
status: Fix Committed → Fix Released
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2019-03-06 07:31 EDT-------
IBM bugzilla status -> closed, Fix released for all required distros

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers