Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Knot Resolver Knot Resolver
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 144
    • Issues 144
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 14
    • Merge requests 14
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Knot projects
  • Knot ResolverKnot Resolver
  • Issues
  • #216
Closed
Open
Issue created Jul 07, 2017 by MartB@MartB

[ARM64] Execution of daemon failing, possible deprecated usage of lua_pushlightuserdata

PANIC: unprotected error in call to Lua API (bad light userdata pointer)

Breakpoint 1, 0x0000ffffb7daa3d8 in lua_pushlightuserdata () from /usr/lib/libluajit-5.1.so.2
(gdb) bt
#0  0x0000ffffb7daa3d8 in lua_pushlightuserdata () from /usr/lib/libluajit-5.1.so.2
#1  0x0000aaaaaaab57bc in init_state (engine=0xfffffffff150) at daemon/engine.c:618
#2  engine_init (engine=0xfffffffff150, pool=0xffffffffed60) at daemon/engine.c:646
#3  0x0000aaaaaaab22c4 in main (argc=<optimized out>, argv=<optimized out>) at daemon/main.c:585
(gdb) continue
Continuing.
PANIC: unprotected error in call to Lua API (bad light userdata pointer)
[Inferior 1 (process 18841) exited with code 01]

(gdb) frame 1
#1  0x0000aaaaaaab57bc in init_state (engine=0xfffffffff150) at daemon/engine.c:618
618             lua_pushlightuserdata(engine->L, engine);

Im not sure what exactly is going on here, but i found multiple reports related to arm64.

The recommended fix is:

LuaJIT on 64 bit systems provides a limited range of 47 bits for the legacy lightuserdata data type. This is only relevant on x64 systems which use the negative part of the virtual address space in user mode, e.g. Solaris/x64, and on ARM64 systems configured with a 48 bit or 52 bit VA. Avoid using lightuserdata to hold pointers that may point outside of that range, e.g. variables on the stack. In general, avoid this data type for new code and replace it with (much more performant) FFI bindings. FFI cdata pointers can address the full 64 bit range.

Relevant sources:

https://github.com/LuaJIT/LuaJIT/pull/230#issuecomment-260205661 https://github.com/LuaJIT/LuaJIT/blob/v2.1/doc/status.html

Kind regards MartB

Edited Jul 07, 2017 by MartB
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking