Sat May 19 21:00:44 2018: Request 125357 was acted upon.
Transaction: Ticket created by sja...@gmail.com
       Queue: Win32-OLE
     Subject: OLE Exception error 0x800a03ec while make test on Cygwin
   Broken in: (no value)
    Severity: (no value)
       Owner: Nobody
  Requestors: sja...@gmail.com
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=125357 >


Hi,

I downloaded the Win32::OLE module from CPAN, fixed stricmp() function
problem and successfully compiled it on Cygwin 64bit environment. Then
there are some errors occurred on make test:

----------
% make test
"/usr/bin/perl.exe" -MExtUtils::Command::MM -e 'cp_nonempty' -- OLE.bs
blib/arch/auto/Win32/OLE/OLE.bs 644
PERL_DL_NONLAZY=1 "/usr/bin/perl.exe" "-MExtUtils::Command::MM"
"-MTest::Harness" "-e" "undef *Test::Harness::Switches;
test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/1_nls.t ....... ok
t/2_variant.t ... ok
t/3_ole.t ....... 1/58 OLE exception from "Microsoft Excel":

Microsoft Excel cannot open or save any more documents because there is not
enough available memory or disk space.

• To make more memory available, close workbooks or programs you no longer
need.

• To free disk space, delete files you no longer need from the disk you
are saving to.

Win32::OLE(0.1712) error 0x800a03ec
    in METHOD/PROPERTYGET "Add" at t/3_ole.t line 130.
Win32::OLE->QueryObjectType: object is not a Win32::OLE object at
t/3_ole.t line 131.
Can't call method "Xyzzy" on an undefined value at t/3_ole.t line 151.
t/3_ole.t ....... Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 55/58 subtests
t/4_compat.t .... 1/5 Use of uninitialized value $bk in concatenation
(.) or string at t/4_compat.t line 36.
Can't use an undefined value as a HASH reference at t/4_compat.t line 41.
t/4_compat.t .... Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 5/5 subtests
t/5_unicode.t ... ok
t/6_event.t ..... skipped:
D:\cyg_home\user\.cpan\build\Win32-OLE-0.1712-0\test.xls doesn't
exist! Please run test 3_ole.t first
t/7_overload.t .. skipped:
D:\cyg_home\user\.cpan\build\Win32-OLE-0.1712-0\test.xls doesn't
exist! Please run test 3_ole.t first
----------

The same problem was reported:

    http://qs1969.pair.com/~perl2/?node_id=1047451
    http://www.perlmonks.org/?node_id=1125271

To figure out the cause, I've tried an Excel automation program
written in C and the same problem occurs. The error would not occur if
the C program is compiled by Mingw instead of Cygwin gcc. Therefore
there might be some compatibility issue between OLE and Cygwin. I've
found there is a document perlcygwin that mentions about environment
variable issue on Cygwin which can be solved by calling a platform
specific function Cygwin::sync_winenv(). After adding this function
call into t/3_ole.t and t/4_compat.t as attached patch file. All test
items passed.

This shall not be a bug of Win32::OLE. But I think there should be
some document addressing it.
My system environment is Cygwin 2.10 x86_64 on Win7 SP1 and Excel2010.

--- bak/3_ole.t	2018-05-20 02:14:47.543365600 +0800
+++ 3_ole.t	2018-05-20 01:48:28.122027900 +0800
@@ -86,6 +86,7 @@
 # 1. Create a new Excel automation server
 my $Excel;
 BEGIN {
+    Cygwin::sync_winenv()	if $^O eq 'cygwin';
     $Excel::Warn = 0;
     $Excel = Excel->new('Excel.Application', \&Quit);
     $Excel::Warn = 2;
--- bak/4_compat.t	2018-05-20 02:14:47.565366900 +0800
+++ 4_compat.t	2018-05-20 01:50:25.767756800 +0800
@@ -22,6 +22,7 @@
 my $Test = 0;
 
 # 1. Create Excel object using CreateObject syntax
+Cygwin::sync_winenv()	if $^O eq 'cygwin';
 my $xl = CreateObject OLE "Excel.Application";
 unless (defined $xl) {
     print "1..0 # skip Excel.Application not installed\n";

Reply via email to