Re: FFI symbol resolution problems on Windows

  • From: Mike Pall <mike-1412@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Mon, 22 Dec 2014 21:11:26 +0100

Konstantin Olkhovskiy wrote:
> 00:00:12.453: GetProcAddress(0x67EC0000 [e:\LIBAPR-1-0.DLL], "apr_env_get")
> called from "e:\LUAJIT.EXE" at address 0x0044DC89 and returned NULL by
> thread 1. Error: The specified procedure could not be found (127).

The first try is always with the undecorated name. It fails here,
which is to be expected.

> 00:00:12.453: GetProcAddress(0x67EC0000 [e:\LIBAPR-1-0.DLL],
> "_apr_env_get@12") called from "e:\LUAJIT.EXE" at address 0x0044DC89 and
> returned NULL by thread 1. Error: The specified procedure could not be
> found (127).

The second try is with the stdcall decorated name. This clearly
matches the name you gave:

[1510](sec  1)(fl 0x00)(ty  20)(scl   2) (nx 0) 0x000154d0 _apr_env_get@12

So, either "e:\LIBAPR-1-0.DLL" is a different DLL than what you've
dumped, or something else is going on. IOW: I don't think LuaJIT
is at fault here.

BTW: It looks like you're using a virtual drive in a VM, probably
a mounted Linux host file system. This is known to fail in some
cases. E.g. most installer EXEs only run when started from a
'real' drive (this can be a VM container, too, but not a network
drive). Try copying the DLL to the Windows drive in the VM.

--Mike

Other related posts: