Re: Invalid inputs FAILED (input.at:102) on Solaris

Martin Rehak <[email protected]>
Newsgroups gmane.comp.parsers.bison.bugs
Message-ID <[email protected]>
Hi Akim,

On November 25, 2020 8:00 am Akim Demaille wrote:
> Hi Martin,
> 
>> Le 24 nov. 2020 à 11:35, Martin Rehak <[email protected]> a écrit :
>> 
>> Hi Akim,
>> 
>>> As you can see in the od output, I do get the NUL byte in the quoted
>>> source line:
>>> 
>>> 0000060  sp  sp  sp   1  sp   |  sp ***nul***  nl  sp  sp  sp  sp  sp  sp   |
>>> 
>>> Do you have it too?
>> 
>> Yes, I have if I use C locales:
>> 
>> $ LC_ALL=C ./src/bison -fcaret /tmp/foo.y 2>&1 | xxd
>> 00000000: 2f74 6d70 2f66 6f6f 2e79 3a31 2e31 3a20  /tmp/foo.y:1.1: 
>> 00000010: 6572 726f 723a 2069 6e76 616c 6964 2063  error: invalid c
>> 00000020: 6861 7261 6374 6572 3a20 275c 3027 0a20  haracter: '\0'. 
>> 00000030: 2020 2031 207c 2000 0a20 2020 2020 207c     1 | ..      |
>> 00000040: 205e 0a                                   ^.
> 
> Yes, I can see it, it seems correct.
> 
> 
>> And it is slightly different to what I get if I use (my default) 
>> en_US.UTF-8:[...]
>> But it still fails even if I use:
>> 
>> $ /usr/bin/env LC_ALL=C /usr/gnu/bin/make check
>> 
>> Any hint, please?
> 
> The test suite runs with LC_ALL=C already, this is not needed.
> 
> So it may well be that the problem is actually the perl snippet I
> used to "reveal" the invalid characters.  Please try this:
> 
> $ printf "\0\n" > /tmp/foo.y
> $ LC_ALL=C ./src/bison -fcaret /tmp/foo.y >/tmp/foo.log 2>&1
> $ perl -p -e 's{([\0\377])}{sprintf "\\x%02x", ord($1)}ge' /tmp/foo.log
> /tmp/foo.y:1.1: error: invalid character: '\0'
>     1 | \x00
>       | ^

Strange, absolutely same output:

$ printf "\0\n" > /tmp/foo.y
$ LC_ALL=C ./src/bison -fcaret /tmp/foo.y >/tmp/foo.log 2>&1
?1$ xxd /tmp/foo.log
00000000: 2f74 6d70 2f66 6f6f 2e79 3a31 2e31 3a20  /tmp/foo.y:1.1: 
00000010: 6572 726f 723a 2069 6e76 616c 6964 2063  error: invalid c
00000020: 6861 7261 6374 6572 3a20 275c 3027 0a20  haracter: '\0'. 
00000030: 2020 2031 207c 2000 0a20 2020 2020 207c     1 | ..      |
00000040: 205e 0a                                   ^.
$ perl -p -e 's{([\0\377])}{sprintf "\\x%02x", ord($1)}ge' /tmp/foo.log
/tmp/foo.y:1.1: error: invalid character: '\0'
    1 | \x00
      | ^

In case you are not happy with debugging this case (and I would 
understand it) is there a way how to disable it?

Otherwise I am fine to assist you in digging further. Any other hint, 
please?

Thank you
-- 
m.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.