Hi Werner,

On Fri, 2025-04-04 at 08:19 +0000, Werner LEMBERG wrote:
> > 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,
>
> It crashes.  The topmost elements of the function stack gdb shows are
> the same as with the originally reported crash.

Hmm, interesting. There's certainly nothing there that involves file
deletion, so it looks like libtrash is crashing the bytecode loader,
which doesn't really make any sense.

> I'm willing to debug
> this further if you tell me how to do that.

You can try a minimal test case of writing/loading Lua bytecode:

    $ echo 'print("A") return "B"' > test.lua
    $ texlua test.lua
    A
    $ texluac -o test.luc test.lua
    $ echo 'print("C") print(dofile("test.luc")) print("D")' > loader.lua
    $ texlua loader.lua
    C
    A
    B
    D

There are 4 possible combinations that you could try:

    LD_PRELOAD= texluac -o test.luc test.lua && LD_PRELOAD= texlua loader.lua
    LD_PRELOAD=libtrash.so texluac -o test.luc test.lua && LD_PRELOAD= texlua 
loader.lua
    LD_PRELOAD= texluac -o test.luc test.lua && LD_PRELOAD=libtrash.so texlua 
loader.lua
    LD_PRELOAD=libtrash.so texluac -o test.luc test.lua && 
LD_PRELOAD=libtrash.so texlua loader.lua

Hopefully that should narrow it down to if it's writing or loading the
bytecode that's the issue.

> > can you try running Lua 5.3 (Lua 5.4 won't work) on that same file?
>
> How do I do that?  Looking into `./build.sh` I see that
> ```
> BUILDLUA53=TRUE
> ```
> is the default...

Ah, I mean the standalone Lua program, nothing to do with TeX. I think
that this is the correct package for OpenSUSE:

    https://software.opensuse.org/package/lua53

> I had another idea and tried various checkouts of the TeXLive
> repository, going back to the beginning of the year 2023: lualatex
> always crashes.  Since I know with 100% certainty that it worked for
> me then, my conclusion is that a change in one of the necessary DLLs
> rather than a change in luatex per se causes the problem

Do you have snapper enabled on your root partition? If so, you can use
systemd-nspawn to bisect which OS update caused the issue. Make sure
that there's a copy of the current LuaTeX binary somewhere in your home
folder, then you can run

    sudo systemd-nspawn \
        --console=autopipe \
        --directory=/.snapshots/<SNAPSHOT-ID>/snapshot/ \
        --ephemeral \
        --user=$USER \
        --bind-ro=/home/ --overlay=+/home::/home \
        $HOME/path/to/texlua your-test-file.lua

for different values of <SNAPSHOT-ID> and see if that changes anything.

> On my platform version (openSUSE 15.6), version 2.38 of the GNU C
> Library is used.  Are there known problems with lua and this glibc
> version?

Not that I'm aware of. I'm using glibc 2.40 (on Fedora 41 x86_64) and
I've compiled and ran LuaTeX without any issues.

> I no longer think that a recent change caused that.  However, if you
> still think I should do that, I can give it a try.

I agree that this probably wasn't caused by a recent change in LuaTeX,
so there's probably no point in bisecting.

Thanks,
-- Max

Reply via email to