|How to restart FLEX scanners? email@example.com (1999-02-03)|
|Re: How to restart FLEX scanners? firstname.lastname@example.org (1999-02-12)|
|Re: How to restart FLEX scanners? email@example.com (1999-02-16)|
|Re: How to restart FLEX scanners? firstname.lastname@example.org (1999-02-18)|
|From:||email@example.com (Joe English)|
|Date:||18 Feb 1999 10:47:19 -0500|
|Organization:||Advanced Rotorcraft Technology, Inc.|
A couple of weeks ago, I wrote:
>I have an interactive parser built with lex/yacc that I'm trying to
>port to flex. It's giving me considerable problems.
>Everything seems to work fine so far [...] But if main() calls
>parse_file() a second time, the program invariably gets a segmentation
>fault somewhere in the bowels of malloc() or free().
>This indicates that somebody is scribbling over memory that they
Then rather self-assuredly stated:
> I suspect that yylex() is the culprit, since this code has been in
> production for several years (using stock lex on several different
> Unices) with no problems.
A colleague just introduced me to Electric Fence, which turned up the
actual source of the problem in about 30 seconds. It had nothing to
do with FLEX, it was a long-standing bug elsewhere in the code
(fclose()ing the same FILE * twice) that somehow managed to escape
detection up 'til now. After fixing that, the problem went away.
My apologies for bothering you :-)
[About three times a week I get messages from people who are sure they've
found a lex or yacc bug because their program crashes. It's always a
pointer bug somewhere. -John]
Return to the
Search the comp.compilers archives again.