MattN has asked for the wisdom of the Perl Monks concerning the following question:

Hello All,

There is a piece of software I need for work that I am having trouble running. When I try to run the program, I get the error:

Can't load 'C:/demeter/perl/site/lib/auto/Ifeffit/Ifeffit.dll' for module Ifeffit: load_file:Invalid access to memory location at C:/demeter/perl/lib/DynaLoader.pm line 190. at (eval 18) line 1.

I can run it on my home computer and there is a large user community that doesn't have any trouble running the software, but it will not run on my work computer or anyone others in the office (all Windows 7 using Strawberry Perl). This make it seem like the problem is due to a conflict with some restrictive security or monitoring software or setting on the computer.

The program does run in safe mode, so all the parts are on the computer, but not in any other mode or configuration (admin mode / no antivirus / no firewall etc.). The .dll file is definitely in the location listed and if I remove it or use an older version, it gives a different error. I've also tried using XSLoader instead of DynaLoader, but get the same result substituting XSLoader for DynaLoader.

Does anyone know what could cause a conflict like this? Or if there is a way around it?

Thanks, Matt
  • Comment on Invalid Access to Memory location using DynaLoader

Replies are listed 'Best First'.
Re: Invalid Access to Memory location using DynaLoader
by VinsWorldcom (Prior) on Dec 08, 2015 at 18:54 UTC

    If it's Strawberry Perl, you should be able to compile the XS code since Strawberry distribution comes with gcc. Was that how this module was installed - with a local compile, or was it copied from another machine? That could cause issues just copying XS code from one machine to another (32-bit vs 64-bit, Windows patch level, etc...)

      Thank you for the response. That's a good question. I'm not 100% sure. There is only a .dll file, no .xs file. I think that the .dll is created when I install the program because there is no ifeffit.dll (or .xs) on the github site, though I suppose it could have brought it in from elsewhere.

      I have a working copy of the software on a WinXP and there is also only a .dll. That .dll of course does not work on the Win7 computer, but it does give a different error than the correct .dll.

        The DLL is created during the Perl incantation (perl Makefile.PL, make, make test, make install) for XS modules. I'm guessing this was copied there and certainly from WinXP to Win7 you may experience issues and can't just copy a DLL from one system to the other.

        Assuming this is the GitHub site you reference, you'll find Perl notes here:

        https://github.com/newville/ifeffit/tree/master/wrappers/perl
Re: Invalid Access to Memory location using DynaLoader
by BrowserUk (Patriarch) on Dec 08, 2015 at 19:18 UTC

    Try applying this hotfix. If no go; then also try this one.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.

      I will try to get the hotfixes installed. I do not have permission to install anything myself unfortunately.

      Thanks
Re: Invalid Access to Memory location using DynaLoader - path?
by Discipulus (Canon) on Dec 09, 2015 at 09:20 UTC

      Thank you for the reply. I think everything is 64 bit. I changed the system32 path to Sysnative and the results remained the same.

      A security issue seems likely to me. There's all sorts of security and tracking software installed, but the IT guy says that's not the issue. I looked at the event log and AppLocker doesn't have any events associated with it. He said that the tracking software is all shut off on a clean boot. He also removed it from the workgroup to check the group policy. Here's a list of configurations he tried:

      Both 32-bit and 64-bit versions Both patches from the Demeter website Normal mode Last known good configuration Selective startup Disabled all non-critical local services Terminated all non-critical system and user processes Uninstalled Java Uninstalled .NET framework Reinstalled Java Reinstalled .NET framework Adjusted memory settings for best performance Verified use has full control of all of their profile data (including +appdata) and installation directory Attempted as a normal user and administrative user Windows 95 compatibility mode Windows 98 compatibility mode Windows NT 4.0 compatibility mode Windows 2000 compatibility mode Windows XP (SP2) compatibility mode Windows XP (SP3) compatibility mode Windows Server 2003 (SP1) compatibility mode Windows Server 2008 (SP1) compatibility mode Windows Vista compatibility mode Windows Vista (SP1) compatibility mode Windows Vista (SP2) compatibility mode Windows 7 Disabled visual themes Disabled desktop composition Disable display scaling on high DPI settings Install to default location Install to a specific location C:\demeter (not default) Workstation was removed from domain and joined to workgroup Various reboots throughout

      It only runs is safe mode and safe mode with networking. He also tried disabling the antivirus, but that didn't help either. I don't know what the difference is between the safemode and clean boot. that is causing the problem.

      As I understand it, the MinGW issue was resolved a while ago with the release of version 9.14 or so.

      Does any of this set off any new alarms? Unfortunately, I don't have much control of the computer, so I can't view the security settings or any of that.

      Thanks

        Hello MattN,
        your question is a cross-post: http://comments.gmane.org/gmane.science.physics.ifeffit/3475. while is permitted is also considered polite to inform about the other post. Infact many of the information you give here are yet present in the other page. You got also the author's support. is an important bit of information. Just for correctness.

        Anyway dont fool yourself with the event viewer inspection: is very rare in my expereince to find something useful in them, and they costs hours of psychoanalisys..

        Better if you concentrate on some trace tool: ProcessExplorer can tell you all about the DLL Hell; it has CRTL-D CTRL-H hotkeys to switch from handle view to dll one.

        You can create with process explorer also dump of processes for further analisys.

        Have you tried to put the right dll in the current directory? Assuming you can be sure what the current directory is when the program try to load the dll... current directory is searched normally as first thing.

        i think i've terminated th possible suggestions.

        L*
        There are no rules, there are no thumbs..
        Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re: Invalid Access to Memory location using DynaLoader
by Anonymous Monk on Dec 09, 2015 at 01:16 UTC

      Thank you for the tip. I tried running the dependency walker, but it was unable to find some of the perl dlls that are there. It is recommended here to use the Microsoft process monitor because dependency walker is nearly 10 years old. That didn't seem to work either. It kept creating new instances of itself visible only in the processes tab of task manager and I had to restart the computer. Possibly due to the network setup at work. I'll try and run it at home tonight so it can't try to scan the network drives.

      Thanks

Re: Invalid Access to Memory location using DynaLoader
by BrowserUk (Patriarch) on Dec 11, 2015 at 11:33 UTC

    Just a random thought.

    Is it possible this is caused by one or other of ASLR - Address space layout randomization or DEP - Data Execution Prevention?

    Dunno how you disable them on Win7; but I believe it can be done on a per process basis, though you would probably need Admin privileges. Worth a mench at least.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Thanks for the idea. I will ask the IT person if he can disable those when he comes by.