[antlr-interest] Antlr 3.2 C-target lexer/parser in exe works, crashes in library

Jim Idle jimi at temporal-wave.com
Wed Nov 10 09:58:40 PST 2010


Keep going with valgrind, but this is either that you are releasing and then
reusing your input file or have not allocated enough memory or something
similar. Look at the output of valgrind closely as it is probably telling
you what you are doing wrong.

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Joost Kraaijeveld
> Sent: Monday, November 08, 2010 10:48 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] Antlr 3.2 C-target lexer/parser in exe works,
> crashes in library
> 
> [Note: this is the fourth attempt to post this message so it may appear
> multiple times. Sorry about that.]
> 
> Hi,
> 
> I have a grammar that works OK if the parser and lexer are in the
> executable but that crashes if the parser and lexer are in a library.
> Parsing small files goes OK, but larger files crash. I don't have a
> clue why it does not work. I am hoping that someone is kind enough to
> help with this. Any suggestions are *very* welcome.
> 
> Running the program in GDB crashes (but I cannot find the problem using
> GDB, and believe I have tried).  Running the program with Valgrind does
> NOT crash. Another strange thing is that another grammar/parser/lexer
> using the same kind of setup does not give any problem.
> 
> I have created the smallest possible examples of both programs where
> the only difference is where parser and lexer are. Both programs are
> autotools-project that should work on any platform with autotools
> available. Antlr C-target runtime 3.2 should be in the library path.
> Eclipse 3.6 project files are included.
> 
> A zipped file can be downloaded here:
> 
> http://trac.askesis.nl/downloads/AntlrProblem.tar.bz2
> 
> I also have available a SVN repository that contains the two projects:
> 
> http://trac.askesis.nl/svn/tidbits/AntlrBug/
> http://trac.askesis.nl/svn/tidbits/AntlrDllBug/
> 
> where the first is the all-in-executable and the second is the in-
> library project.
> 
> Running of the programs:
> 
> 1. Unzip the file in directory of choice. It contains the 2 projects.
> 2. For each project do:
> a. cd to the "build" of that project
> b. ../configure
> c. ./make
> d. ./exe/src/yat ../Danu.spec
> where
> ./exe/src/yat is the libtool executable
> ../Danu.spec is the file that should be parsed
> 
> One can comment out parts of the Danu.spec file using C-style "/**/" or
> C++-style "//" comments.
> 
> 
> TIA
> --
> Met vriendelijke groeten,
> 
> Joost Kraaijeveld
> Askesis B.V.
> Molukkenstraat 14
> 6524NB Nijmegen
> tel: 024-3888063 / 06-51855277
> fax: 024-3608416
> web: www.askesis.nl
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address



More information about the antlr-interest mailing list