mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Hugo Mildenberger" <milden@dialup.nacamar.de>
To: "Brian Gerst" <bgerst@didntduck.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: AW: Questionable SIGSEGV signal handling bug concerning siginfo.si_addr on i386-linux 2.4.2
Date: Tue, 26 Jun 2001 18:19:44 +0200	[thread overview]
Message-ID: <DIEOJPFHFLBDHJJOIGOHAEMDCAAA.milden@dialup.nacamar.de> (raw)
In-Reply-To: <3B38A0F9.DD3256BD@didntduck.org>

Dear Brian,

it is hard to admit, but you are right even if a structure was not directly
involved. The corresponding high level statements were

double guarded_log( double *arg ) {
       try {
            return log( *arg ); // e.g. arg==0 or arg==0x1234.
       } catch ( s2e::SCN(SIGSGEV)*e ) {
         // [...]
       } catch ( s2e::SCN(SIGFPE)*e ) {
         // [...]
       }
}

... but your supposed structure access is really there - because a double
value allocates 8 bytes and the gcc-3.0 developers obviously changed code
generation. They access at least FPU parameters now differently and highest
long-word first; that explains the difference in program behavior. Your
suggestion of testing against the whole occupied address range is the
general solution which I already used intuitively if I was dealing with
structs and arrays - but I did not realize that also a double value is a
certain kind of struct if seen from the processor?s point of view, which is
(at the time of writing usually) only 32 bits wide.

Thank you for your exact analysis and your quick response.

Hugo Mildenberger

>Von: Brian Gerst [mailto:bgerst@didntduck.org]
>What you are seeing is the correct behavior.  The address in si_addr is
>the exact address that caused the page fault (from register %cr2).  It
>appears that you were trying to access an element of a structure, where
>the structure pointer was in %eax and the offset of the element within
>the structure is 4 bytes.  I suggest that if you are trying to find out
>if a fault happened inside a structure you check the whole range of
>addresses in that structure, because any of them could have faulted.
>
>--
>
>				Brian Gerst


      reply	other threads:[~2001-06-26 16:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-26 14:24 Hugo Mildenberger
2001-06-26 14:49 ` Brian Gerst
2001-06-26 16:19   ` Hugo Mildenberger [this message]

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=DIEOJPFHFLBDHJJOIGOHAEMDCAAA.milden@dialup.nacamar.de \
    --to=milden@dialup.nacamar.de \
    --cc=bgerst@didntduck.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®