I'll file it.  Thanks!

/ Tom Edelson

-----Original Message-----
From: Craig A. Berry [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, April 30, 2002 2:29 PM
To: Bohan, Larry; [EMAIL PROTECTED]
Cc: '[EMAIL PROTECTED]'
Subject: sys$check_access on CD-ROM file causes process crash (was RE: opendir doesn't 
seem to work on CD drives)


OK, it turns out this has nothing to do with Perl directly, but since it 
came up here, I'll file my conclusions here.  Can someone with a support 
contract please file an SPR with the details below?  The bug is easily 
reproduced with the small C program (cdproccrash.c) included here.  The 
basic issue is that the sys$check_access call never returns and the process 
in which it is running abruptly exits.

The test shown was on OpenVMS Alpha V7.2-1, standalone Alphastation 255 
4/266, but the same thing happens on v7.3, DPW 500au.  Though it's possible 
I've missed something, nothing that's appeared on the ECO mailing list in 
the last couple of years mentions sys$check_access. Various combinations of 
privileges, including ALL and NOALL, show the same result.  It does not seem 
to matter whether or not the CD-ROM drive is mounted /media=cdrom.

$ mount/over=id dka400
%MOUNT-I-WRITELOCK, volume is write locked
%MOUNT-I-CDROM_ISO, VMSDOC073:DISC_1_OF_1 (1 of 1) , mounted on  _THETIS$DKA400:
$ dir/full dka400:[000000]index.html

Directory DKA400:[000000]

INDEX.HTML;1                  File ID:  (4,11,0)              
Size:          235/235        Owner:    [0,0]
Created:    4-APR-2001 10:37:16.00
Revised:    4-APR-2001 10:37:16.00 (1)
Expires:   <None specified>
Backup:    <No backup recorded>
Effective: <None specified>
Recording:  4-APR-2001 10:37:16.00
File organization:  Sequential
Shelved state:      Online 
Caching attribute:  Writethrough
File attributes:    Allocation: 235, Extend: 0, Global buffer count: 0, Version limit: 
0, Backups disabled
Record format:      Undefined, maximum 0 bytes, longest 0 bytes
Record attributes:  None
RMS attributes:     None
Journaling enabled: None
File protection:    System:RWED, Owner:RWED, Group:RWED, World:RWED
Access Cntrl List:  None
Client attributes:  None

Total of 1 file, 235/235 blocks.
$ 
$ mcr []cdproccrash dka400:[000000]index.html
After I die, do ACCOUNTING/SINCE/IDENT=1277 to see what happened to me.
Checking read access to dka400:[000000]index.html
Press return to continue: 

At which point the process quickly disappears and the accounting log shows 
it to have terminated with an access violation:

$ ACCOUNTING/SINCE/IDENT=1277

     Date / Time      Type     Subtype     Username      ID     Source   Status
--------------------------------------------------------------------------------
30-APR-2002 12:41:55 PROCESS INTERACTIVE CRAIG        00001277 TNA10:   0000000C

Here's the program:

$ type cdproccrash.c
#include <acldef.h>
#include <armdef.h>
#include <chpdef.h>
#include <climsgdef.h>
#include <descrip.h>
#include <jpidef.h>
#include <libdef.h>
#include <lib$routines.h>
#include <stsdef.h>
#include <starlet.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct itmlst_3 {
  unsigned short int buflen;
  unsigned short int itmcode;
  void *bufadr;
  unsigned short int *retlen;
};

