Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: "Carlos O'Donell" <carlos@systemhalted.org>
Cc: John David Anglin <dave@hiauly1.hia.nrc.ca>,
	dave.anglin@nrc-cnrc.gc.ca, linux-parisc@vger.kernel.org
Subject: Re: Segfault in __c_f_f_c during strace of nptl application.
Date: Wed, 9 Sep 2009 10:50:32 -0400	[thread overview]
Message-ID: <200909091050.35128.vapier@gentoo.org> (raw)
In-Reply-To: <119aab440909090739s1f7af068s65bb4d389b626a4d@mail.gmail.com>

[-- Attachment #1: Type: Text/Plain, Size: 1778 bytes --]

On Wednesday 09 September 2009 10:39:30 Carlos O'Donell wrote:
> On Sun, Jun 21, 2009 at 11:20 AM, John David
> 
> Anglin<dave@hiauly1.hia.nrc.ca> wrote:
> > Looking at my email archive, I see the real cause involves kernel memory
> > maps:
> >
> >  > > > On Wed, May 06, 2009 at 01:39:49PM -0400, John David Anglin wrote:
> >  > > > > > The tombstone is:
> >  > > > > >
> >  > > > > > do_page_fault() pid=10205 command='strace' type=15
> > address=0x407d2f18 > > > > > vm_start = 0x4068d000, vm_end = 0x4068f000
> >  > > > >
> >  > > > > So, the pointer passed to __canonicalize_funcptr_for_compare is
> > outside > > > > the vm range.
> 
> The strace problem is a compiler flaw.
> 
> This is the problem:
> * Strace examines the applications syscall.
> * Strace extracts, via PTRACE, application addresses, addresses that
> don't exist in the strace address space (and should not exist).
> * Strace compares extracted address to a constant SIG_ERR.
> * Compiler generates a call to __c_f_f_c, which dereference the
> extracted address and strace faults.
> 
> Strace and the application have completely different address spaces,
> and __c_f_f_c can't assume that an address is in the current address
> space.
> 
> The solution is to detect that a comparison between two pointers is a
> comparison between pointer and small constant, and avoid calling
> __c_f_f_c for both.
> 
> The workaround is to cast both long. I tested this and it works. I'll
> submit this to debian as the fix.

and include this explanation in a comment right above the cast ? ;)

also, the strace list is active currently, so posting a patch there should get 
it merged (and since it's an important bugfix, it should get added before the 
next release).
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2009-09-09 14:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-21  6:27 Segfault in __c_f_f_c during strace of nptl application Carlos O'Donell
2009-06-21 15:20 ` John David Anglin
2009-06-21 16:18   ` Carlos O'Donell
2009-06-21 17:16     ` John David Anglin
2009-06-21 20:01       ` Carlos O'Donell
2009-06-21 20:21         ` John David Anglin
2009-06-21 21:37           ` Carlos O'Donell
2009-06-21 22:18             ` John David Anglin
2009-06-22  1:46   ` Randolph Chung
2009-06-22 13:35     ` John David Anglin
2009-09-09 14:39   ` Carlos O'Donell
2009-09-09 14:50     ` Mike Frysinger [this message]
2009-09-09 15:16     ` John David Anglin
2009-09-09 15:24       ` Carlos O'Donell
2009-09-10  1:10         ` John David Anglin
2009-09-10 16:03           ` Carlos O'Donell
2009-09-11 22:57             ` John David Anglin
2009-09-13 20:56               ` Carlos O'Donell
2009-09-13 21:00                 ` Kyle McMartin
2009-09-13 21:32                   ` Carlos O'Donell
2009-09-13 21:37                     ` Kyle McMartin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200909091050.35128.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=carlos@systemhalted.org \
    --cc=dave.anglin@nrc-cnrc.gc.ca \
    --cc=dave@hiauly1.hia.nrc.ca \
    --cc=linux-parisc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox