[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug in ppc version of gcc-4.[01]



Hi,

is the bug #355721 a compiler bug? I've inspected the program with
valgrind, but couldn't find any clue of a bug in the code.

I've took a look on it with gdb and this is the code after the return:

here the return value 0 gets loaded:

<crm_expr_markov_classify+10748>:    li      r9,0
<crm_expr_markov_classify+10752>:    addis   r7,r31,5
<crm_expr_markov_classify+10756>:    stw     r9,-10184(r7)
<crm_expr_markov_classify+10760>:    addis   r7,r31,5
<crm_expr_markov_classify+10764>:    lwz     r0,-10184(r7)
<crm_expr_markov_classify+10768>:    mr      r3,r0
<crm_expr_markov_classify+10772>:    lwz     r11,0(r1)
<crm_expr_markov_classify+10776>:    lwz     r0,4(r11)

here the return address register gets overwritten:

<crm_expr_markov_classify+10780>:    mtlr    r0
<crm_expr_markov_classify+10784>:    lwz     r27,-36(r11)
<crm_expr_markov_classify+10788>:    lwz     r28,-32(r11)
<crm_expr_markov_classify+10792>:    lwz     r29,-28(r11)
<crm_expr_markov_classify+10796>:    lwz     r31,-20(r11)
<crm_expr_markov_classify+10800>:    lfd     f30,-16(r11)
<crm_expr_markov_classify+10804>:    lfd     f31,-8(r11)
<crm_expr_markov_classify+10808>:    mr      r1,r11

and here the SIGSEG raises:

<crm_expr_markov_classify+10812>:    blr

The sigseg raises at the end of a really big function (~1500 line of code)
which alloces heavily locale variables. Is it possible gcc overwrites
neccessary data within the function while calling a subfunction?

The sigseg does not occur (with the message used in the bug report, but
with another mail) when I remove the last parameter of the sprintf call
in crm_markovian.c:2078

sprintf (buf, 
	"#%ld (%s):"\
	" features: %ld, hits: %ld, prob: %3.2e,\n", 
	k,
	hashname[k],
	fcounts[k],
	totalhits[k],
	ptc[k]
	  );

I find this really, really confusing. What can I do to catch this bug?

Kind regards, Jörg.
-- 
Wer eher stirbt ist länger tot.
    	 	    	       			(Un B. Kant)

Attachment: pgprJ1byoeZag.pgp
Description: PGP signature


Reply to: