Win32::OLE

This is a multi-part message in MIME format.

--===============0346822961==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C76117.496C8D95"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C76117.496C8D95
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi All,



I have code that has been in Production for almost 2 years running many
times per day flawlessly. I am interacting with a 3rd party DLL (WS_FTP
Secure Dev Kit) which acts as a COM server. About 1.5 months ago and
yesterday the DLL caused my Perl exe to crash; the crash should have
been trapped by eval blocks, but wasn't...





Here is the sub (OO Method) where I execute the new method:



# Create a new WSFTP API object #

sub createWSFTPComObject

{

my $self =3D shift;

my $objRef =3D Win32::OLE->new('WsftpSDK.WsftpApi') || die
"\nWSFTP.pm - Unable to instantiate WS_FTP API object, error: $!";

if ($objRef =3D=3D undef)

{

print "\nWSFTP.pm - Unable to create WS_FTP API
Object!";

die "\nWSFTP.pm - $!";

}



if ($self->{_displayMode} =3D=3D 3)

{

print "\nWSFTP.pm - Created WS_FTP API Object "
.. $objRef;

}



return $objRef;

}



I am using ActivePerl 5.8.4.810 packaged to an exe using PDK 5.3. The
code is running on a Windows 2003 server.







Thanks,



Nick B.


------_=_NextPart_001_01C76117.496C8D95
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
[at] page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hi All,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I have code that has been in Production for almost 2 =
years
running many times per day flawlessly.  I am interacting with a =
3<sup>rd</sup>
party DLL (WS_FTP Secure Dev Kit) which acts as a COM server.  =
About 1.5
months ago and yesterday the DLL caused my Perl exe to crash; the crash =
should have
been trapped by eval blocks, but =
wasn’t…<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Here is the sub (OO Method) where I execute the new =
method:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'># Create a new WSFTP API object =
#<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>sub createWSFTPComObject<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>{<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>         =
   my
$self =3D shift;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>         =
   my
$objRef =3D Win32::OLE->new('WsftpSDK.WsftpApi') || die =
"\nWSFTP.pm -
Unable to instantiate WS_FTP API object, error: =
$!";<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>         =
   if
($objRef =3D=3D undef)<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>         =
   {<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>         =
            &=
nbsp;  print
"\nWSFTP.pm - Unable to create WS_FTP API =
Object!";<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>         =
            &=
nbsp;  die
"\nWSFTP.pm - $!";<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>         =
   }<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>         =
   <o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>         =
   if
($self->{_displayMode} =3D=3D 3)<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>         =
   {<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>         =
            &=
nbsp;  print
"\nWSFTP.pm - Created WS_FTP API Object " . =
$objRef;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>         =
   }<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>         =
   <o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>         =
   return
$objRef;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>}<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I am using ActivePerl 5.8.4.810 packaged to an exe =
using PDK
5.3.  The code is running on a Windows 2003 server.  =
<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Thanks,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Nick B.<o:p></o:p></span></font></p>

</div>

</body>

</html>

------_=_NextPart_001_01C76117.496C8D95--

--===============0346822961==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0346822961==--
NBharucha [ Do, 08 März 2007 01:18 ] [ ID #1650837 ]

RE: Win32::OLE

From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
Bharucha, Nikhil
Sent: 08 March 2007 00:18
To: activeperl [at] activestate.com
Subject: Win32::OLE =


> Hi All,
> =

> I have code that has been in Production for almost 2 years running
many times per day flawlessly. I am =

> interacting with a 3rd party DLL (WS_FTP Secure Dev Kit) which acts as
a COM server. About 1.5 months ago and > yesterday the DLL caused my
Perl exe to crash; the crash should have been trapped by eval blocks,
but wasn't...

Which begs the question, what do you mean by crash. An eval block could
be used to trap a die, but not a crash as I understand the term. Also, I
see no eval in the code you provide.

> =

> Here is the sub (OO Method) where I execute the new method:
> =

> # Create a new WSFTP API object #
> =

> sub createWSFTPComObject
> {
> my $self =3D shift;
> my $objRef =3D Win32::OLE->new('WsftpSDK.WsftpApi') || die
"\nWSFTP.pm - Unable to instantiate WS_FTP > API object, error: $!";

The following if statement is redundant as the statement above already
tests for undef. Also, it is more usual to use the function 'defined'.
Also, consider using Win32::OLE->LastError, which may give more relevant
info than $!.

> if ($objRef =3D=3D undef)
> {
> print "\nWSFTP.pm - Unable to create WS_FTP
API Object!";
> die "\nWSFTP.pm - $!";

Are you aware that the above two statements direct their output to
different streams (STDOUT and STDERR), which may well end up in
different places?

> }
> =

> if ($self->{_displayMode} =3D=3D 3)
> {
> print "\nWSFTP.pm - Created WS_FTP API Object
" . $objRef;
> }
> =

> return $objRef;
> }
> =

> I am using ActivePerl 5.8.4.810 packaged to an exe using PDK 5.3. The
code is running on a Windows 2003 =

> server. =


I suspect that this problem could be a little difficult to track down
unless you can reproduce it with a better frequency that 1.5 months. If
you could create a script that reproduces the problem more reliably it
would help a lot. It may even lead to you discovering the problem for
yourself.

As a small aside, you seem to have your line end character (i.e. "\n")
at the wrong end of your lines ( :-) )

HTH

-- =

Brian Raven =


=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Atos Euronext Market Solutions Disclaimer
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

The information contained in this e-mail is confidential and solely for the=
intended addressee(s). Unauthorised reproduction, disclosure, modification=
, and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediat=
ely and delete it from your system. The views expressed in this message do =
not necessarily reflect those of Atos Euronext Market Solutions.

Atos Euronext Market Solutions Limited - Registered in England & Wales with=
registration no. 3962327. Registered office address at 25 Bank Street Lon=
don E14 5NQ United Kingdom. =

Atos Euronext Market Solutions SAS - Registered in France with registration=
no. 425 100 294. Registered office address at 6/8 Boulevard Haussmann 750=
09 Paris France.

L'information contenue dans cet e-mail est confidentielle et uniquement des=
tinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Tou=
te copie, publication ou diffusion de cet email est interdite. Si cet e-mai=
l vous parvient par erreur, nous vous prions de bien vouloir prevenir l'exp=
editeur immediatement et d'effacer le e-mail et annexes jointes de votre sy=
steme. Le contenu de ce message electronique ne represente pas necessaireme=
nt la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Soci=E9t=E9 de droit anglais, enregi=
str=E9e au Royaume Uni sous le num=E9ro 3962327, dont le si=E8ge social se =
situe 25 Bank Street E14 5NQ Londres Royaume Uni.

Atos Euronext Market Solutions SAS, soci=E9t=E9 par actions simplifi=E9e, e=
nregistr=E9 au registre dui commerce et des soci=E9t=E9s sous le num=E9ro 4=
25 100 294 RCS Paris et dont le si=E8ge social se situe 6/8 Boulevard Hauss=
mann 75009 Paris France.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Brian Raven [ Do, 08 März 2007 12:21 ] [ ID #1651970 ]

RE: Win32::OLE

I believe I forgot that Win32::OLE runs in-process (duh), so a crash of an =
object created (or attempted to be created) will bring down the caller as w=
ell.

I agree about the redundancy in messaging for a new method failure, one of =
those things as well (not sure if all of the methods were available 2 years=
ago...).

The top level script opens separate filehandles for STDOUT and STDERR.

I have upped logging (configurable) so that my code turns on the Debug mode=
in the WSFTP SDK. Every connection is logged to a separate file, but when=
the failure does occur again I will probably find that it is truncated as =
well due to the write buffer not being flushed due to a crash.

I agree about the EOL character, trust me the way the logs are formatted it=
works better this way :)


Thanks,

Nick



-----Original Message-----
From: activeperl-bounces [at] listserv.ActiveState.com [mailto:activeperl-bounce=
s [at] listserv.ActiveState.com] On Behalf Of Brian Raven
Sent: Thursday, March 08, 2007 6:21 AM
To: activeperl [at] activestate.com
Subject: RE: Win32::OLE =