int main(int argc, char *argv[])
{
    unsigned int sts, jpi_iosb[2], mypid, access, objtyp;
    static char usrname[12];
    static struct dsc$descriptor_s usrdsc = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, usrname};
    unsigned short int retlen;
    struct dsc$descriptor_s namdsc = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
    struct itmlst_3 armlst[2] = {
      {sizeof access, CHP$_ACCESS, &access, &retlen},
      {0,0,0,0}
    };
    struct itmlst_3 jpilst[3] = {
      {sizeof mypid, JPI$_PID, &mypid, &retlen},
      {sizeof usrname, JPI$_USERNAME, &usrname, &usrdsc.dsc$w_length},
      {0,0,0,0}
    };

    /* If there aren't any parameters, tell the user how it's done and exit. */
    if (argc < 2) {
        fprintf(stderr, "Usage: %s filespec\n", argv[0]);
        exit(CLI$_VALREQ);        
    }

    /* Find out our own pid and username. */
    sts = sys$getjpiw(0,0,0,jpilst,jpi_iosb,0,0);
    if (!$VMS_STATUS_SUCCESS(sts)) exit(sts);
    if (!$VMS_STATUS_SUCCESS(jpi_iosb[0])) exit(jpi_iosb[0]);

    printf("After I die, do ACCOUNTING/SINCE/IDENT=%x to see what happened to 
me.\n",mypid);

    access = ARM$M_READ;
    objtyp = ACL$C_FILE;
    namdsc.dsc$a_pointer = argv[1];
    namdsc.dsc$w_length = strlen(argv[1]);
    printf("Checking read access to %s\nPress return to continue: ", 
namdsc.dsc$a_pointer);
    (void) getchar();

    sts = sys$check_access(&objtyp,&namdsc,&usrdsc,armlst,0,0,0,0);
    if ($VMS_STATUS_SUCCESS(sts)) printf("Access succeeded; is the file on a 
CD-ROM?\n");
    exit(sts);
}
=== cut ===

Here's the ECO info for the system:

$ product show history vms*
----------------------------------- ----------- ----------- --------------------
PRODUCT                             KIT TYPE    OPERATION   DATE AND TIME
----------------------------------- ----------- ----------- --------------------
DEC AXPVMS VMS721_ACRTL V4.0        Patch       Install     24-APR-2002 13:57:43
DEC AXPVMS VMS721_RMS V4.0          Patch       Install     24-APR-2002 13:57:43
DEC AXPVMS VMS721_AUDSRV V2.0       Patch       Install     22-FEB-2002 11:45:54
DEC AXPVMS VMS721_LAN V3.0          Patch       Install     22-FEB-2002 11:45:54
DEC AXPVMS VMS721_RMS V3.0          Patch       Install     22-FEB-2002 11:45:54
DEC AXPVMS VMS721_SYSLOA V2.0       Patch       Install     22-FEB-2002 11:45:54
DEC AXPVMS VMS721_DW_MOT_MUP V1.0   Patch       Install     02-JAN-2002 13:55:26
DEC AXPVMS VMS721_SYS V11.0         Patch       Install     02-JAN-2002 13:21:46
DEC AXPVMS VMS721_DRIVER V3.0       Patch       Install     31-OCT-2001 14:08:42
DEC AXPVMS VMS721_DW_MOT_MUP V1.0   Patch       Install     31-OCT-2001 14:08:42
DEC AXPVMS VMS721_MOUNT96 V3.0      Patch       Install     31-OCT-2001 14:08:42
DEC AXPVMS VMS721_SYS V11.0         Patch       Install     31-OCT-2001 14:08:42
DEC AXPVMS VMS721_SYS V10.0         Patch       Install     25-JUL-2001 15:51:27
DEC AXPVMS VMS721_UPDATE V3.0       Patch       Install     25-JUL-2001 15:38:53
DEC AXPVMS VMS721_SYS V9.0          Patch       Install     13-MAR-2001 13:40:19
DEC AXPVMS VMS721_UPDATE V1.0       Patch       Install     13-MAR-2001 13:23:19
DEC AXPVMS VMS721_PCSI V1.0         Patch       Install     13-MAR-2001 12:01:09
DEC AXPVMS VMS V7.2-1               Oper System Install     31-JAN-2001 13:11:55
----------------------------------- ----------- ----------- --------------------
 
18 items found
$ 

If anyone wants more info, please let me know, but I think that will be more 
than enough to reproduce it.  If I don't hear from someone that this has 
been reported, I guess I'll send it to comp.os.vms and see if one of the 
engineers notices it.

Reply via email to