public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "opensource at artnaseef dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/18929] Profiling optimized code causes segfaults on ARM due to missing frames
Date: Mon, 13 Dec 2004 15:28:00 -0000	[thread overview]
Message-ID: <20041213152816.29942.qmail@sourceware.org> (raw)
In-Reply-To: <20041210181625.18929.opensource@artnaseef.com>


------- Additional Comments From opensource at artnaseef dot com  2004-12-13 15:28 -------
Subject: Re:  Profiling optimized code causes segfaults on
 ARM due to missing frames

Two things

  1. Why do you not think the  patch is correct?  It works great for 
me.  Without
     that information, I can only respond with "I think you are wrong," 
and that
     is not productive.

  2. The comment in the patch you show is that the Profiler clobbers the 
Link
     Register.  That is NOT this problem.

In this problem, the profiler causes a segmentation fault when it reads 
the wrong
return address off the stack and uses it as an invalid function 
address.  It does
not use the link register value.

To reproduce the problem:

  - Build an arm-linux toolchain

  - Compile a program with optimization and profiling (try -O2 and -pg).

     - Make sure the program includes a function for which the optimizer
       drops its frame pointer (this can easily be verified by looking at
       the assembly output of the compiler).

  - Run the program.

If a trace is needed, I will be able to produce one within a few days
and provide an example.  Note that this problem was quite easy for me
to reproduce, so I would expect reproducing it to be simple enough for
others.

Let me know if you have trouble reproducing it.

rearnsha at gcc dot gnu dot org wrote:

>------- Additional Comments From rearnsha at gcc dot gnu dot org  2004-12-13 11:44 -------
>I don't think that patch is correct.  Please try the one from bug 3724:
>
>http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/linux-elf.h.diff?cvsroot=gcc&r1=1.39&r2=1.40
>
>Also, please add a testcase if you want further investigation.
>
>



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18929


  parent reply	other threads:[~2004-12-13 15:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-10 18:16 [Bug c/18929] New: " opensource at artnaseef dot com
2004-12-10 18:19 ` [Bug c/18929] " opensource at artnaseef dot com
2004-12-10 18:20 ` [Bug target/18929] " pinskia at gcc dot gnu dot org
2004-12-10 18:40 ` opensource at artnaseef dot com
2004-12-13 11:44 ` rearnsha at gcc dot gnu dot org
2004-12-13 15:28 ` opensource at artnaseef dot com [this message]
2004-12-13 15:46   ` Richard Earnshaw
2004-12-13 15:36 ` pinskia at gcc dot gnu dot org
2004-12-13 15:43 ` rearnsha at gcc dot gnu dot org
2004-12-13 15:56 ` opensource at artnaseef dot com

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=20041213152816.29942.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).