Skip to content

Unable to pass C function from main application to cqueues.thread #151

Open
@daurnimator

Description

@daurnimator
$ lua -e 'require"cqueues.thread".start(print, "foo", 1):join()'
lua: /usr/share/lua/5.3/cqueues/thread.lua:72: bad argument #15 to 'start' (/usr/lib/lua: cannot read file data: Is a directory)
stack traceback:
    [C]: in upvalue 'start'
    /usr/share/lua/5.3/cqueues/thread.lua:72: in function '_cqueues.thread.start'
    (command line):1: in main chunk
    [C]: in ?

(Linux, glibc)

It appears that dladdr on a static symbol returns some slightly odd things. In this case, dli_fname is lua (I guess from argv[0]?). When passed to dlopen as this non-absolute path, it tries to look for /usr/lib/lua, which of course doesn't exist.

FWIW I checked what dladdr1 returned in extra_info, and lname was an empty string (not NULL as I would have understood, but an empty string).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions