[postgis-devel] test failure on WKT parser rebuild

Sandro Santilli strk at keybit.net
Fri Sep 5 06:56:05 PDT 2014


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"
  ^^^^^^^^^^^^^

--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;
> 
>  ()  ASCII ribbon campaign  --  Keep it simple !
>  /\  http://strk.keybit.net/rants/ascii_mails.txt  

-- 

 ()  ASCII ribbon campaign  --  Keep it simple !
 /\  http://strk.keybit.net/rants/ascii_mails.txt  



More information about the postgis-devel mailing list