C++ demangling support missing from perf

Bug #1396654 reported by Steve Capper on 2014-11-26
90
This bug affects 19 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Medium
Tim Gardner
Xenial
Medium
Unassigned
Yakkety
Medium
Unassigned
Zesty
Medium
Tim Gardner
linux-hwe (Ubuntu)
Undecided
Unassigned
Xenial
Undecided
Unassigned

Bug Description

Hi,
It appears that C++ demangling support is missing from linux-tools-3.16.0-24, on Utopic on arm64.

Could the following please be added to the build dependencies for that package:
libiberty-dev
binutils-dev

Installing the above and rebuilding the package fixed the problem for me.

Cheers,
--
Steve
---
AlsaDevices: Error: command ['ls', '-l', '/dev/snd/'] failed with exit code 2: ls: cannot access /dev/snd/: No such file or directory
AplayDevices: Error: [Errno 2] No such file or directory
ApportVersion: 2.14.7-0ubuntu8
Architecture: arm64
ArecordDevices: Error: [Errno 2] No such file or directory
CRDA: Error: [Errno 2] No such file or directory
CurrentDmesg: Error: command ['sh', '-c', 'dmesg | comm -13 --nocheck-order /var/log/dmesg -'] failed with exit code 1: comm: /var/log/dmesg: Permission denied
DistroRelease: Ubuntu 14.10
IwConfig: Error: [Errno 2] No such file or directory
Lspci:

Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize libusb: -99
Package: linux (not installed)
PciMultimedia:

ProcFB:

ProcKernelCmdLine: console=ttyS0,115200n8 ro
ProcVersionSignature: Ubuntu 3.16.0-24.32-generic 3.16.4
RfKill: Error: [Errno 2] No such file or directory
Tags: utopic utopic
Uname: Linux 3.16.0-24-generic aarch64
UnreportableReason: The report belongs to a package that is not installed.
UpgradeStatus: Upgraded to utopic on 2014-11-17 (9 days ago)
UserGroups: sudo
WifiSyslog:

_MarkForUpload: True

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1396654

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete

apport information

tags: added: apport-collected utopic
description: updated

apport information

apport information

apport information

apport information

apport information

apport information

apport information

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
affects: linux (Ubuntu) → linux-meta (Ubuntu)
Changed in linux-meta (Ubuntu):
status: Confirmed → New
importance: Undecided → Medium
tags: added: kernel-da-key
tags: added: vivid
Changed in linux-meta (Ubuntu):
status: New → Triaged
tags: added: kernel-key
Andy Whitcroft (apw) on 2014-12-02
affects: linux-meta (Ubuntu) → linux (Ubuntu)
Julian Taylor (jtaylor) wrote :

probably caused by the use of HAVE_CPLUS_DEMANGLE in the make call, the variable has been renamed
see also debian bug 763002

tags: removed: kernel-key
Jorge Castro (jorge) on 2017-03-09
tags: added: xenial yakkety zesty
Changed in linux (Ubuntu):
status: Triaged → New
Changed in linux (Ubuntu Xenial):
importance: Undecided → Medium
Changed in linux (Ubuntu Yakkety):
importance: Undecided → Medium

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1396654

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Changed in linux (Ubuntu Xenial):
status: New → Incomplete
Changed in linux (Ubuntu Yakkety):
status: New → Incomplete
Milosz Tanski (mtanski) wrote :

The following build dependency packages have to be installed when building perf in order to have C++ symbol demangling work.

Packages: libiberty-dev, binutils-dev

Otherwise if you're building perf via it's Makefile in the linux source code. It will print "libbfd [OFF]" when auto-detecting features.

Tim Gardner (timg-tpi) wrote :

Added binutils-dev. libiberty-dev was already in the Build-deps

Changed in linux (Ubuntu Zesty):
assignee: nobody → Tim Gardner (timg-tpi)
status: Incomplete → Fix Committed
Launchpad Janitor (janitor) wrote :
Download full text (17.1 KiB)

