[Libguestfs] [PATCH 1/3] builder: make the C index parser reentrant

Richard W.M. Jones rjones at redhat.com
Sat Mar 29 15:11:07 UTC 2014


On Sat, Mar 29, 2014 at 12:31:24PM +0000, Richard W.M. Jones wrote:
> On Wed, Mar 19, 2014 at 05:53:09PM +0100, Pino Toscano wrote:
> > Switch the lex/yacc parser into reentrant mode, to ease the handling of
> > parsing-specific data; introduce a new parser_context struct for that,
> > which is added as extra data to the parser.
> > 
> > This should cause no behaviour changes in the parsing, just no more
> > global variables used for getting data in/out the parser.
> > +%code requires {
> > +#include "index-parse.h"
> 
> There's a strange problem here with old Bison in Gentoo:
> 
>   CC       virt_index_validate-index-parse.o
> In file included from index-parse.y:61:0,
>                  from index-parse.y:61,
>                  from index-parse.y:61,
>                  from index-parse.y:61,
>                  from index-parse.y:61,
>                  from index-parse.y:61,
> [etc]
> 
> Basically index-parse.h includes itself.
> 
> This seems to be fixed somewhere between Bison 2.4.3 and Bison 2.7.
> In 2.7, Bison adds a #ifndef/#define to prevent recursive includes.
> 
> RHEL 6 bison 2.4.1 is < 2.4.3, but for reasons I don't quite
> understand doesn't appear to be affected.

Turns out it *does* affect RHEL 6.  I didn't see the problem because I
didn't sufficiently 'make clean'.

I pushed this which fixes it for me on RHEL 6 & Fedora 20:

https://github.com/libguestfs/libguestfs/commit/eff7aed6cfc24c1d605578f738a0d76112d9966b

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW




More information about the Libguestfs mailing list