[tex-live] Advice on debugging segfault in luatex (2017 source, gcc-7.1) ?

Ken Moffat zarniwhoop at ntlworld.com
Wed May 24 05:10:45 CEST 2017

On Mon, May 22, 2017 at 10:29:16PM +0100, Ken Moffat wrote:
> On Mon, May 22, 2017 at 06:29:02PM +0900, Akira Kakuto wrote:
> > > At least ^D works there, but can somebody give me hints about how to
> > > run this test / where to run it from, please ?
> > 
> > What about
> > 
> > #
> > # change $YOUR appropriately
> > #
> > export TEXMFCNF=$YOUR/texlive-build/texk/kpathsea
> > export TEXINPUTS=$YOUR/texlive-build/texk/web2c/tests:$YOUR/texlive-build/texk/web2c/luatexdir/tests
> > export TEXFORMATS=.
> > ./luatex -ini luaimage
> > 

> Thanks.  Didn't quite work out like that, but the segfault is when
> it closes - didn't notice that last night - so even after an error
> it still faults.  Got the backtrace.
So, I got absolutely nowhere in working out what exactly in gcc-7.1
breaks this.  I also tried to build 2016, that passes all its tests.

Looking at the trace, something in the lua area seems to be
miscompiled by gcc-7.1.  The good news is that detuning CFLAGS to -O
(instead of -O2 which is the default and what I too prefer) makes
luatex work.

I looked at the documented changes for gcc-7.1: -fstore-merging and
-fcode-hoisting are both on for -O2 (and -Os), but turning both of
them off had no effect.  No other new optimizations are mentioned in
the defaults.  I then tried changing
source/libs/lua52/Makefile.in to add -O at the end of the CFLAGS but
that appeared to have no effect.

So for the moment I'm building the whole thing with -O and all my
own tests work.  I already feel as if I'm too far out and not waving
but drowning, so I don't plan to try to work out where it goes wrong
(I have a hate / hate relationship with gdb).  Sorry.

But if anyone else wants to build from source on gcc-7.1, this might

I live in a city. I know sparrows from starlings.  After that
everything is a duck as far as I'm concerned.  -- Monstrous Regiment

More information about the tex-live mailing list