The fix is pretty easy, there was only an uninitialized string
somewhere. Patch is attached.
On 16/01/19 10:51 PM, luigi scarso wrote:
> On Wed, Jan 16, 2019 at 10:45 AM Henri Menke <[email protected]> wrote:
>
>> I have prepared a plain example (attached) which can be run with
>>
>> mtxrun --script plain --run test.tex
>>
>> and also segfaults.
>>
>> On 1/16/19 10:14 PM, Henri Menke wrote:
>>> Dear list,
>>>
>>> To answer a question on TeX.SX I wanted to compare glyph sidebearings
>>> using kerns. However, when trying to insert a kern before the head of
>>> the last line I first get an error followed by segmentation fault:
>>>
>>> warning (node filter): error: [\directlua]:12: Attempt to
>>> node.insert_before() a non-existing node
>>>
>>> Segmentation fault
>>>
>>> The example is attached because it's a bit larger. I marked the
>>> offending line with “BOOM”.
>>>
>>> Cheers, Henri
>>>
>>
>>
> Thank you very much for the report, we will see it asap.
>
diff --git a/source/texk/web2c/luatexdir/lua/luastuff.c b/source/texk/web2c/luatexdir/lua/luastuff.c
index 0d9342223..8b9ee4abc 100644
--- a/source/texk/web2c/luatexdir/lua/luastuff.c
+++ b/source/texk/web2c/luatexdir/lua/luastuff.c
@@ -665,7 +665,7 @@ void luatokencall(int p, int nameptr)
lua_State *luatex_error(lua_State * L, int is_fatal)
{
const_lstring luaerr;
- char *err = NULL;
+ char *err = "";
if (lua_type(L, -1) == LUA_TSTRING) {
luaerr.s = lua_tolstring(L, -1, &luaerr.l);
/*tex