[postgis-devel] test failure on WKT parser rebuild

Sandro Santilli strk at keybit.net
Fri Sep 5 07:42:58 PDT 2014


On Fri, Sep 05, 2014 at 03:56:05PM +0200, Sandro Santilli wrote:
> It looks like the "last_column" of the YYLTYPE struct is never
> initialized to 0 on lwgeom_parse_wkt call. Dunno if that's supposedly
> done by the code generated by bison.
> 
> According to the manual page it looks like omitting the definition
> of the YYLTYPE struct should result in automatic initialization:
> https://www.gnu.org/software/bison/manual/html_node/Location-Type.html#Location-Type
> 
> But I'm not seeing that happening for me.
> Manually initializing the fields fixes the issue.
> 
> I dunno if this warning may be related:
> 
>  bison -y -o'lwin_wkt_parse.c' -d lwin_wkt_parse.y
>  lwin_wkt_parse.y:110.1-13: warning: deprecated directive, use ‘%name-prefix’ [-Wdeprecated]
>   %name-prefix="wkt_yy"
>   ^^^^^^^^^^^^^

The above is unrelated as I get the same failure by using the correct syntax:

 %name-prefix "wkt_yy"

Or the new one:

 %define api.prefix {wkt_yy}

I've committed a manual initialization of the YYLTYPE struct as of r12946.
As I was at it, I also fixed "'input' defined but not used" with r12945
and "deprecated directive, use ‘%name-prefix’" with r12947.

The parser files now generate with no warnings with GNU bison 3.0.2 and
flex 2.5.35, the build of liblwgeom is also warning-clean and the testsuite
passes.

But I did not commit re-generated parser files in case anything else
needs to be tweaked to be compatible with older versions, so I'd ask:
could you please try the changes locally ? It'd be a matter of running:

  make -C liblwgeom/ parser all 2> ERR && make check 

The return code of the pipeline shall be zero and ERR shall be empty

--strk;

> On Fri, Sep 05, 2014 at 12:48:33PM +0200, Sandro Santilli wrote:
> > I'm getting weird (unstable) failures on rebuilding the WKT parser.
> > Under liblwgeom:
> > 
> >  Run Summary:    Type  Total    Ran Passed Failed Inactive
> >                suites     32     32    n/a      0        0
> >                 tests    214    214    213      1        0
> >               asserts   1901   1901   1900      1      n/a
> > 
> > Under liblwgeom/cunit:
> > 
> >  $ ./cu_tester  | grep FAILED
> >  Test: test_wkt_in_errlocation ...FAILED
> > 
> >  $ ./cu_tester test_wkt_in_errlocation
> >  Running test 'test_wkt_in_errlocation' in suite 'in_wkt'.
> >     PASSED - asserts -   2 passed,   0 failed,   2 total.
> > 
> >  $ ./cu_tester in_wkt
> >  Running all tests in suite 'in_wkt'.
> >     FAILED -   tests -  14 passed,   1 failed,  15 total.
> >            - asserts -  73 passed,   1 failed,  74 total.
> >     1. cu_in_wkt.c:341  - fabs(12 - p.errlocation) < 1.5
> > 
> > It is weird that running the specific failing test does not
> > give a failure, while running it in it's enterety does.
> > Valgrind doesn't report any error.
> > The problem does not occur with the parser included in the
> > repository.
> > 
> > I'm using bison (GNU Bison) 3.0.2 and flex 2.5.35.
> > 
> > Can anyone reproduce the problem ?
> > 
> > PS: you rebuild the parsers with "make parser" under liblwgeom/ dir.
> > 
> > --strk;



More information about the postgis-devel mailing list