From: "Marcel Fabian Krüger" <tex@2krueger.de>
To: ConTeXt users list <ntg-context@ntg.nl>
Subject: handle_error_hook in LuaMetaTeX
Date: Fri, 31 Jul 2020 18:17:51 +0200 [thread overview]
Message-ID: <20200731161751.nhcq2mzqvbeipeaw@yoga> (raw)
Hi,
thanks for handling
f file consition in LuaMetaTeX. While playing with that, I encountered a
potential bug in the latest LuaMetaTeX version: If handle_error_hook is
executed and returns any number, LuaMetaTeX segfaults. (I'm pretty sure
that this still worked with the previous version) Minimal ConTeXt
example:
\enabledirectives[system.quitonerror=false]
\directlua{
print(callbacks.register('handle_error_hook', function(...)
return 3
end))
}
\undefined % Trigger an error
\starttext
\stoptext
This triggers
[...]
system > ConTeXt ver: 2020.07.31 10:20 LMTX fmt: 2020.7.31 int: english/english
[...]
tex error > tex error on line 7 in file ./test_empty_input.tex: ! Undefined control sequence
l.7 \undefined
[...]
9 \stoptext
segmentation fault (core dumped) /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex cont-yes.mkiv
valgrind suggests that this is caused by an attempt to access a null
pointer:
==382632== Invalid write of size 4
==382632== at 0x1A581F: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x1A662F: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x14BAA8: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x1DA50E: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x1DA802: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x15F956: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x156E2E: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x121E97: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x4A16001: (below main) (in /usr/lib/libc-2.31.so)
==382632== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==382632==
==382632==
==382632== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==382632== Access not within mapped region at address 0x0
==382632== at 0x1A581F: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x1A662F: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x14BAA8: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x1DA50E: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x1DA802: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x15F956: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x156E2E: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x121E97: ??? (in /home/marcel/lmtx-install/tex/texmf-linux-64/bin/luametatex)
==382632== by 0x4A16001: (below main) (in /usr/lib/libc-2.31.so)
That me know if you are interested in the coredump.
Best regards,
Marcel
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
next reply other threads:[~2020-07-31 16:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-31 16:17 Marcel Fabian Krüger [this message]
2020-08-01 14:11 ` Hans Hagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200731161751.nhcq2mzqvbeipeaw@yoga \
--to=tex@2krueger.de \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).