This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/18929] Profiling optimized code causes segfaults on ARM due to missing frames
- From: "opensource at artnaseef dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Dec 2004 15:28:16 -0000
- Subject: [Bug target/18929] Profiling optimized code causes segfaults on ARM due to missing frames
- References: <20041210181625.18929.opensource@artnaseef.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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