From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
Bharucha, Nikhil
Sent: 08 March 2007 00:18
To: activeperl [at] activestate.com
Subject: Win32::OLE =


> Hi All,
> =

> I have code that has been in Production for almost 2 years running
many times per day flawlessly. I am =

> interacting with a 3rd party DLL (WS_FTP Secure Dev Kit) which acts as
a COM server. About 1.5 months ago and > yesterday the DLL caused my
Perl exe to crash; the crash should have been trapped by eval blocks,
but wasn't...

Which begs the question, what do you mean by crash. An eval block could
be used to trap a die, but not a crash as I understand the term. Also, I
see no eval in the code you provide.

> =

> Here is the sub (OO Method) where I execute the new method:
> =

> # Create a new WSFTP API object #
> =

> sub createWSFTPComObject
> {
> my $self =3D shift;
> my $objRef =3D Win32::OLE->new('WsftpSDK.WsftpApi') || die
"\nWSFTP.pm - Unable to instantiate WS_FTP > API object, error: $!";

The following if statement is redundant as the statement above already
tests for undef. Also, it is more usual to use the function 'defined'.
Also, consider using Win32::OLE->LastError, which may give more relevant
info than $!.

> if ($objRef =3D=3D undef)
> {
> print "\nWSFTP.pm - Unable to create WS_FTP
API Object!";
> die "\nWSFTP.pm - $!";

Are you aware that the above two statements direct their output to
different streams (STDOUT and STDERR), which may well end up in
different places?

> }
> =

> if ($self->{_displayMode} =3D=3D 3)
> {
> print "\nWSFTP.pm - Created WS_FTP API Object
" . $objRef;
> }
> =

> return $objRef;
> }
> =

> I am using ActivePerl 5.8.4.810 packaged to an exe using PDK 5.3. The
code is running on a Windows 2003 =

> server. =


I suspect that this problem could be a little difficult to track down
unless you can reproduce it with a better frequency that 1.5 months. If
you could create a script that reproduces the problem more reliably it
would help a lot. It may even lead to you discovering the problem for
yourself.

As a small aside, you seem to have your line end character (i.e. "\n")
at the wrong end of your lines ( :-) )

HTH

-- =

Brian Raven =


=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Atos Euronext Market Solutions Disclaimer
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

The information contained in this e-mail is confidential and solely for the=
intended addressee(s). Unauthorised reproduction, disclosure, modification=
, and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediat=
ely and delete it from your system. The views expressed in this message do =
not necessarily reflect those of Atos Euronext Market Solutions.

Atos Euronext Market Solutions Limited - Registered in England & Wales with=
registration no. 3962327. Registered office address at 25 Bank Street Lon=
don E14 5NQ United Kingdom. =

Atos Euronext Market Solutions SAS - Registered in France with registration=
no. 425 100 294. Registered office address at 6/8 Boulevard Haussmann 750=
09 Paris France.

L'information contenue dans cet e-mail est confidentielle et uniquement des=
tinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Tou=
te copie, publication ou diffusion de cet email est interdite. Si cet e-mai=
l vous parvient par erreur, nous vous prions de bien vouloir prevenir l'exp=
editeur immediatement et d'effacer le e-mail et annexes jointes de votre sy=
steme. Le contenu de ce message electronique ne represente pas necessaireme=
nt la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Soci=E9t=E9 de droit anglais, enregi=
str=E9e au Royaume Uni sous le num=E9ro 3962327, dont le si=E8ge social se =
situe 25 Bank Street E14 5NQ Londres Royaume Uni.

Atos Euronext Market Solutions SAS, soci=E9t=E9 par actions simplifi=E9e, e=
nregistr=E9 au registre dui commerce et des soci=E9t=E9s sous le num=E9ro 4=
25 100 294 RCS Paris et dont le si=E8ge social se situe 6/8 Boulevard Hauss=
mann 75009 Paris France.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
NBharucha [ Do, 08 März 2007 17:24 ] [ ID #1651971 ]
Perl » gmane.comp.lang.perl.active-perl » Win32::OLE

Vorheriges Thema: Can't get 'kill "INT", $pid;' to work on 5.8.8
Nächstes Thema: glob doesn't work on UNC paths?