[tex-live] [Dev-luatex] segfault on build-testing luatex

luigi scarso luigi.scarso at gmail.com
Mon Aug 7 20:01:49 CEST 2017


On Mon, Aug 7, 2017 at 4:17 PM, Norbert Preining <preining at logic.at> wrote:
>> Related to gcc-7.1?
>> http://tug.org/pipermail/tex-live/2017-June/040192.html
>
> Ahh, sounds reasonable .



OK I see it with gcc 7.1 and -O3 , but not with -O0

It happens when luatex exits and closes the state L;
the garbage collector calls the pending finalizers and luaffi fails.
I am working on the luaffi code,  it could be that will aply the patch.


(gdb) fr 1
#1  check_cdata (L=L at entry=0x30e8b90, idx=idx at entry=1,
ct=ct at entry=0x7fff8b5aed30) at
../../../source/texk/web2c/luatexdir/luaffi/ctype.c:266
266    void* p = to_cdata(L, idx, ct);
(gdb) fr 2
#2  0x00000000006845d5 in cdata_gc (L=0x30e8b90) at
../../../source/texk/web2c/luatexdir/luaffi/ffi.c:1429
1429    check_cdata(L, 1, &ct);
(gdb) fr 3
#3  0x00000000006a9ea8 in luaD_precall (L=L at entry=0x30e8b90,
func=<optimized out>, nresults=0) at
../../../source/libs/lua52/lua52-src/src/ldo.c:319
319      n = (*f)(L);  /* do the actual call */
(gdb) fr 4
#4  0x00000000006aa582 in luaD_call (L=0x30e8b90, func=<optimized
out>, nResults=<optimized out>, allowyield=<optimized out>) at
../../../source/libs/lua52/lua52-src/src/ldo.c:401
401  if (!luaD_precall(L, func, nResults))  /* is a Lua function? */
(gdb) fr 5
#5  0x00000000006a9599 in luaD_rawrunprotected (L=0x30e8b90,
f=0x6abc30 <dothecall>, ud=0x0) at
../../../source/libs/lua52/lua52-src/src/ldo.c:131
131  LUAI_TRY(L, &lj,
(gdb) fr 6
#6  0x00000000006aa933 in luaD_pcall (L=L at entry=0x30e8b90,
func=func at entry=0x6abc30 <dothecall>, u=u at entry=0x0, old_top=896,
ef=ef at entry=0) at ../../../source/libs/lua52/lua52-src/src/ldo.c:603
603  status = luaD_rawrunprotected(L, func, u);
(gdb) fr 7
#7  0x00000000006ad750 in GCTM (propagateerrors=0, L=0x30e8b90) at
../../../source/libs/lua52/lua52-src/src/lgc.c:824
824    status = luaD_pcall(L, dothecall, NULL, savestack(L, L->top - 2), 0);
(gdb) fr 8
#8  callallpendingfinalizers (propagateerrors=<optimized out>,
L=<optimized out>) at
../../../source/libs/lua52/lua52-src/src/lgc.c:978
978    GCTM(L, propagateerrors);
(gdb) fr 9
#9  luaC_freeallobjects (L=L at entry=0x30e8b90) at
../../../source/libs/lua52/lua52-src/src/lgc.c:988
988  callallpendingfinalizers(L, 0);
(gdb) fr 10
#10 0x00000000006b7677 in close_state (L=0x30e8b90) at
../../../source/libs/lua52/lua52-src/src/lstate.c:226
226  luaC_freeallobjects(L);  /* collect all objects */
(gdb) fr 11
#11 lua_close (L=0x30e8b90) at
../../../source/libs/lua52/lua52-src/src/lstate.c:320
320  close_state(L);
(gdb) fr  12
#12 0x0000000000476ff6 in do_final_end () at
../../../source/texk/web2c/luatexdir/tex/errors.w:223
223    lua_close(Luas); /* new per 0.99 */
(gdb) fr 13
#13 0x0000000000447abe in main (ac=<optimized out>, av=<optimized
out>) at ../../../source/texk/web2c/luatexdir/luatex.c:582
582    main_body();

-- 
luigi


More information about the tex-live mailing list