|
From: Jeffrey S. <fe...@xi...> - 2003-05-08 22:40:22
Attachments:
suppfile-fix.patch
|
If the number of callers specified in the suppression rule is >= VG_N_SUPP_CALLERS, the parser gets confused. The attached patch fixes this condition. Jeff -- Jeffrey Stedfast Evolution Hacker - Ximian, Inc. fe...@xi... - www.ximian.com |
|
From: Nicholas N. <nj...@ca...> - 2003-05-12 19:59:50
|
On 8 May 2003, Jeffrey Stedfast wrote: > If the number of callers specified in the suppression rule is >= > VG_N_SUPP_CALLERS, the parser gets confused. > > The attached patch fixes this condition. I wouldn't say it gets confused; it's a syntax error, because suppressions don't support stack traces with more than four entries. Admittedly the error message isn't great, but I don't think this is a behaviour that needs fixing. N |
|
From: Jeffrey S. <fe...@xi...> - 2003-05-12 20:19:07
|
On Mon, 2003-05-12 at 15:59, Nicholas Nethercote wrote:
> On 8 May 2003, Jeffrey Stedfast wrote:
>
> > If the number of callers specified in the suppression rule is >=
> > VG_N_SUPP_CALLERS, the parser gets confused.
> >
> > The attached patch fixes this condition.
>
> I wouldn't say it gets confused; it's a syntax error, because
> suppressions don't support stack traces with more than four entries.
> Admittedly the error message isn't great, but I don't think this is a
> behaviour that needs fixing.
sure, except that it breaks on 4 callers ;-)
the current parser only accepts 3, the 4th line MUST be a "}" line or
the next pass thru the outer loop will encounter the "}" and abort since
it doesn't match "{"
for (i = 0; i < VG_N_SUPP_CALLERS; i++) {
eof = VG_(get_line) ( fd, buf, N_BUF );
if (eof) goto syntax_error;
if (i > 0 && STREQ(buf, "}"))
break;
supp->caller[i] = VG_(arena_strdup)(VG_AR_CORE, buf);
if (!setLocationTy(&(supp->caller[i]), &(supp->caller_ty[i])))
goto syntax_error;
}
note that if VG_N_SUPP_CALLERS == 4, then the loop only gets executed a
max of 4 times - meaning a max of 4 lines read. Since the only check for
the "}"-line is inside the loop, if that "}"-line isn't read by the 4th
line, then the parser will fail for that suppressions file.
example:
{
RuleName
skin:supp_kind
fun:foo i = 0
fun:bar i = 1
fun:baz i = 2
fun:func i = 3; last pass thru the loop.
} i = 4; oops. no pass thru the loop. line not
caught.
I guess another fix would be to just read a max of one more line after
the loop to check for the "}" (you wouldn't want to change the for-loop
to accept <= VG_N_SUPP_CALLERS or you could overflow the cllaers array).
Hope my explanation helps,
Jeff
>
> N
--
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fe...@xi... - www.ximian.com
|
|
From: Nicholas N. <nj...@ca...> - 2003-05-12 20:40:18
|
On 12 May 2003, Jeffrey Stedfast wrote: > > I wouldn't say it gets confused; it's a syntax error, because > > suppressions don't support stack traces with more than four entries. > > Admittedly the error message isn't great, but I don't think this is a > > behaviour that needs fixing. > > sure, except that it breaks on 4 callers ;-) Oh yeah. I've fixed it now in the HEAD, thanks. N |
|
From: Jeffrey S. <fe...@xi...> - 2003-05-12 20:42:06
|
awesome, thanks ;-) Jeff On Mon, 2003-05-12 at 16:40, Nicholas Nethercote wrote: > On 12 May 2003, Jeffrey Stedfast wrote: > > > > I wouldn't say it gets confused; it's a syntax error, because > > > suppressions don't support stack traces with more than four entries. > > > Admittedly the error message isn't great, but I don't think this is a > > > behaviour that needs fixing. > > > > sure, except that it breaks on 4 callers ;-) > > Oh yeah. I've fixed it now in the HEAD, thanks. > > N -- Jeffrey Stedfast Evolution Hacker - Ximian, Inc. fe...@xi... - www.ximian.com |