Segfault in cairo when running `-variant shogi`

Adrian Petrescu <[email protected]> Fri, 22 Dec 2017 14:37:18 -0500
Newsgroups gmane.comp.gnu.xboard.devel
Message-ID <CAFaB7RZ2b5ZJSagbFVHjUrsx=0frP0JUgdkmQ=axzmKHYahpmw@mail.gmail.com>
--f403043da9fcd9f5920560f2f14e
Content-Type: text/plain; charset="UTF-8"

On a freshly-compiled copy of master (as well as the latest stable
release), running:

$ xboard -ncp -variant shogi -pieceImageDirectory
/usr/share/games/xboard/themes/shogi

will cause a segmentation fault about 50% of the time, immediately after
starting up:

xboard: cairo-pattern.c:187: _cairo_pattern_set_error: Assertion `status <
CAIRO_STATUS_LAST_STATUS' failed.
[1]    24423 abort (core dumped)  xboard -ncp -variant shogi
-pieceImageDirectory

The other 50% of the time it appears to work fine.

The crash ONLY happens when running -variant shogi, never in normal chess
mode.

When I tried compilng with CFLAGS="-g -O0" so that I can try gdb'ing it, it
stops happening completely. Together with the 50% intermittentness of the
original crash, I'm thinking it's some sort of race condition in Cairo.

My system is:

$ uname -a
Linux halmos 4.14.8-1-ck-haswell #1 SMP PREEMPT Wed Dec 20 09:57:13 EST
2017 x86_64 GNU/Linux

Let me know if there's any other information I can provide that would be
helpful :)

Cheers,
Adrian

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

<div dir=3D"ltr">On a freshly-compiled copy of master (as well as the lates=
t stable release), running:<br><font face=3D"monospace, monospace"><br>$ xb=
oard -ncp -variant shogi -pieceImageDirectory /usr/share/games/xboard/theme=
s/shogi</font><div><br></div><div>will cause a segmentation fault about 50%=
 of the time, immediately after starting up:</div><div><br></div><div><div>=
<font face=3D"monospace, monospace">xboard: cairo-pattern.c:187: _cairo_pat=
tern_set_error: Assertion `status &lt; CAIRO_STATUS_LAST_STATUS&#39; failed=
.</font></div><div><font face=3D"monospace, monospace">[1]=C2=A0 =C2=A0 244=
23 abort (core dumped)=C2=A0 xboard -ncp -variant shogi -pieceImageDirector=
y=C2=A0</font></div></div><div><br></div><div>The other 50% of the time it =
appears to work fine.</div><div><br></div><div>The crash ONLY happens when =
running <font face=3D"monospace, monospace">-variant shogi</font>, never in=
 normal chess mode.</div><div><br></div><div>When I tried compilng with <fo=
nt face=3D"monospace, monospace">CFLAGS=3D&quot;-g -O0&quot;</font>=C2=A0so=
 that I can try gdb&#39;ing it, it stops happening completely. Together wit=
h the 50% intermittentness of the original crash, I&#39;m thinking it&#39;s=
 some sort of race condition in Cairo.</div><div><br></div><div>My system i=
s:</div><div><font face=3D"monospace, monospace"><br></font></div><div><fon=
t face=3D"monospace, monospace">$ uname -a</font></div><div><div><font face=
=3D"monospace, monospace">Linux halmos 4.14.8-1-ck-haswell #1 SMP PREEMPT W=
ed Dec 20 09:57:13 EST 2017 x86_64 GNU/Linux</font></div></div><div><br></d=
iv><div>Let me know if there&#39;s any other information I can provide that=
 would be helpful :)</div><div><br></div><div>Cheers,</div><div>Adrian</div=
></div>

--f403043da9fcd9f5920560f2f14e--