FFI lookup of modules

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

FFI lookup of modules

patrick.rein
Hi everyone,

due to some student projects I came to notice an issue with FFI for which I wanted to ask whether anyone knows anything about it (in order to avoid tackling a solved / impossible issue).

The problem manifests when trying to load a library which is not the system library and not the FFIPlugin on a 64bit Windows (and one other platform which I currently do not remember, I think it was MacOS). The main problem is that the external module is not found, although it is at a location in which it should be found. This happens on a variety of VMs.

You can reproduce this by installing the latest FFI from source.squeak.org and then copying SqueakFFIPrims.dll to SqueakFFIPrims2.dll, changing a few of the FFITestLibrary cdecls to point to the copied dll, and then run the tests.

The system32 and user32 libraries and the ordinary SqueakFFIPlugin code is running just fine, so I get the impression that I am missing something basic here. I am grateful for any insights on this. Otherwise my next step would be to create a debug build and dive into the inner workings of the FFI plugin :)

Bests
Patrick

Reply | Threaded
Open this post in threaded view
|

Re: FFI lookup of modules

marcel.taeumel
Hi, there.

The problem was that external dependencies could not be resolved. The "Dependecy Walker" [1][2]  for Windows helped discover that issue. So, "module not found" actually meant "cannot load module because the operating system could not load all dependent modules". Or something like that. :-)

Best,
Marcel

[2] https://github.com/lucasg/Dependencies (re-write for Windows 10)

Am 29.05.2019 22:08:40 schrieb [hidden email] <[hidden email]>:

Hi everyone,

due to some student projects I came to notice an issue with FFI for which I wanted to ask whether anyone knows anything about it (in order to avoid tackling a solved / impossible issue).

The problem manifests when trying to load a library which is not the system library and not the FFIPlugin on a 64bit Windows (and one other platform which I currently do not remember, I think it was MacOS). The main problem is that the external module is not found, although it is at a location in which it should be found. This happens on a variety of VMs.

You can reproduce this by installing the latest FFI from source.squeak.org and then copying SqueakFFIPrims.dll to SqueakFFIPrims2.dll, changing a few of the FFITestLibrary cdecls to point to the copied dll, and then run the tests.

The system32 and user32 libraries and the ordinary SqueakFFIPlugin code is running just fine, so I get the impression that I am missing something basic here. I am grateful for any insights on this. Otherwise my next step would be to create a debug build and dive into the inner workings of the FFI plugin :)

Bests
Patrick