dropped patch reintroduces gcore relro backtrace problem

Bug #954714 reported by Steve Beattie on 2012-03-14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gdb (Ubuntu)
Matthias Klose

Bug Description

The recent gdb upload https://launchpad.net/ubuntu/+source/gdb/7.4-2012.02-0ubuntu1 disabled the patch gdb-7.2-gcore-relro-writer.patch which was added to address bug 680588. The reason the patch was disabled was because it no longer cleanly applies to the gdb source tree; the gdb/linux-nat.c source file is significantly different in the 7.4-2012.02 version.

I've confirmed that an updated version of the patch is still necessary; with 7.4-2012.02-0ubuntu1 backtraces like the following are generated:

  (gdb) bt
  #0 0x00007fda019b82b0 in ?? ()
  #1 0x00007fda019b816c in ?? ()
  #2 0x0000000000000000 in ?? ()

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: gdb 7.4-2012.02-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-18.29-generic 3.2.9
Uname: Linux 3.2.0-18-generic x86_64
ApportVersion: 1.94.1-0ubuntu2
Architecture: amd64
Date: Tue Mar 13 21:14:46 2012
InstallationMedia: Ubuntu-Server 10.04 "Lucid Lynx" - Alpha amd64 (20100330)
 PATH=(custom, user)
SourcePackage: gdb
UpgradeStatus: Upgraded to precise on 2012-01-18 (55 days ago)

Related branches

Steve Beattie (sbeattie) wrote :
Steve Beattie (sbeattie) wrote :

Attached is a first attempt at updating the relro patch for gdb-7.4-2012.02. It still needs to emit a warning if the sscanf(3) fails to match anything, but it appears to work correctly without issue in local testing.

The attachment "gdb-7.2-gcore-relro-writer.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Changed in gdb (Ubuntu):
milestone: none → ubuntu-12.04-beta-2
assignee: nobody → Canonical Foundations Team (canonical-foundations)
tags: added: rls-p-tracking
Steve Langasek (vorlon) wrote :

Matthias, please have a look at this.

Changed in gdb (Ubuntu):
assignee: Canonical Foundations Team (canonical-foundations) → Matthias Klose (doko)
importance: Undecided → High
Steve Beattie (sbeattie) wrote :

Here's an updated patch that adds a warning if the sscanf(3) line in gdb/linux-tdep.c fails. I've again verified locally that the patch causes gcore to generate a corefile such that gdb can generate an accurate backtrace from it.

I would appreciate review on the changes made to gdb/linux-tdep.c in the patch. It attempts to do what the prior version of the patch did, parsing /proc/PID/smaps instead of /proc/PID/maps and look for whether a few specific entries in each mapping are non-zero to indicate whether the mapping has been modified. The code in question was moved from gdb/linux-nat.c to gdb/linux-tdep.c and restructured to be line-oriented, which complicted things a bit.

I'm reviewing this patch.

I ran the GDB testsuite with it and there are no regressions on i686-linux.

Tomorrow I'll test it on x86_64 and finish my review of the code.

I finished reviewing the patch. It looks great to me. Also the gcore-relro.exp testcase which exercises the patch passes, and there are no regressions on i686 nor x86_64.

Thanks for working on it, Steve!

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdb - 7.4-2012.02-0ubuntu2

gdb (7.4-2012.02-0ubuntu2) precise; urgency=low

  * Update and re-enable the gdb-7.2-gcore-relro-writer patch (Steve Beattie).
    LP: #954714.
 -- Matthias Klose <email address hidden> Fri, 16 Mar 2012 01:32:38 +0100

Changed in gdb (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers