From: Joseph J V. <Joe...@us...> - 2005-04-29 20:54:42
|
Folks -- I'm brand-new to this list and brand-new to STAF. I searched the list archives before sending this message, and while I did find some useful hints none of them directly addresses the problem I'm having. [I was very interested to see some questions from Bruce Malasky, an old colleague of mine from almost 10 years ago, who ironically seems to be doing almost exactly the same thing I'm doing right now...]. Here's my issue: I'm trying to use STAF 3.0.0 with Perl 5.8 on Windows. My little-teeny test program is just trying to run a process (a DOS "DIR" command) on a remote system (actually at the moment it's LOCAL), and get back the STDOUT, STDERR, and result. The program seems to work OK when I run it using regular Perl, but if I try to run under the Perl debugger (i.e. the "-d" command-line switch), Perl blows up with an application error. The perl debugger is kind-of vital to my work and not something I can simple live without... The problem occurrs when I'm calling STAF::Unmarshall() to reconstitute the remote process's results into a Perl-accessible data structure. I tried modifying the Perl code in PLSTAF.pm to make it simpler and initially I seemed to be making some headway with that, but ultimately I gave up because I couldn't completely eliminate the crashes. By the way this works fine with Perl 5.6.1. I have several side-by-side systems where the only difference is Perl 5.6.1 on one and Perl 5.8.6 on the other. Furthermore I've taken a system with Perl5.6.1, uninstalled Perl, and installed Perl5.8, copied STAF\BIN\Perl56\PLSTAF.DLL to STAF\BIN\PLSTAF.DLL (replacing the Perl56 version that was in ..\BIN previously), and the problem occurs. Among other problems I'm working in the dark with respect to the Unmarshall functions -- they exist in the PLSTAF.pm file but they are not documented in the STAFUG (in fact there is no doc for any Perl functions in the User's Guide -- DON'T GET ME STARTED!), nor in the STAFPerl.htm file. Furthermore there aren't any usage-examples for the unmarshall functions in any other language either (as far as I could see). So I am not 100% sure I am using the Unmarshalling functions correctly -- if someone could tell me whether I am or not, or whether there's a simpler way to do this that does not involve unmarshalling, I would really appreciate it! I'll make you a deal: if you help me get this working so that I can use STAF functions from a Perl program running under Perl 5.8 using the debugger, and I'll be glad to submit tons of working code examples in Perl to supplement what's currently sparse/missing from the STAF documentation. Do we have a deal <grin>???? Here are additional details: I'm using Perl 5.8.6: J:\>perl -v This is perl, v5.8.6 built for MSWin32-x86-multi-thread (with 3 registered patches, see perl -V for more detail) Copyright 1987-2004, Larry Wall Binary build 811 provided by ActiveState Corp. http://www.ActiveState.com ActiveState is a division of Sophos. Built Dec 13 2004 09:52:01 ... ..and STAF 3.0.0: STAFProc version 3.0.0 initialized STAF\BIN is in my PATH: J:\>PATH PATH=C:\Perl\bin\;C:\STAF\bin;C:\RCPRSH32;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION I have a very simple test program: use strict; use lib qw( C:/STAF/bin C:/STAF/lib ); use PLSTAF; my($STAFH) = STAF::STAFHandle->new("MyTestProgram"); if ($STAFH->{rc} != $STAF::kOk) { die "Error registering with STAF. RC=".$STAFH->{rc}."\n"; } my($Result); $Result = $STAFH->submit( "LOCAL", "PROCESS", "START shell command dir wait returnstdout returnstderr" ); print "STAFH->submit() returned!\n"; print "Result->{rc}='".$Result->{rc}."'\n"; print "Result->{result}='".$Result->{result}."'\n"; if (STAF::STAFIsMarshalledData($Result->{result})) { # Extract the STDOUT output and display it... my($UnmarshalledResult) = STAF::STAFUnmarshall($Result->{result}); my($STDOUT) = $UnmarshalledResult->{rootObject}{fileList}[0]{data}; print "STDOUT output ======================================================================\n" .$STDOUT."\n" ."End of STDOUT output ==============================================================\n" ; } else { print "Result is not MarshalledData...\n"; } my($rc) = $STAFH->unRegister(); print "unRegister rc=$rc\n"; My program works if I run it without invoking the Perl debugger (pardon the line-wrapping but this was cut-and-pasted from a Command Prompt window): J:\>perl TEST_STAF.pl STAFH->submit() returned! Result->{rc}='0' Result->{result}='@SDT/*:1626:@SDT/{:587::13:map-class-map@SDT/{:559::35:STAF/Service/Process/Comple tionInfo@SDT/{:261::4:keys@SDT/[3:189:@SDT/{:56::12:display-name@SDT/$S:11:Return Code:3:key@SDT/$S: 2:rc@SDT/{:48::12:display-name@SDT/$S:3:Key:3:key@SDT/$S:3:key@SDT/{:55::12:display-name@SDT/$S:5:Fi les:3:key@SDT/$S:8:fileList:4:name@SDT/$S:35:STAF/Service/Process/CompletionInfo:35:STAF/Service/Pro cess/ReturnFileInfo@SDT/{:198::4:keys@SDT/[2:126:@SDT/{:56::12:display-name@SDT/$S:11:Return Code:3: key@SDT/$S:2:rc@SDT/{:50::12:display-name@SDT/$S:4:Data:3:key@SDT/$S:4:data:4:name@SDT/$S:35:STAF/Se rvice/Process/ReturnFileInfo@SDT/%:1016::35:STAF/Service/Process/CompletionInfo@SDT/$S:1:0@SDT/$0:0: @SDT/[2:944:@SDT/%:863::35:STAF/Service/Process/ReturnFileInfo@SDT/$S:1:0@SDT/$S:801: Volume in driv e C has no label. Volume Serial Number is 541C-084E Directory of C:\STAF 04/27/2005 01:05 PM <DIR> . 04/27/2005 01:05 PM <DIR> .. 04/27/2005 01:04 PM <DIR> bin 04/27/2005 01:04 PM <DIR> codepage 04/27/2005 01:05 PM <DIR> data 04/27/2005 01:04 PM <DIR> docs 04/27/2005 01:04 PM <DIR> include 04/27/2005 01:03 PM <DIR> lib 04/21/2005 02:59 PM 15,710 LICENSE.htm 04/27/2005 01:04 PM <DIR> samples 04/27/2005 01:04 PM 285 STAFEnv.bat 04/27/2005 01:03 PM <DIR> _jvm 04/27/2005 01:04 PM <DIR> _uninst 2 File(s) 15,995 bytes 11 Dir(s) 13,860,478,976 bytes free @SDT/%:60::35:STAF/Service/Process/ReturnFileInfo@SDT/$S:1:0@SDT/$S:0:' STDOUT output ====================================================================== Volume in drive C has no label. Volume Serial Number is 541C-084E Directory of C:\STAF 04/27/2005 01:05 PM <DIR> . 04/27/2005 01:05 PM <DIR> .. 04/27/2005 01:04 PM <DIR> bin 04/27/2005 01:04 PM <DIR> codepage 04/27/2005 01:05 PM <DIR> data 04/27/2005 01:04 PM <DIR> docs 04/27/2005 01:04 PM <DIR> include 04/27/2005 01:03 PM <DIR> lib 04/21/2005 02:59 PM 15,710 LICENSE.htm 04/27/2005 01:04 PM <DIR> samples 04/27/2005 01:04 PM 285 STAFEnv.bat 04/27/2005 01:03 PM <DIR> _jvm 04/27/2005 01:04 PM <DIR> _uninst 2 File(s) 15,995 bytes 11 Dir(s) 13,860,478,976 bytes free End of STDOUT output ============================================================== unRegister rc=0 ...but it blows up if I run it under the Perl debugger, even thought I don't *do* anything with the debugger (other than enter "c" for "continue", to run the program): J:\>perl -d TEST_STAF.pl Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `perldoc perldebug' for more help. main::(TEST_STAF.pl:13): my($STAFH) = STAF::STAFHandle->new("MyTestProgram"); DB<1> c STAFH->submit() returned! Result->{rc}='0' Result->{result}='@SDT/*:1626:@SDT/{:587::13:map-class-map@SDT/{:559::35:STAF/Service/Process/Comple tionInfo@SDT/{:261::4:keys@SDT/[3:189:@SDT/{:56::12:display-name@SDT/$S:11:Return Code:3:key@SDT/$S: 2:rc@SDT/{:48::12:display-name@SDT/$S:3:Key:3:key@SDT/$S:3:key@SDT/{:55::12:display-name@SDT/$S:5:Fi les:3:key@SDT/$S:8:fileList:4:name@SDT/$S:35:STAF/Service/Process/CompletionInfo:35:STAF/Service/Pro cess/ReturnFileInfo@SDT/{:198::4:keys@SDT/[2:126:@SDT/{:56::12:display-name@SDT/$S:11:Return Code:3: key@SDT/$S:2:rc@SDT/{:50::12:display-name@SDT/$S:4:Data:3:key@SDT/$S:4:data:4:name@SDT/$S:35:STAF/Se rvice/Process/ReturnFileInfo@SDT/%:1016::35:STAF/Service/Process/CompletionInfo@SDT/$S:1:0@SDT/$0:0: @SDT/[2:944:@SDT/%:863::35:STAF/Service/Process/ReturnFileInfo@SDT/$S:1:0@SDT/$S:801: Volume in driv e C has no label. Volume Serial Number is 541C-084E Directory of C:\STAF 04/27/2005 01:05 PM <DIR> . 04/27/2005 01:05 PM <DIR> .. 04/27/2005 01:04 PM <DIR> bin 04/27/2005 01:04 PM <DIR> codepage 04/27/2005 01:05 PM <DIR> data 04/27/2005 01:04 PM <DIR> docs 04/27/2005 01:04 PM <DIR> include 04/27/2005 01:03 PM <DIR> lib 04/21/2005 02:59 PM 15,710 LICENSE.htm 04/27/2005 01:04 PM <DIR> samples 04/27/2005 01:04 PM 285 STAFEnv.bat 04/27/2005 01:03 PM <DIR> _jvm 04/27/2005 01:04 PM <DIR> _uninst 2 File(s) 15,995 bytes 11 Dir(s) 13,860,413,440 bytes free @SDT/%:60::35:STAF/Service/Process/ReturnFileInfo@SDT/$S:1:0@SDT/$S:0:' Use of uninitialized value in string eq at C:/STAF/bin/PLSTAF.pm line 311. at C:/STAF/bin/PLSTAF.pm line 311 STAF::STAFUnmarshall('@SDT/*:1626:@SDT/{:587::13:map-class-map@SDT/{:559::35:STAF/S...') cal led at TEST_STAF.pl line 34 <At this point, Perl blows up with an application exception...> J:\> Can anyone suggest what I might be doing wrong? ---------------------------------------------------------------------------------------- Joe Veilleux IBM/Rational CTG Quality Engineering 20 Maguire Road Lexington MA 02421 Tel: (781) 676-2491 Fax: (781) 676-2600 Email: Joe...@us... |