develooper Front page | perl.perl5.porters | Postings from December 2000

Re: [ID 20001214.011] Unreachable value in a search list logical name

Craig A. Berry
December 14, 2000 13:17
Re: [ID 20001214.011] Unreachable value in a search list logical name
Message ID:
At 12:11 PM -0800 12/14/00, Peter Prymmer wrote:
> noted that:
>>  In a search list logical name with more than 7 values, the last
>  > values are not reachable.

>Which I can reproduce even with older perls.  It seems as though this is
>a limitation that DECC imposes on its interface to the $trnlnm() system
>service.  The translation done by perl is carried out in the my_trnlnm()
>routine in perl_root:[vms]vms.c.  Where you'll note that search list
>translation does not exceed LNM$_MAX_INDEX translations.  That parameter
>is defined in lnmdef.h (a module to be found in the
>SYS$LIBRARY:SYS$STARLET_C.TLB header library) on my older V5.5-002 I have
>this definition:
>#define LNM$_MAX_INDEX 7                /* Maximum translation index */
>I am not sure why DECC imposes this limitation.

It doesn't.  This turns out to be a bona fide bug in Perl on VMS.  We
are using LNM$_MAX_INDEX as if it were the largest allowable index
value, but instead it is an item code which tells sys$trnlnm "Give me
the value of the highest current index," or, in other words, give me
the index of the last one in the list if it is a search list logical.
For more details see the OpenVMS System Services Reference Manual
entry for $TRNLNM located here:


You'll also find there that the valid index values are 0 through 127.
It's possible all we'll need is what follows, though my build
directory is in a bit of disarray at the moment so I haven't tested
it yet.

--- vms/vms.c;-0        Fri Dec  8 14:28:19 2000
+++ vms/vms.c   Thu Dec 14 15:06:44 2000
@@ -152,7 +152,7 @@

-    if (!lnm || !eqv || idx > LNM$_MAX_INDEX) {
+    if (!lnm || !eqv || idx > 127) {
        set_errno(EINVAL); set_vaxc_errno(SS$_BADPARAM); return 0;
      for (cp1 = (char *)lnm, cp2 = uplnm; *cp1; cp1++, cp2++) {

Craig A. Berry Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About