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:56:00 -0000 [thread overview]
Message-ID: <20041213155600.25949.qmail@sourceware.org> (raw)
In-Reply-To: <20041210181625.18929.opensource@artnaseef.com>
------- Additional Comments From opensource at artnaseef dot com 2004-12-13 15:55 -------
Subject: Re: Profiling optimized code causes segfaults on
ARM due to missing frames
Alright, since my instructions are not good enough for you, I will
put together an example.
rearnsha at gcc dot gnu dot org wrote:
>------- Additional Comments From rearnsha at gcc dot gnu dot org 2004-12-13 15:43 -------
>Subject: Re: Profiling optimized code causes segfaults
> on ARM due to missing frames
>
>On Mon, 2004-12-13 at 15:28, opensource at artnaseef dot com wrote:
>
>>------- 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.
>>
>>
>Because I don't think profiling should need the a frame pointer to
>work. If it does, then my feeling is that it's the profiling code
>that's broken, not the compiler. The layout of a stack frame is private
>to the function that built it, and any code outside of that function
>that tries to probe it is simply broken.
>
>
>> 2. The comment in the patch you show is that the Profiler clobbers the
>>Link
>> Register. That is NOT this problem.
>>
>>
>
>Well, that patch was never applied to the 3.3 branch. The bug it refers
>to was reported against 3.0, so there's a strong likelihood that it will
>be needed in 3.3 as well.
>
>
>>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.
>>
>
>I'm not in the business of trying to second guess how you encountered a
>problem. If you want us to investigate a bug then you need to send us
>precise instructions (including source code) so that we can reproduce
>it.
>
>
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18929
prev parent reply other threads:[~2004-12-13 15:56 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
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 [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=20041213155600.25949.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).