ltrace produces no debug output at all, workaround is compiling with "-fcf-protection=none"

Bug #1992939 reported by Vangelis Koukis
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
ltrace (Ubuntu)
Fix Released
Critical
Ravi Kant Sharma
Focal
Fix Released
Critical
Ravi Kant Sharma
Jammy
Fix Released
Critical
Ravi Kant Sharma
Mantic
Fix Released
Critical
Ravi Kant Sharma
Noble
Fix Released
Critical
Ravi Kant Sharma

Bug Description

[ Impact ]

 * ltrace on Intel executable on current Ubuntu produces no debug output.

 * The patch introduces handling of two PLTs on an Intel CET binary. This requires enabling ARCH_HAVE_LTELF_DATA on x86.

[ Test Plan ]

I'm not sufficiently knowledgeable about this matter to be considered an expert. I "trust" the patch and the bug reporter. I did sufficient testing to make sure the patch fixes the issue, and it doesn't introduce any obvious regression.

 * instructions how to reproduce the bug

 ** run `ltrace ls` on any of the affected release. It will not produce any debug output.
 ** run ltrace on a hello built using (gcc hello.c -o hello). It will not produce any debug output.
 ** to see what is the expected output, compile hello.c with -fcf-protection=none. `gcc -fcf-protection=none -o hello hello.c`, then run `ltrace hello`
 ** another way to see the expected output is to run ltrace on Ubuntu Bionic release. (CET was not enabled by default here in gcc)

 * testing the fix
 ** run the same commands with patched ltrace. It should output the debug symbols.
 ** steps to build ltrace locally on noble/devel and test
 *** clone the repo (git ubuntu clone ltrace ltrace-gu)
 *** checkout the branch fix-devel-1992939
 *** apply all patches (quilt push -a)
 *** ./configure && make
 *** ./ltrace <path to hello.out> (should produce debug output)
 *** ./ltrace ls (should produce debug output)

 * I also did the following regressions tests.
 ** build a hello (gcc version Ubuntu 7.3.0-16ubuntu3) binary on bionic (mk-sbuild bionic and schroot) and run it with patched ltrace built on noble. it should produce debug output.
 ** I did the same for Jammy and Focal.
 ** Compile a hello binary with -fcf-protection=none and ran it with patched ltrace. it should produce debug output.

[ Where problems could occur ]

 * There could be a problem if a user is depending on ARCH_HAVE_LTELF_DATA for x86 being disabled. The chances are very low though. It has been enabled upstream for since 2013.

[ Other Info ]

 * There is a workaround to see debug symbols. Compiling with -fcf-protection=none. See Original bug description for more.

[ Original bug description ]

Hello,

Running ltrace on any executable on current Ubuntu produces no debug output at all.
I have verified the behavior shown below on kinetic and focal.
Compiling with "-fcf-protection=none" seems to be a workaround.
The breakage seems to be related to "Intel CET Support" and the following upstream patch seems relevant:
https://gitlab.com/cespedes/ltrace/-/commit/ec563704ab5ef48bf308924de4ef021c4d0cd2af

More information on how to reproduce follows:

*** kinetic

# cat /etc/os-release
PRETTY_NAME="Ubuntu Kinetic Kudu (development branch)"
NAME="Ubuntu"
VERSION_ID="22.10"
VERSION="22.10 (Kinetic Kudu)"
VERSION_CODENAME=kinetic
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=kinetic
LOGO=ubuntu-logo

# apt install ltrace
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ltrace is already the newest version (0.7.3-6.1ubuntu6).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

# ltrace ls -d .
.
+++ exited (status 0) +++

FAIL:

$ gcc -o hello hello.c
$ ltrace ./hello
Hello, World!
+++ exited (status 0) +++

SUCCESS:

$ gcc -fcf-protection=none -o hello hello.c
$ ltrace ./hello
puts("Hello, World!"Hello, World!
) = 14
+++ exited (status 0) +++

Thank you,
Vangelis

ProblemType: Bug
DistroRelease: Ubuntu 22.10
Package: ltrace 0.7.3-6.1ubuntu6
Uname: Linux 5.4.72-microsoft-standard-WSL2 x86_64
ApportVersion: 2.23.1-0ubuntu3
Architecture: amd64
CasperMD5CheckResult: unknown
Date: Fri Oct 14 06:40:46 2022
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
SourcePackage: ltrace
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Vangelis Koukis (vkoukis) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in ltrace (Ubuntu):
status: New → Confirmed
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Huh, I thought it was some combination of PIE and bindnow that broke ltrace. We should look at including the patch I guess, unless there will be a ltrace release including it at some point.

Another workaround btw is to use latrace instead.

tags: added: foundation-todo
Revision history for this message
Lukas Märdian (slyon) wrote :

Setting to Triaged/Low as there is an easy workaround available: using latrace.

