I wrote earlier in the day:
> In fact, I did find one true (VMS-specific) bug while attempting to
> use "perlbug" to report the psuedo-bugs.  A patch is in the works, it
> just needs some more testing.

What brought the bug to light:

    perl "-V"  >foo.out

and you look at foo.out, and see that instead of the usual Perl version
info there's a list of logicals...(well, you get two versions of foo.out,
one with the version info, and one with the logicals).

It's an interaction of the code that I added to make sure that error
messages from exit() don't go to the wrong places...it sets user-mode
logicals for SYS$OUTPUT when STDOUT is redirected.

BUT: the prime_env_iter routine spawns a subroutine to get an initial
list of logicals...it inherits the SYS$OUTPUT (user-mode) which overrides
the (supervisor-mode) SYS$OUTPUT set by LIB$SPAWN, and sends its output
to the wrong place. [I expect the above to be meaningless babble to
non-VMSers]

Anyway, the solution is to make the user-mode logicals have the "confine"
attribute, so that subprocesses won't inherit them.

After this change, 5.6.1-trial3 (as previously patched) passes the test
suite.  AND passes my own set of redirection/inheritance tests.  So I
think we're okay now.

Apply the following patch to 5.6.1-trial3 and 5.7.0 (current).

$diff -uBb vms/vms.c-orig vms/vms.c
--- vms/vms.c-orig      Thu Mar  1 14:42:30 2001
+++ vms/vms.c   Tue Mar 20 11:15:08 2001
@@ -743,7 +743,7 @@
 {
     $DESCRIPTOR(d_tab, "LNM$PROCESS");
     struct dsc$descriptor_d d_name = {0,DSC$K_DTYPE_T,DSC$K_CLASS_D,0};
-    unsigned long int iss, attr = 0;
+    unsigned long int iss, attr = LNM$M_CONFINE;
     unsigned char acmode = PSL$C_USER;
     struct itmlst_3 lnmlst[2] = {{0, LNM$_STRING, 0, 0},
                                  {0, 0, 0, 0}};
@@ -1883,8 +1883,8 @@
     fprintf(fp,"$ perl_del    = \"delete\"\n");
     fprintf(fp,"$ pif         = \"if\"\n");
     fprintf(fp,"$!  --- define i/o redirection (sys$output set by lib$spawn)\n");
-    fprintf(fp,"$ pif perl_popen_in  .nes. \"\" then perl_define/user sys$input  
'perl_popen_in'\n");
-    fprintf(fp,"$ pif perl_popen_err .nes. \"\" then perl_define/user sys$error  
'perl_popen_err'\n");
+    fprintf(fp,"$ pif perl_popen_in  .nes. \"\" then 
+perl_define/user/name_attributes=confine sys$input  'perl_popen_in'\n");
+    fprintf(fp,"$ pif perl_popen_err .nes. \"\" then 
+perl_define/user/name_attributes=confine sys$error  'perl_popen_err'\n");
     fprintf(fp,"$ pif perl_popen_out .nes. \"\" then perl_define      sys$output 
'perl_popen_out'\n");
     fprintf(fp,"$ cmd = perl_popen_cmd\n");
     fprintf(fp,"$!  --- get rid of global symbols\n");


$ diff -uBb vms/vmspipe.com-orig vms/vmspipe.com
--- vms/vmspipe.com-orig        Tue Mar 20 11:14:12 2001
+++ vms/vmspipe.com     Tue Mar 20 08:14:51 2001
@@ -6,8 +6,8 @@
 $ perl_del    = "delete"
 $ pif         = "if"
 $!  --- define i/o redirection (sys$output set by lib$spawn)
-$ pif perl_popen_in  .nes. "" then perl_define/user sys$input  'perl_popen_in'
-$ pif perl_popen_err .nes. "" then perl_define/user sys$error  'perl_popen_err'
+$ pif perl_popen_in  .nes. "" then perl_define/user/name_attributes=confine sys$input 
+ 'perl_popen_in'
+$ pif perl_popen_err .nes. "" then perl_define/user/name_attributes=confine sys$error 
+ 'perl_popen_err'
 $ pif perl_popen_out .nes. "" then perl_define      sys$output 'perl_popen_out'
 $ cmd = perl_popen_cmd
 $!  --- get rid of global symbols
--
 Drexel University       \V                    --Chuck Lane
======]---------->--------*------------<-------[===========
     (215) 895-1545     _/ \  Particle Physics
FAX: (215) 895-5934     /\ /~~~~~~~~~~~        [EMAIL PROTECTED]

Reply via email to