This bug was fixed in the package linux - 4.10.0-14.16

---------------
linux (4.10.0-14.16) zesty; urgency=low

  [ Tim Gardner ]

  * Release Tracking Bug
    - LP: #1673805

  * msleep() bug causes Nuvoton I2C TPM device driver delays (LP: #1667567)
    - tpm: msleep() delays - replace with usleep_range() in i2c nuvoton driver
    - SAUCE: tpm: add sleep only for retry in i2c_nuvoton_write_status()

  * C++ demangling support missing from perf (LP: #1396654)
    - [Config] added binutils-dev to Build-deps

  * dm-queue-length module is not included in installer/initramfs (LP: #1673350)
    - [Config] d-i: Also add dm-queue-length to multipath modules

  * move aufs.ko from -extra to linux-image package (LP: #1673498)
    - [config] aufs.ko moved to linux-image package

  * Using an NVMe drive causes huge power drain (LP: #1664602)
    - nvme: Add a quirk mechanism that uses identify_ctrl
    - nvme: Enable autonomous power state transitions

  * Broadcom bluetooth modules sometimes fail to initialize (LP: #1483101)
    - Bluetooth: btbcm: Add a delay for module reset

  * Need support of Broadcom bluetooth device [413c:8143] (LP: #1166113)
    - Bluetooth: btusb: Add support for 413c:8143

  * Zesty update to v4.10.3 stable release (LP: #1673118)
    - serial: 8250_pci: Add MKS Tenta SCOM-0800 and SCOM-0801 cards
    - KVM: s390: Disable dirty log retrieval for UCONTROL guests
    - KVM: VMX: use correct vmcs_read/write for guest segment selector/base
    - Bluetooth: Add another AR3012 04ca:3018 device
    - phy: qcom-ufs: Don't kfree devres resource
    - phy: qcom-ufs: Fix misplaced jump label
    - s390/qdio: clear DSCI prior to scanning multiple input queues
    - s390/dcssblk: fix device size calculation in dcssblk_direct_access()
    - s390/kdump: Use "LINUX" ELF note name instead of "CORE"
    - s390/chsc: Add exception handler for CHSC instruction
    - s390: TASK_SIZE for kernel threads
    - s390/topology: correct allocation of topology information
    - s390: make setup_randomness work
    - s390: use correct input data address for setup_randomness
    - net: mvpp2: fix DMA address calculation in mvpp2_txq_inc_put()
    - cxl: Prevent read/write to AFU config space while AFU not configured
    - cxl: fix nested locking hang during EEH hotplug
    - brcmfmac: fix incorrect event channel deduction
    - mnt: Tuck mounts under others instead of creating shadow/side mounts.
    - IB/ipoib: Fix deadlock between rmmod and set_mode
    - IB/IPoIB: Add destination address when re-queue packet
    - IB/mlx5: Fix out-of-bound access
    - IB/SRP: Avoid using IB_MR_TYPE_SG_GAPS
    - IB/srp: Avoid that duplicate responses trigger a kernel bug
    - IB/srp: Fix race conditions related to task management
    - Btrfs: fix data loss after truncate when using the no-holes feature
    - orangefs: Use RCU for destroy_inode
    - memory/atmel-ebi: Fix ns <-> cycles conversions
    - tracing: Fix return value check in trace_benchmark_reg()
    - ktest: Fix child exit code processing
    - ceph: remove req from unsafe list when unregistering it
    - target: Fix NULL dereference during LUN lookup + active I/O shutdown
    - drivers/pci/hotplug: Han...

Changed in linux (Ubuntu Zesty):
status: Fix Committed → Fix Released

This bug was nominated against a series that is no longer supported, ie yakkety. The bug task representing the yakkety nomination is being closed as Won't Fix.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu Yakkety):
status: Incomplete → Won't Fix
Peter (doob) wrote :

@timg-tpi Thanks for fixing this. I’m running 16.04 with HWE stack. My kernel is `4.13.0-45-generic #50~16.04.1-Ubuntu`. Will this fix be also available in the `linux-tools-generic-hwe-16.04` package soon? Could you maybe add your fix to this package?

Peter (doob) on 2018-06-20
no longer affects: linux-meta-hwe (Ubuntu Zesty)
no longer affects: linux-meta-hwe (Ubuntu Yakkety)
helloworld922 (helloworld922) wrote :

Will this fix be available in bionic (18.04) as well? I've recently tried installing perf from apt-get and symbol demangling still does not work.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux-meta-hwe (Ubuntu Xenial):
status: New → Confirmed
Changed in linux-meta-hwe (Ubuntu):
status: New → Confirmed
Antoine Pitrou (pitrou) wrote :

As #18 pointed out, this still affects 18.04. Could the fix be ported there?

Peter (doob) wrote :

I checked this issue again, because it is really anoying.
The fix is already present in HWE kernel source.
https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/xenial/tree/debian.hwe/control.stub.in?h=hwe
However perf (`/usr/bin/perf`) is comming from linux-tools-common package which is build from 4.4.0 kernel sources.
However even these sources already have the fix.

The reason this is still missing in current Xenial just seam to be that nobody rebuild the package after applying the fix.

After locally rebuilding the package it works for me now.

Peter (doob) wrote :

I was wrong. `/usr/bin/perf` is just a shell script calling a kernel specific version.
The real executable is in `linux-hwe-tools-4.**`.
I checked the source of `linux-hwe-tools-4.15.0-36` and it already has the necessary fix.
Rebuilding just the perf executable from withhin the source dir resulted in a binary with correct demangling support.
```
apt-get source linux-hwe-tools-4.15.0-36
sudo apt-get build-dep linux-hwe-tools-4.15.0-36
cd linux-hwe-4.15.0/tools/perf && make
```

However rebuilding and installing the package `linux-hwe-tools-4.15.0-36` resulted in a different binary with still broken demangling. I don’t know what’s the reason for that.
```
apt-get source linux-hwe-tools-4.15.0-36
sudo apt-get build-dep linux-hwe-tools-4.15.0-36
cd linux-hwe-4.15.0 && debuild -us -uc -b
sudo dpkg -i ../linux-hwe-tools-4.15.0-36_4.15.0-36.39~16.04.1_amd64.deb ../linux-tools-4.15.0-36-generic_4.15.0-36.39~16.04.1_amd64.deb
```

no longer affects: linux-meta-hwe (Ubuntu)
no longer affects: linux-meta-hwe (Ubuntu Xenial)
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux-hwe (Ubuntu Xenial):
status: New → Confirmed
Changed in linux-hwe (Ubuntu):
status: New → Confirmed

I am affected by this on Ubuntu 18.04 (Bionic).

The only workaround I have seen, is to build/rebuild the `perf` tool from the source package. This does not fix the problem for me on 18.04.

```
sudo apt-get install libiberty-dev binutils-dev
mkdir tmp
cd tmp
apt-get source linux-tools-4.15.0-39-generic
cd linux-4.15.0/
sudo apt-get build-dep linux-tools-4.15.0-39-generic
debuild --no-sign
```

Then, the newly built `debian/linux-tools-4.15.0-39/usr/lib/linux-tools-4.15.0-39/perf` still does not do any demangling of C++ symbols.

Am I doing something wrong, or is it a new kind of problem with a different solution on 18.04?

Any help will be greatly appreciated.

Ok, on 18.04 (Bionic), if I do this

```
sudo apt-get build-dep linux-tools-4.15.0-39-generic
sudo apt-get install libiberty-dev binutils-dev
mkdir tmp
cd tmp
apt-get source linux-tools-4.15.0-39-generic
cd linux-4.15.0/tools/perf
make
```
I do get a perf command that demangles (so I now have a workaround)

Still, if I use `debuild` instead, as shown in my previous post, the command is apparently built differently and is not able to demangle.

So, I can confirm the findings similar to post #24.

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

Other bug subscribers