Changed in ltrace (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Low
tags: added: foundations-todo
removed: foundation-todo
Revision history for this message
Walter (wdoekes) wrote :

Bug also present on Jammy. Workaround with `-fcf-protection=none` is confirmed to work.

Changed in ltrace (Ubuntu Jammy):
importance: Undecided → Low
Changed in ltrace (Ubuntu Focal):
importance: Undecided → Low
Changed in ltrace (Ubuntu Noble):
assignee: nobody → Ravi Kant Sharma (ravi-sharma)
Changed in ltrace (Ubuntu Focal):
assignee: nobody → Ravi Kant Sharma (ravi-sharma)
Changed in ltrace (Ubuntu Jammy):
assignee: nobody → Ravi Kant Sharma (ravi-sharma)
Revision history for this message
Ravi Kant Sharma (ravi-sharma) wrote :

Confirmed bug does not exist on Bionic

Revision history for this message
Ravi Kant Sharma (ravi-sharma) wrote :

Verified that the bug is fixed on ltrace main (ltrace 0.7.91).

Changed in ltrace (Ubuntu Lunar):
importance: Undecided → Low
Changed in ltrace (Ubuntu Mantic):
importance: Undecided → Low
Changed in ltrace (Ubuntu Lunar):
assignee: nobody → Ravi Kant Sharma (ravi-sharma)
Changed in ltrace (Ubuntu Mantic):
assignee: nobody → Ravi Kant Sharma (ravi-sharma)
description: updated
no longer affects: ltrace (Ubuntu Lunar)
Changed in ltrace (Ubuntu Focal):
status: New → In Progress
Changed in ltrace (Ubuntu Jammy):
status: New → In Progress
Changed in ltrace (Ubuntu Mantic):
status: New → In Progress
Changed in ltrace (Ubuntu Noble):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ltrace - 0.7.3-6.1ubuntu7

---------------
ltrace (0.7.3-6.1ubuntu7) noble; urgency=medium

  * Fix ltrace on binaries compiled on recent Ubuntu releases (LP: #1992939)
    - debian/patches/lp1992939-add-intel-cet-support.patch, thanks to DJ Delorie

 -- Ravi Kant Sharma <email address hidden> Fri, 08 Dec 2023 14:54:53 +0100

Changed in ltrace (Ubuntu Noble):
status: In Progress → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote :

I don't know why this bug was marked low when the program as it is shipped today is entirely unfit for purpose.

Changed in ltrace (Ubuntu Noble):
importance: Low → Critical
Changed in ltrace (Ubuntu Mantic):
importance: Low → Critical
Changed in ltrace (Ubuntu Jammy):
importance: Low → Critical
Changed in ltrace (Ubuntu Focal):
importance: Low → Critical
Changed in ltrace (Ubuntu Mantic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-mantic
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Vangelis, or anyone else affected,

Accepted ltrace into mantic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ltrace/0.7.3-6.1ubuntu6.23.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-mantic to verification-done-mantic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-mantic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ltrace (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed-jammy
Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Vangelis, or anyone else affected,

Accepted ltrace into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ltrace/0.7.3-6.1ubuntu6.22.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Ravi Kant Sharma (ravi-sharma) wrote :

>the version of the package you tested
Jammy: 0.7.3-6.1ubuntu6.22.04.1 from jammy-proposed
Mantic: 0.7.3-6.1ubuntu6.23.10.1 from mantic-proposed

>what testing has been performed on the package
Instructions to reproduce in the Test Plan.

** run `ltrace ls /` on any of the affected release. Debug output is available.
** run ltrace on a hello built using (gcc hello.c -o hello). Debug output is available.

tags: added: verification-done-jammy verification-done-mantic
removed: verification-needed-jammy verification-needed-mantic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ltrace - 0.7.3-6.1ubuntu6.23.10.1

---------------
ltrace (0.7.3-6.1ubuntu6.23.10.1) mantic; urgency=medium

  * Fix ltrace on binaries compiled on recent Ubuntu releases (LP: #1992939)
    - debian/patches/lp1992939-add-intel-cet-support.patch, thanks to DJ Delorie

 -- Ravi Kant Sharma <email address hidden> Mon, 15 Jan 2024 11:37:21 +0100

Changed in ltrace (Ubuntu Mantic):
status: Fix Committed → Fix Released
Revision history for this message
Robie Basak (racb) wrote : Update Released

The verification of the Stable Release Update for ltrace has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ltrace - 0.7.3-6.1ubuntu6.22.04.1

---------------
ltrace (0.7.3-6.1ubuntu6.22.04.1) jammy; urgency=medium

  * Fix ltrace on binaries compiled on recent Ubuntu releases (LP: #1992939)
      - debian/patches/lp1992939-add-intel-cet-support.patch, thanks to DJ Delorie

 -- Ravi Kant Sharma <email address hidden> Mon, 15 Jan 2024 11:45:25 +0100

Changed in ltrace (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Simon Chopin (schopin) wrote :

I dropped the sponsoring ball on that one, and forgot to upload the Focal patch. This has been rectified, with the relevant package in the Unapproved focal queue.

Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Vangelis, or anyone else affected,

Accepted ltrace into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ltrace/0.7.3-6.1ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ltrace (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Ravi Kant Sharma (ravi-sharma) wrote :

>the version of the package you tested
Focal: 0.7.3-6.1ubuntu1.1 from focal-proposed

>what testing has been performed on the package
Instructions to reproduce in the Test Plan.

** run `ltrace ls /` on any of the affected release. Debug output is available.
** run ltrace on a hello built using (gcc hello.c -o hello). Debug output is available.

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ltrace - 0.7.3-6.1ubuntu1.1

---------------
ltrace (0.7.3-6.1ubuntu1.1) focal; urgency=medium

  * Fix ltrace on binaries compiled on recent Ubuntu releases (LP: #1992939)
    - debian/patches/lp1992939-add-intel-cet-support.patch, thanks to DJ Delorie

 -- Ravi Kant Sharma <email address hidden> Mon, 15 Jan 2024 12:07:19 +0100

Changed in ltrace (Ubuntu Focal):
status: Fix Committed → Fix Released
Benjamin Drung (bdrung)
tags: removed: foundations-todo
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.