Hi Werner,

On Fri, 2025-04-04 at 05:16 +0000, Werner LEMBERG wrote:
> I've run `./build --debug` from the
> current luatex repository and copied the resulting binary into the
> TeXLive tree as `luahbtex`.  [I know that I haven't actually built
> `luahbtex` but this doesn't matter for the problem at hand

Running `./build.sh --debug --luahb` should also build luahbtex (but I
agree that it shouldn't matter here).

> #0  0x00007ffff7c9bb33 in freopen64 () from /lib64/libc.so.6
> #1  0x00007ffff7fbb574 in return_real_function (function=<optimized out>, 
> path=<optimized out>,
>     mode=<optimized out>, mode_str=<optimized out>, flags=<optimized out>, 
> stream=<optimized out>)
>     at open-funs.c:291
> #2  0x00007ffff7fbb9a7 in do_fopen_or_freopen_or_open 
> (function=function@entry=6,
>     path=0x63f46f8 
> "/home/wl/.texlive2025/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.luc")
>  at open-funs.c:569
> #3  0x00007ffff7fbbd69 in freopen64 (path=<optimized out>, mode=<optimized 
> out>,
>     stream=<optimized out>) at open-funs.c:135
> #4  0x000000000070273d in luaL_loadfilex (L=0x1085768,
>     filename=0x63f46f8 
> "/home/wl/.texlive2025/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.luc",
>  mode=0x0) at ../../../source/libs/lua53/lua53-src/src/lauxlib.c:721
> #5  0x000000000046ad26 in luatex_loadfile (L=0x1085768)
>     at ../../../source/texk/web2c/luatexdir/lua/luastuff.c:239
> #6  0x00000000007091c8 in luaD_precall (L=0x1085768, func=0x311c8d0, 
> nresults=1)
>     at ../../../source/libs/lua53/lua53-src/src/ldo.c:434
> #7  0x000000000072696e in luaV_execute (L=0x1085768)
>     at ../../../source/libs/lua53/lua53-src/src/lvm.c:1134
> #8  0x0000000000709564 in luaD_call (L=0x1085768, func=0x311c540, nResults=1)
>     at ../../../source/libs/lua53/lua53-src/src/ldo.c:499
> #9  0x00000000007095c2 in luaD_callnoyield (L=0x1085768, func=0x311c540, 
> nResults=1)
>     at ../../../source/libs/lua53/lua53-src/src/ldo.c:509
> #10 0x00000000006ffeab in f_call (L=0x1085768, ud=0x7fffffffd500)
>     at ../../../source/libs/lua53/lua53-src/src/lapi.c:943
> #11 0x0000000000708562 in luaD_rawrunprotected (L=0x1085768, f=0x6ffe76 
> <f_call>, ud=0x7fffffffd500)
>     at ../../../source/libs/lua53/lua53-src/src/ldo.c:142
> #12 0x0000000000709d72 in luaD_pcall (L=0x1085768, func=0x6ffe76 <f_call>, 
> u=0x7fffffffd500,
>     old_top=704, ef=0) at ../../../source/libs/lua53/lua53-src/src/ldo.c:729
> #13 0x00000000006fff7a in lua_pcallk (L=0x1085768, nargs=3, nresults=1, 
> errfunc=0, ctx=0, k=0x0)
>     at ../../../source/libs/lua53/lua53-src/src/lapi.c:969

The crash appears to be in Lua "dofile" function, which is a part of
Lua, and not one of the LuaTeX additions. If you put the following
contents into a file called <filename>.lua

    #!/usr/bin/env texlua
    print(dofile 
"/home/wl/.texlive2025/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.luc")

and run it with

    LD_PRELOAD=/usr/local/lib64/libtrash.so texlua <filename>.lua

what does it output? It should output something like

    table: 0x116dddb0

(the exact hex number doesn't matter) If it doesn't output that or
crashes, can you try running Lua 5.3 (Lua 5.4 won't work) on that same
file? But if it runs without crashing with texlua, then there's no need
to try Lua 5.3.

Another thing that you can try is deleting the entire contents of
~/.texlive2025/texmf-var/luatex-cache, and then compile simple.tex
again.

> I thus think the problem must have been
> introduced rather recently (i.e., within the last few weeks) – or
> maybe I was just lucky, and other changes in TeXLive accidentally
> started to trigger the crash.

Luigi and Hans will know better than I do, but I don't think that there
have been any changes in LuaTeX recently that would have caused this.
But you can try running "git bisect" against the main repo

    https://gitlab.lisn.upsaclay.fr/texlive/luatex

if you think that the problem was caused by a recent change. (Tip: run
"build.sh" with the "--make" and "--parallel" flags to significantly
speed up the repeated builds).

Thanks,
-- Max

Reply via email to