stap from CVS on Fedora 8 x86_64 > stap probepoint08.stp Segmentation fault
> stap from CVS on Fedora 8 x86_64 > > > stap probepoint08.stp > Segmentation fault I can also reproduce it. Seems that stap can't handle the unexpected end of file well. Created a short patch for it. Please review it. --- src/parse.cxx 2007-12-12 09:07:12.000000000 -0500 +++ src.new/parse.cxx 2007-12-12 09:00:36.000000000 -0500 @@ -1343,14 +1343,14 @@ parser::parse_probe_point () { next (); t = peek (); - if (! (t->type == tok_operator && t->content == "(")) + if (t && ! (t->type == tok_operator && t->content == "(")) throw parse_error ("expected '('"); next (); pl->condition = parse_expression (); t = peek (); - if (! (t->type == tok_operator && t->content == ")")) + if (t && ! (t->type == tok_operator && t->content == ")")) throw parse_error ("expected ')'"); next ();
Nice patch, thanks.
(In reply to comment #1) > > stap from CVS on Fedora 8 x86_64 > > > > > stap probepoint08.stp > > Segmentation fault > > I can also reproduce it. Seems that stap can't handle the unexpected end of file > well. > > Created a short patch for it. Please review it. This patch will report "expected '('" error, but I think 'unexpected eof' error is better.
(In reply to comment #3) > This patch will report "expected '('" error, > but I think 'unexpected eof' error is better. The complete message should already say something like "encountered EOF, expected '('".
(In reply to comment #4) > The complete message should already say something like > "encountered EOF, expected '('". Sure, I just mentioned about the consistency of error messages. (comparing the output of 'probe p if' and 'probe p { if'.) Anyway, it's trivial. Now the segmentation fault bug was fixed. Thank you Wenji.
Sorry, I was misunderstanding your patch. It causes 'unexpecetd eof' correctly.
Works for me. I also checked in testsuite changes to detect stap crashing and mark those tests as failed.