develooper Front page | perl.vmsperl | Postings from May 2002

[PATCH @16694] ithreads for VMS

Thread Next
From:
Craig A. Berry
Date:
May 19, 2002 20:06
Subject:
[PATCH @16694] ithreads for VMS
Message ID:
a05111704b90e14567261@[172.16.52.1]
The patch below gets -Duseithreads to build on VMS, at least with 
Compaq C S6.5-002 on OpenVMS Alpha V7.3.

The test suite looks like so:

ext/Encode/t/perlio.................FAILED at test 1
lib/ExtUtils/t/Command..............FAILED at test 3
Failed 2 test scripts out of 643, 99.69% okay.

as opposed to this for a non-threaded build:

ext/Encode/t/perlio.................FAILED at test 27
lib/ExtUtils/t/Command..............FAILED at test 3
Failed 2 test scripts out of 622, 99.68% okay.

So, the poltergeists inside of Encode + perlio are even scarier than 
in the non-threaded version, but otherwise it looks pretty good. 
ext/Encode/t/perlio.t crashes with an access violation but doesn't 
even report it, which is quite strange.  I wonder if the default 
signal handler is in the wrong thread.

$ define perl_core 1
$ perl [-.ext.encode.t]perlio.t
1..28
[silent and immediate exit here]
$ show symbol $status
  $STATUS == "%X1000000C"
$ write sys$output f$message(%X1000000C)
%SYSTEM-F-ACCVIO, access violation, reason mask=!XB, virtual address=!XH, PC=!XH, PS=!XL


and the patch:

--- configure.com;-0    Tue Apr 30 21:32:07 2002
+++ configure.com       Sun May 19 15:35:40 2002
@@ -5793,19 +5793,38 @@
 $ WC "voidflags='15'"
 $ WC "xs_apiversion='" + version + "'"
 $ WC "PERL_CONFIG_SH='true'"
-
 $!
 $! ## The UNIXy POSIXy reentrantey thingys ##
+$! See "Appendix B, Version-Dependency Tables" in the C RTL
+$! manual for when assorted _r functions became available.
 $!
-
-$ WC "asctime_r_proto='0'"
+$ IF use_threads .AND. vms_ver .GES. "7.2"
+$ THEN
+$   WC "asctime_r_proto='1'"
+$   WC "d_asctime_r='define'"
+$   WC "d_ctime_r='define'"
+$   WC "d_gmtime_r='define'"
+$   WC "d_localtime_r='define'"
+$ ELSE
+$   WC "asctime_r_proto='0'"
+$   WC "d_asctime_r='undef'"
+$   WC "d_ctime_r='undef'"
+$   WC "d_gmtime_r='undef'"
+$   WC "d_localtime_r='undef'"
+$ ENDIF
+$ IF use_threads .AND. vms_ver .GES. "7.3-1"
+$ THEN
+$   WC "d_readdir_r='define'"
+$   WC "readdir64_r_proto='1'"
+$ ELSE
+$   WC "d_readdir_r='undef'"
+$   WC "readdir64_r_proto='0'"
+$ ENDIF
 $ WC "crypt_r_proto='0'"
 $ WC "ctermid_r_proto='0'"
 $ WC "ctime_r_proto='0'"
-$ WC "d_asctime_r='undef'"
 $ WC "d_crypt_r='undef'"
 $ WC "d_ctermid_r='undef'"
-$ WC "d_ctime_r='undef'"
 $ WC "d_drand48_r='undef'"
 $ WC "d_endgrent_r='undef'"
 $ WC "d_endhostent_r='undef'"
@@ -5833,11 +5852,8 @@
 $ WC "d_getservbyport_r='undef'"
 $ WC "d_getservent_r='undef'"
 $ WC "d_getspnam_r='undef'"
-$ WC "d_gmtime_r='undef'"
-$ WC "d_localtime_r='undef'"
 $ WC "d_random_r='undef'"
 $ WC "d_readdir64_r='undef'"
-$ WC "d_readdir_r='undef'"
 $ WC "d_setgrent_r='undef'"
 $ WC "d_sethostent_r='undef'"
 $ WC "d_setlocale_r='undef'"
@@ -5881,8 +5897,6 @@
 $ WC "i_crypt='undef'"
 $ WC "localtime_r_proto='0'"
 $ WC "random_r_proto='0'"
-$ WC "readdir64_r_proto='0'"
-$ WC "readdir_r_proto='0'"
 $ WC "setgrent_r_proto='0'"
 $ WC "sethostent_r_proto='0'"
 $ WC "setlocale_r_proto='0'"
@@ -5895,7 +5909,6 @@
 $ WC "strerror_r_proto='0'"
 $ WC "tmpnam_r_proto='0'"
 $ WC "ttyname_r_proto='0'
-
 $!
 $! ##END WRITE NEW CONSTANTS HERE##
 $!
--- vms/vms.c;-0        Fri May 17 12:42:24 2002
+++ vms/vms.c   Sun May 19 18:09:47 2002
@@ -3886,7 +3886,7 @@
                                struct list_item **tail,
                                int *count);
 
-static int background_process(int argc, char **argv);
+static int background_process(pTHX_ int argc, char **argv);
 
 static void pipe_and_fork(pTHX_ char **cmargv);
 
@@ -3936,11 +3936,11 @@
      */
     ap = argv[argc-1];
     if (0 == strcmp("&", ap))
-       exit(background_process(--argc, argv));
+       exit(background_process(aTHX_ --argc, argv));
     if (*ap && '&' == ap[strlen(ap)-1])
        {
        ap[strlen(ap)-1] = '\0';
-       exit(background_process(argc, argv));
+       exit(background_process(aTHX_ argc, argv));
        }
     /*
      * Now we handle the general redirection cases that involve '>', '>>',
@@ -4336,7 +4336,7 @@
        }
 }
 
-static int background_process(int argc, char **argv)
+static int background_process(pTHX_ int argc, char **argv)
 {
 char command[2048] = "$";
 $DESCRIPTOR(value, "");
--- vms/vmsish.h;-0     Thu Apr 25 11:56:45 2002
+++ vms/vmsish.h        Sun May 19 17:47:49 2002
@@ -506,7 +506,7 @@
  * help it out a bit.
  */
 #  ifndef DONT_MASK_RTL_CALLS
-#    define sigaction(a,b,c) Perl_my_sigaction(a,b,c)
+#    define sigaction(a,b,c) Perl_my_sigaction(aTHX_ a,b,c)
 #  endif
 #endif
 #ifdef KILL_BY_SIGPRC
[end of patch]
-- 
________________________________________
Craig A. Berry
mailto:craigberry@mac.com

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About