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

Now this maybe a Windows networking problem rather than a perl problem, but it's only when running perl programs that I see the error…

I have perl installed on a Windows network share, so that all the staff in the company can run perl programs without having to install perl on each PC. Mostly this works fine, but sometimes programs fail to start up. From the error message, it looks like there is a problem loading a DLL needed by a perl module. When I try again to run the program, it usually (maybe always) manages to load that module, but often then fails to load a different module. If I keep trying, eventually the program successfully runs. After that, the program will run every time. Until the next time it goes wrong, days or weeks later.

Here is a typical session log:

>\\puma\perl\bin\perl -w TrainCheck.pm Can't load '//puma/perl/site/lib/auto/Tk/Event/Event.dll' for module T +k::Event: load_file:Error performing inpage operation at //puma/perl/ +lib/XSLoader.pm line 68. at //puma/perl/site/lib/Tk/Event.pm line 10 Compilation failed in require at //puma/perl/site/lib/Tk.pm line 13. BEGIN failed--compilation aborted at //puma/perl/site/lib/Tk.pm line 1 +3. Compilation failed in require at TrainCheck.pm line 11. BEGIN failed--compilation aborted at TrainCheck.pm line 11. >Exit code: 9 >\\puma\perl\bin\perl -w TrainCheck.pm Can't load '//puma/perl/lib/auto/Encode/Encode.dll' for module Encode: + load_file:Error performing inpage operation at //puma/perl/lib/XSLoa +der.pm line 68. at //puma/perl/lib/Encode.pm line 9 Compilation failed in require at //puma/perl/site/lib/Tk.pm line 21. BEGIN failed--compilation aborted at //puma/perl/site/lib/Tk.pm line 2 +1. Compilation failed in require at TrainCheck.pm line 11. BEGIN failed--compilation aborted at TrainCheck.pm line 11. >Exit code: 9 >\\puma\perl\bin\perl -w TrainCheck.pm Can't load '//puma/perl/site/lib/auto/Tk/Tk.dll' for module Tk: load_f +ile:Error performing inpage operation at //puma/perl/lib/DynaLoader.p +m line 230. at TrainCheck.pm line 11 Compilation failed in require at TrainCheck.pm line 11. BEGIN failed--compilation aborted at TrainCheck.pm line 11. >Exit code: 2 >\\puma\perl\bin\perl -w TrainCheck.pm getting page 'http://www.livedepartureboards.co.uk/ldb/summary.aspx?T= +LPY&R=0'...

The last run is the one that works.

I have wireshark logs taken during the above operation, in case anyone can suggest what I might look for.

Could there be something about perl’s DLL loading code that makes it more susceptible to problems with Windows file sharing?

Can anyone enlighten me as to what “Error performing inpage operation” might mean in the context of loading a DLL over the network?

Thanks!

--

"Any sufficiently analyzed magic is indistinguishable from science" - Agatha Heterodyne

  • Comment on Intermittent startup problems in Windows: “Error performing inpage operation” when loading DLLs
  • Select or Download Code

Replies are listed 'Best First'.
Re: Intermittent startup problems in Windows: “Error performing inpage operation” when loading DLLs
by BrowserUk (Patriarch) on Sep 02, 2010 at 13:03 UTC

    Essentially, this is a hardware problem, not a perl problem. This is the explanation:

    Copy utilities commonly use the CopyFile() Win32 API to copy files.

    For small files (where small is arbitrarily defined in the Windows source code as less than 256 kilobytes) the Windows CopyFile() API does not actually open the source file and read from it using the CreateFile() and ReadFile() APIs as might be expected.

    Instead, the CopyFile() API creates a File Mapping and maps the file into virtual memory. Data is then read from the file by simply accessing this memory. As the memory is accessed, the required portions of the file are paged into memory on demand. This leverages the paging functionality of the Windows Virtual Memory Manager, but introduces the jargon of Paging into this particular file copy scenario.

    Consequently, if I/O errors occur while processing a CopyFile() API for a "small" file, they will not be reported as File I/O Errors. Instead, as these errors are detected in what is effectively a paging operation (albeit unrelated to the Windows paging file), they will be reported as "Error performing inpage operation".

    Additionally, errors caused by network connectivity can cause these errors. Mismatched MTU sizes or truncation of a packet at a router can result in this error when files larger than the largest packet size are copied over the network. In essence, the network connection is the media that has the physical problem.

    For a fix, it sounds like you need to check out your network error stats.

    Another possibility as from your description this sounds to be endemic rather than transient, try running chkdsk on the drive where the data us stored.


    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".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      I spent hours on this. You are a lifesaver!

      And thank-you, Monks, for keeping this around!

Re: Intermittent startup problems in Windows: “Error performing inpage operation” when loading DLLs
by Marshall (Canon) on Sep 02, 2010 at 13:06 UTC
Re: Intermittent startup problems in Windows: “Error performing inpage operation” when loading DLLs
by roboticus (Chancellor) on Sep 02, 2010 at 13:00 UTC

    mykl:

    For a shared drive, network congestion and/or misconfiguration can cause this problem. Perhaps it's time to split off another network segment to reduce traffic?

    ...roboticus

Re: Intermittent startup problems in Windows: “Error performing inpage operation” when loading DLLs
by Anonymous Monk on Sep 02, 2010 at 12:54 UTC
Re: Intermittent startup problems in Windows: “Error performing inpage operation” when loading DLLs
by mykl (Monk) on Sep 03, 2010 at 14:51 UTC

    OK, it seems that the consensus is that it's not a perl-specific problem, even though there isn't a consensus on whether it's my local disk, the server's disk, or the network that is causing it. I guess I can't ask for more in this forum.

    Thanks all!

    --

    "Any sufficiently analyzed magic is indistinguishable from science" - Agatha Heterodyne

      even though there isn't a consensus on whether it's my local disk, the server's disk, or the network that is causing it.

      There is no consensus, because there is simply no way to make that determination based on the information provided. However, there are some simple steps that you can use to help make the determination:

      1. Install perl on another drive (preferably another server) and share it.

        If the problem goes away, it is likely the original drive that's faulty.

      2. Try it (from the existing server), from several different clients.

        If it only fails from one client, look to the local disk, or local network configuration.

        If it fails on some and not others, it is unlikely to be either the local or remote disks that are at fault. So look to the network setup. In particular, look for commonalities in the network setup (MTU setting etc.) between those that do fail and those that don't.

        If it fails on all of them, it is unlikely to be local disks. So go to step 1, and retry from the same clients.

      3. If it fails on one (or some) subnets and not others.

        Look for problems with the bridge or router between that (those) subnets and the subnet containing the server.

      Most of these tests are relatively quick and simple to carry out. If you have a local support guy/team worth their salt, it'll be bread & butter work for them. Fixing the underlying problem will likely benefit your entire setup, not just your Perl installation.


      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".
      In the absence of evidence, opinion is indistinguishable from prejudice.