Re: issue saving a game

Antonio Ceballos <[email protected]> Fri, 23 Oct 2020 20:16:41 +0200
Newsgroups gmane.comp.gnu.chess.bugs
Message-ID <CAO7R9g__Aomw6B5-A0ue_zjD+WBckCA43mOYBWR=t6oLKk31ZA@mail.gmail.com>
--000000000000bca37c05b25a95d3
Content-Type: text/plain; charset="UTF-8"

I could not reproduce the bug on Ubuntu 16.04, but I could on Debian 10.6.

I have verified Simon's patch and I think it is fine and fixes the bug.

Therefore, I have uploaded the change to the subversion repository in
Savannah. It will be included in the next release, 6.2.8, which may still
take a few weeks.

Antonio


On Sat, Oct 10, 2020 at 10:12 AM <[email protected]> wrote:

> This seems to be FORTIFY_SOURCE compiler flag. Debian sets level 2, but
> just level 1 triggers it.
>
> The code uses sprintf to concatenate strings which is "undefined"
> behaviour, the offending code is flagged by enabling all compiler warnings
> when building pgn.cc
>
> This explains why it wasn't caught in development. I've sent patch to
> Antonio which fixes it, but he should probably be skeptical as I've not
> done C/C++ for years, and haven't fixed related warning elsewhere. If we
> are using C++ we should probably consider using C++ output features, and
> definitely enabling all warnings and including FORTIFY_SOURCE level 2 as
> this is how the distros roll.
>

--000000000000bca37c05b25a95d3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-size:small">I c=
ould not reproduce the bug on Ubuntu 16.04, but I could on Debian 10.6.<br>=
</div><div class=3D"gmail_default" style=3D"font-size:small"><br></div><div=
 class=3D"gmail_default" style=3D"font-size:small"><div class=3D"gmail_defa=
ult" style=3D"font-size:small">I have verified Simon&#39;s patch and I thin=
k it is fine and fixes the bug.</div><div class=3D"gmail_default" style=3D"=
font-size:small"><br></div></div><div class=3D"gmail_default" style=3D"font=
-size:small">Therefore, I have uploaded the change to the subversion reposi=
tory in Savannah. It will be included in the next release, 6.2.8, which may=
 still take a few weeks.</div><div class=3D"gmail_default" style=3D"font-si=
ze:small"><br></div><div class=3D"gmail_default" style=3D"font-size:small">=
Antonio</div><div class=3D"gmail_default" style=3D"font-size:small"><br></d=
iv></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_att=
r">On Sat, Oct 10, 2020 at 10:12 AM &lt;<a href=3D"mailto:simon@technocool.=
net">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,20=
4,204);padding-left:1ex"><div dir=3D"auto">This seems to be FORTIFY_SOURCE =
compiler flag. Debian sets level 2, but just level 1 triggers it.<div dir=
=3D"auto"><br></div><div dir=3D"auto">The code uses sprintf to concatenate =
strings which is &quot;undefined&quot; behaviour, the offending code is fla=
gged by enabling all compiler warnings when building pgn.cc</div><div dir=
=3D"auto"><br></div><div dir=3D"auto">This explains why it wasn&#39;t caugh=
t in development. I&#39;ve sent patch to Antonio which fixes it, but he sho=
uld probably be skeptical as I&#39;ve not done C/C++ for years, and haven&#=
39;t fixed related warning elsewhere. If we are using C++ we should probabl=
y consider using C++ output features, and definitely enabling all warnings =
and including FORTIFY_SOURCE level 2 as this is how the distros roll.</div>=
</div></blockquote></div>

--000000000000bca37c05b25a95d3--