Skip to content

luaL_lopenlibs hangs forever #6

@danishcake

Description

@danishcake

I've been running this under NodeJS (more or less unchanged, but with one additional line added to the end of lua5.1.5-v0.9.1.min.js)

module.exports = Lua5_1;

A minimal programme using luaL_openlibs will hang forever.

"use strict";

let Lua5_1 = require("lua5.1.5-v0.9.1.min");
let lua = Lua5_1.C;
let vm = lua.luaL_openlibs();
// Never hits the next line. Saturates an entire core

As a workaround I'm loading the libraries independently

"use strict";

let Lua5_1 = require("lua5.1.5-v0.9.1.min");
let lua = Lua5_1.C;
let vm = lua.lua_open();

// Manually load libs as luaL_openlibs hangs
lua.lua_pushcfunction(vm, Lua5_1.Runtime.addFunction(function(vm) {
  lua.luaopen_base(vm);
  lua.luaopen_table(vm);
  lua.luaopen_io(vm);
  lua.luaopen_string(vm);
  lua.luaopen_math(vm);
}));
lua.lua_call(vm, 0, 0);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions