[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 11:16:52 PST 2010


I can't find the log in this, but I think that you are complicating it by
trying to use autoconf. First just try building the library manually. The
ANTLR build invokes the misguided and convoluted libtool to build the DLL
because autoconf expects that, but you can just make the .so file yourself.
Also check the ldd for your library etc. I don't really have time to go
through all your autoconf stuff, but I doubt that there is a bug in the
ANTLR stuff as lots of people are using shared objects on everything from
Linux to AIX, including myself.

Check the link options are the same as the ANTLR build and that your
LD_LIBRARY_PATH is correct and so on.

Jim

> -----Original Message-----
> From: Joost Kraaijeveld [mailto:jrkraaijeveld at gmail.com]
> Sent: Wednesday, November 10, 2010 10:58 AM
> To: Jim Idle
> Cc: antlr-interest at antlr.org
> Subject: Re: [antlr-interest] Antlr 3.2 C-target lexer/parser in exe
> works, crashes in library
> 
> Hi Jim,
> 
> On 10/11/10 18:58, Jim Idle wrote:
> > 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.
> 
> I am sorry to say but valgrind is not telling anyting: with valgrind
> the program runs OK and it just mentions that there are a lot of memory
> leaks which seems reasonable because I do not release anything (nor
> allocate allocate anything with new or malloc for that part). I also do
> not release or reuse the input file.
> 
> Actually the program does not contain much code that is written by
> myself. The grammar has some calls to functions embedded that just
> print the thing that are recognised. And is in calling one of the 4
> functions that the program crashes.
> 
> I really think that there is a hidden "you should know this when you
> embed antlr in a library" thing that I am not aware of or that there is
> something else ( I don't like to shout bug :-))
> 
> I attached my valgrind log and again mention
> http://trac.askesis.nl/downloads/AntlrProblem.tar.bz2 in the hope that
> you can help me to find the problem.
> 
> 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



More information about the antlr-interest mailing list