|
From: Yao Qi <qiy...@cn...> - 2005-11-15 06:55:00
|
On Mon, Nov 14, 2005 at 12:44:10PM +0000, Julian Seward wrote:
>
> > - fix none/tests/ppc32/jm-insns.c so it works with gcc4.
>
> It compiles OK with gcc4, but segfaults due for no obvious reason.
> I think it is due somehow to the use of global register variables
> in an unsafe way (basically the program is clever but the implementation
> is unsafe).
I run jm-insns compiled by GCC-4.1.0, and this is the output,
[qiyao@linux valgrind]$
VALGRIND_LIB=/home/qiyao/svn/valgrind/.in_place ./coregrind/valgrind
--tool=none none/tests/ppc32/jm-insns
PPC integer compare with immediate insns (two args):
copy func cmpi from 0x10000ec0 to 0xfeffe454 (9421fff0 93e1000c)
=> func cmpi from 0xfeffe454 to 0xfeffe454 (94210000 93e1000c)
disInstr(ppc32): unhandled instruction: 0x0
primary 0(0x0), secondary 0(0x0)
==10717== Your program just tried to execute an
instruction that Valgrind
==10717== did not recognise. There are two possible
reasons for this.
==10717== 1. Your program has a bug and erroneously
jumped to a non-code
==10717== location. If you are running Memcheck
and you just saw a
==10717== warning about a bad jump, it's probably
your program's fault.
==10717== 2. The instruction is legitimate but
Valgrind doesn't handle it,
==10717== i.e. it's Valgrind's fault. If you think
this is the case or
==10717== you are not sure, please let us know.
==10717== Either way, Valgrind will now raise a SIGILL
signal which will
==10717== probably kill your program.
==10717==
==10717== Process terminating with default action of
signal 4 (SIGILL)
==10717== Illegal opcode at address 0xFEFFE45C
==10717== at 0xFEFFE45C: ???
==10717== by 0x10003440: test_int_one_reg_imm16
(jm-insns.c:3942)
==10717== by 0x10003440: test_int_one_reg_imm16
(jm-insns.c:3942)
==10717== by 0x10003440: test_int_one_reg_imm16
(jm-insns.c:3942)
==10717== by 0x10003440: test_int_one_reg_imm16
(jm-insns.c:3942)
==10717== by 0x10003440: test_int_one_reg_imm16
(jm-insns.c:3942)
==10717== by 0x10003440: test_int_one_reg_imm16
(jm-insns.c:3942)
==10717== by 0x10003440: test_int_one_reg_imm16
(jm-insns.c:3942)
==10717== by 0x10003440: test_int_one_reg_imm16
(jm-insns.c:3942)
==10717== by 0x10003440: test_int_one_reg_imm16
(jm-insns.c:3942)
==10717== by 0x10003440: test_int_one_reg_imm16
(jm-insns.c:3942)
==10717== by 0x10003440: test_int_one_reg_imm16
(jm-insns.c:3942)
==10717==
Illegal instruction
Do you mean this is a "segfault"? I am not sure whether I am on a
right track.
>
> > Maybe I could code patch on this to move all the declarations in front
> > of statements to remove all the compiler warnings, any thought on this?
>
> That would be good. Even better if you can fix it to remove the
> segfaults.
It seem that code in test_int_one_reg_imm16 makes some trouble for me,
3938 func_buf[1] = p[1];
3939 patch_op_imm16(func_buf, p, ii16[j]);
3940 func = (void *)func_buf;
......
......
3955 (*func)();
This program received a signal SIGILL(Illegal instruction) when it
executed at line 3955. I am not sure of the purpose of this slice of
code, I guess these are done on purpose, but I can't make out exactly.
This test works util I remove all the tests about immediate args from
all_tests[]. Would any one have a look? Any suggestions are highly
appreciated!
>
> J
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server. Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Valgrind-developers mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-developers
>
--
Regards, Yao
------------
Yao Qi
|