On 2016-06-13 at 23:09:06 +0200, Roderich Schupp wrote:
> On Mon, Jun 13, 2016 at 9:54 PM, Zakariyya Mughal <zaki.mug...@gmail.com>
> wrote:
> 
> > I notice that there is a similar issue
> > <https://rt.cpan.org/Public/Bug/Display.html?id=55390> that was opened
> > in 2010 for a Gtk2 program.
> >
> >
> More relevant might be the thread on the par mailing list starting at
> http://www.mail-archive.com/par%40perl.org/msg05011.html
> 
> 
> > But when I run the test.exe, I get the following output:
> >
> >     $ ./test.exe
> >     Can't load
> > 'C:\msys64\tmp\par-7a616b69\cache-b75d584224b1a1061779c0bb91d380c83ae4a68e\79d2d23b.dll'
> > for module Cairo::GObject: load_file:The specified module could not be
> > found at C:/msys64/mingw64/lib/perl5/core_perl/DynaLoader.pm line 193.
> >      at C:/msys64/mingw64/lib/perl5/site_perl/PAR/Heavy.pm line 120.
> >     Compilation failed in require at Gtk3.pm line 47.
> >
> 
> Please run
> 
> objdump -ax
> C:\msys64\tmp\par-7a616b69\cache-b75d584224b1a1061779c0bb91d380c83ae4a68e\79d2d23b.dll
> | grep "DLL Name"
> 
> and post its output.

    $ objdump.exe -ax 
"C:\msys64\tmp\par-7a616b69\cache-b75d584224b1a1061779c0bb91d380c83ae4a68e\79d2d23b.dll"
  | grep "DLL Name"
            DLL Name: KERNEL32.dll
            DLL Name: msvcrt.dll
            DLL Name: libcairo-gobject-2.dll
            DLL Name: libcairo-2.dll
            DLL Name: libglib-2.0-0.dll
            DLL Name: perl522.dll
            DLL Name: Cairo.dll
            DLL Name: Glib.dll

I see that the same problem from the mailing list thread is still
present where the DLL references other DLLs that may have already been
loaded.

Just as extra information, the debug output of Dynaloader is as follows:

    $ export PERL_DL_DEBUG=1; ./test.exe
    DynaLoader.pm loaded (CODE(0x6c2728) ., 
C:\msys64\mingw64\lib\perl5\core_perl 
C:\msys64\tmp\par-7a616b69\cache-b75d584224b1a1061779c0bb91d380c83ae4a68e)
    dl_findfile()
    dl_findfile found:
    DynaLoader::bootstrap for IO (auto/IO/IO.dll)
    DynaLoader::bootstrap for Fcntl (auto/Fcntl/Fcntl.dll)
    DynaLoader::bootstrap for Cwd (auto/Cwd/Cwd.dll)
    DynaLoader::bootstrap for Compress::Raw::Zlib 
(auto/Compress/Raw/Zlib/Zlib.dll)
    DynaLoader::bootstrap for List::Util (auto/List/Util/Util.dll)
    DynaLoader::bootstrap for Encode (auto/Encode/Encode.dll)
    DynaLoader::bootstrap for Data::Dumper (auto/Data/Dumper/Dumper.dll)
    DynaLoader::bootstrap for Win32 (auto/Win32/Win32.dll)
    DynaLoader::bootstrap for File::Glob (auto/File/Glob/Glob.dll)
    DynaLoader::bootstrap for PerlIO::scalar (auto/PerlIO/scalar/scalar.dll)
    DynaLoader::bootstrap for Tie::Hash::NamedCapture 
(auto/Tie/Hash/NamedCapture/NamedCapture.dll)
    DynaLoader::bootstrap for attributes (auto/attributes/attributes.dll)
    DynaLoader::bootstrap for Cairo (auto/Cairo/Cairo.dll)
    DynaLoader::bootstrap for Glib (auto/Glib/Glib.dll)
    DynaLoader::bootstrap for Cairo::GObject (auto/Cairo/GObject/GObject.dll)
    Can't load 
'C:\msys64\tmp\par-7a616b69\cache-b75d584224b1a1061779c0bb91d380c83ae4a68e\79d2d23b.dll'
 for module Cairo::GObject: load_file:The specified module could not be found 
at C:/msys64/mingw64/lib/perl5/core_perl/DynaLoader.pm line 193.
    # ---snip ---

If the problem is that a DLL is being loaded twice (with a different
name), then why not keep a package variable to cache this and skip the
step if it has already been loaded?

Regards,
- Zaki Mughal

> 
> Cheers, Roderich

Reply via email to