[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::fortran

Title:Digital Fortran
Notice:Read notes 1.* for important information
Moderator:QUARK::LIONEL
Created:Thu Jun 01 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1333
Total number of notes:6734

1272.0. "OpenVMS V7.1 FORRTL and ADARTL incompatibility" by AXCL01::BRUTTIN (Armand Bruttin MCS Geneva) Mon Apr 28 1997 05:13

    HI,
    
    Since the system has been updated to OpenVMS Alpha Version 7.1 (A2100)
    A fortran program calling a DEC ADA package ACCVIO during the program
    rundown.
    
            %SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual
            address=FFFFFFFF00A4E2C0, PC=000000000075DB08, PS=0000001B
            break on unhandled exception at SHARE$ADARTL+178952
    
    The ACCVIO occurs after the END statement of the program FORTRAN,
    during the ADA task rundown.
    
    The interesting thing is that,  as far I can understand, the problem 
    occurs only if a ADA thread is started. If you look at the ADA code,
    you will see at 'image activation' the procedure BUG_PACKAGE start
    the function INITIALISE.
    
    I also found, if I remove all the "type *,'xxxx'" statement in the main
    fortran code, the program works ???
    
    If the same ADA PACKAGE is called from C there is no problem.
    
    At 'image activation' the procedure INITIALISE is fired, this creates a
    ADA thread before the the FORTRAN program is started.
    
    I think, FORTRAN and ADA open automaticaly resources for sys$input,
    sys$output and sys$error, this may make trouble during the cleanup.
    
    I suspect that the FORRTL corrupt "I don't know what" during the
    cleanup and the deallocation of some resources.
    
    EXAMPLE:
    --------
    $ run BUG_FOR.EXE
    BUG_PACKAGE: procedure INITIALISE               ! Ada thread
    
             OpenVMS Alpha DEBUG Version V7.1-000
    
    %DEBUG-I-INITIAL, Language: FORTRAN, Module: BUG_FOR
    
    DBG> sh task
    
      task id     pri hold state   substate       task object
    * %TASK 1     df       READY                SHARE$ADARTL+393712
    
    DBG> Step
    stepped to BUG_FOR\%LINE 5
         5:          type *,'Start Fortran program'
    DBG> Step
    Start Fortran program                            ! Main fortran program
    stepped to BUG_FOR\%LINE 6
         6:       status = pm ()
    DBG> Step
    BUG_PACKAGE: procedure BUG_RETURN_1
    stepped to BUG_FOR\%LINE 7
         7:          type *,'No active partitions'
    DBG> Step
    No active partitions
    stepped to BUG_FOR\%LINE 8
         8:       END                                ! Rundown Fortran
    DBG> Step
    stepped to SHARE$PTHREAD$RTL+311624              ! Rundown ADA = ACCVIO
    DBG> go
    %SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual
    address=FFFFFFFF00A4E2C0, PC=000000000075DB08, PS=0000001B
    break on unhandled exception at SHARE$ADARTL+178952
    
    
    This program demonstrates the problem. The source code has been cut
    down to
    nearly the minimum.
    
    ---------------------------------------------------------------------
    $!
    $!
    $ create bug_for.for
          PROGRAM BUG_FOR
          IMPLICIT NONE
          INTEGER pm
          INTEGER status
             type *,'Start Fortran program'
          status = pm ()
             type *,'No active partitions'
          END
    
    C######################################################################
          INTEGER FUNCTION pm ()
          IMPLICIT NONE
          INTEGER BUG_RETURN_1
          INTEGER status
            status = BUG_RETURN_1()
            pm = status
          END
    $
    $ create bug_c.c
    #include stdio
    extern int BUG_RETURN_1();
    
    int pm()
    {
            int status;
            status = BUG_RETURN_1();
            return status;
    }
    
    main()
    {
            int status;
            printf("Start C Program\n");
            status = pm();
            printf("End C Program : status = %x", status);
    }
    $ CREATE BUG_PACKAGE.ADA
    with CONDITION_HANDLING; use CONDITION_HANDLING;
    with SYSTEM; use SYSTEM;
    with Text_IO;
    with STARLET;
    ------------------------------------------------------------------------------
    package BUG_PACKAGE is
        procedure BUG_RETURN_1 (STATUS  : out  COND_VALUE_TYPE );
        pragma EXPORT_VALUED_PROCEDURE ( BUG_RETURN_1,
               PARAMETER_TYPES =>(COND_VALUE_TYPE),
               MECHANISM =>(VALUE));
    end BUG_PACKAGE;
    ------------------------------------------------------------------------------
    package body BUG_PACKAGE is
    procedure BUG_RETURN_1 (STATUS  : out  COND_VALUE_TYPE ) is
    begin
           Text_IO.Put_Line("BUG_PACKAGE: procedure BUG_RETURN_1");
           STATUS :=1;
    end BUG_RETURN_1;
    ------------------------------------------------------------------------------
    procedure INITIALISE is
        STATUS : COND_VALUE_TYPE;
    
    begin
        Text_IO.Put_Line("BUG_PACKAGE: procedure INITIALISE");
        status := 1;
    end INITIALISE;
    ------------------------------------------------------------------------------
    begin
            INITIALISE;          -- execute once, at package elaboration
    end BUG_PACKAGE;
    $!
    $!
    $ ada/debug/nooptimize BUG_PACKAGE.ADA
    $ ACS EXPORT/LOG/NOMAIN/OBJECT=BUG_PACKAGE.OBJ BUG_PACKAGE
    $ link/debug/share/exec=BUG_SHR.EXE BUG_PACKAGE,sys$input/opt
    NAME=BUG_PACKAGE
    IDENTIFICATION="V2.0"
    GSMATCH=ALWAYS,0,0
    COLLECT=CLUSTER1,$$$$VECTOR,$CODE
    symbol_vector = (BUG_RETURN_1=procedure)
    $
    $ INSTALL replace/share W1:[BRUTTIN.ADA_BUG]BUG_SHR.EXE
    $ define/system/exec BUG_SHR W1:[BRUTTIN.ADA_BUG]BUG_SHR.EXE
    $ fortran/noopt/debug BUG_FOR.FOR
    $ link/debug BUG_FOR,sys$input/opt
    BUG_SHR/share
    $!
    -------------------------------------------------------------------------------
    
    Armand Bruttin.
T.RTitleUserPersonal
Name
DateLines
1272.1QUARK::LIONELFree advice is worth every centMon Apr 28 1997 09:127
If you're using threads, you must compile with /REENTRANCY=THREADED.  Earlier
versions of the Fortran RTL were non-threaded, but the 7.1 version supports
threads - but it must be made aware of them.

Try that and see if it helps.

				Steve
1272.2RE: .1 /REENTRANCY=THREADED does not solve the problemAXCL01::BRUTTINArmand Bruttin MCS GenevaMon Apr 28 1997 09:598
    Steve,
    
    Compiling with the switch /REENTRANCY=THREADED does not solve the
    problem.
    
    regards,
    
    Armand
1272.3QUARK::LIONELFree advice is worth every centMon Apr 28 1997 10:403
Ok - I'll pass this on to the RTL folks.

			Steve
1272.4QUARK::LIONELFree advice is worth every centMon Apr 28 1997 13:4420
Here's something else to try.

Copy from FORMAT::FORTRAN$PUBLIC: the following files:

	FOR$DEC$FORRTL-V61.EXE
	FOR$DEC$FORRTL-V70.EXE

First, define the logical name DEC$FORRTL to point to your local copy of
FOR$DEC$FORRTL-V70.EXE (include the disk and directory) and see if the problem
remains.  If it does, try FOR$DEC$FORRTL-V61.EXE.  That should make the problem
"go away", but it is just a workaround - that's a non-threaded version of the
RTL.  However, I'll note that we never supported Fortran I/O calls in a
multithreaded environment prior to OpenVMS V7.0 and you may be lucky or you
may not be....

Whichever of these works, copy it to SYS$COMMON:[SYSLIB]DEC$FORRTL.EXE and
do an INSTALL/REPLACE SYS$LIBRARY:DEC$FORRTL.EXE   Let us know which you use -
we'll look at the problem (though do NOT expect a quick answer!)

				Steve
1272.5re: .4 FOR$DEC$FORRTL-V61.EXE fix the problemAXPMCS::BRUTTINArmand Bruttin MCS GenevaTue Apr 29 1997 04:258
    Steve,
    
    With the library FOR$DEC$FORRTL-V70.EXE the problem is the same.
    FOR$DEC$FORRTL-V61.EXE seems to fix the problem.
    
    Thanks,
    
    Armand.
1272.6re: .4 The problem still at customer siteAXPMCS::BRUTTINArmand Bruttin MCS GenevaTue Apr 29 1997 07:117
    Steve,
    
    With my small program FOR$DEC$FORRTL-V61.EXE fix the problem, but
    at customer site the problem still the same with FOR$DEC$FORRTL-V61.EXE
    or FOR$DEC$FORRTL-V70.EXE.
    
    Armand
1272.7QUARK::LIONELFree advice is worth every centTue Apr 29 1997 10:5710
How did the customer "use" the new RTL?  Did they define the logical name
or just copy it to SYS$COMMON:[SYSLIB]?  If the latter, did they name it
correctly and do the INSTALL REPLACE?  I have a hard time believing that the
-V61 RTL shows the same problem.

Keep in mind that this is NOT a "fix" - it simply uses a non-thread-aware
version of the RTL, and this in itself can cause problems when used with
threads.

				Steve
1272.8re: .7 The customer "use" the new RTLAXPMCS::BRUTTINArmand Bruttin MCS GenevaTue Apr 29 1997 12:5641
    Steve,
    
    $ anal/image sys$library:DEC$FORRTL.EXE
    
    Image Identification Information
    
                    image name: "DEC$FORRTL"
                    image file identification: "V01-05.370"
                    image file build identification: "X5RG-SSB-0000"
                    link date/time: 15-APR-1997 21:40:28.50
                    linker identification: "T11-11"
    

    $instal replace sys$library:DEC$FORRTL.EXE
    $instal list/full sys$library:DEC$FORRTL.EXE
    
    DISK$AXPVMSSYS:<SYS0.SYSCOMMON.SYSLIB>.EXE
       DEC$FORRTL;2     Open Hdr Shar          Lnkbl
            Entry access count         = 0
            Current / Maximum shared   = 0 / 0
            Global section count       = 10
    
    
    AXADAQ$ qptn
    Partition    Process           ROCs in use
    ALEPH        AXADAQ::P_ALEP_0
    %SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual
    address=FFFFFFFF00EC42C0, PC=00000000003A3B08, PS=0000001B
    %TRACE-F-NOMSG, Message number 0009804C
      image    module    routine      line      rel PC           abs PC
     ADARTL                              0 000000000002BB08 00000000003A3B08
     ADARTL                              0 0000000000054710 00000000003CC710
                                         0 FFFFFFFF80046CC0 FFFFFFFF80046CC0
     PTHREAD$RTL                         0 000000000004D260 00000000004D9260
     PTHREAD$RTL                         0 000000000004C910 00000000004D8910
     PTHREAD$RTL                         0 0000000000030664 00000000004BC664
                                         0 FFFFFFFF855BB0D8 FFFFFFFF855BB0D8
    
    
    Armand.
    
1272.9QUARK::LIONELFree advice is worth every centTue Apr 29 1997 14:306
Please show the results of the following:

  SHOW LOGICAL DEC$FORRTL
  DIR SYS$SHARE:DEC$FORRTL.EXE

			Steve
1272.10re: .9 AXCL01::BRUTTINArmand Bruttin MCS GenevaWed Apr 30 1997 05:4512
    Steve,
    
    $ AXAONL$ sh log DEC$FORRTL
    %SHOW-S-NOTRAN, no translation for logical name DEC$FORRTL
    
    $DIR SYS$SHARE:DEC$FORRTL.EXE
    
    Directory SYS$COMMON:[SYSLIB]
    
    DEC$FORRTL.EXE;3
    
    Armand.
1272.11QUARK::LIONELFree advice is worth every centWed Apr 30 1997 12:2616
Aha!  I thought so.  Compare:

    Directory SYS$COMMON:[SYSLIB]
    
    DEC$FORRTL.EXE;3
    
    DISK$AXPVMSSYS:<SYS0.SYSCOMMON.SYSLIB>.EXE
       DEC$FORRTL;2     Open Hdr Shar          Lnkbl
            Entry access count         = 0
            Current / Maximum shared   = 0 / 0
            Global section count       = 10


An INSTALL REPLACE wasn't done on this system.

			Steve
1272.12RE: .11 sys$share:DEC$FORRTL.EXEAXCL01::BRUTTINArmand Bruttin MCS GenevaWed Apr 30 1997 14:17109
    Steve,
    
    The actual DEC$FORRTL.EXE;3 is the original DEC$FORRTL from OpenVMS
    V7.1. The customer reverts to the original DEC$FORRTL.
    
    " FOR SURE THE IMAGE DEC$FORRTL (V6.1) HAS BEEN REPLACED"
    
    
AXADAQ$ sh log dec$forrtl

(LNM$PROCESS_TABLE)

(LNM$JOB_81D6C640)

(LNM$GROUP_000001)

(LNM$SYSTEM_TABLE)

(DECW$LOGICAL_NAMES)
%SHOW-S-NOTRAN, no translation for logical name DEC$FORRTL
    
AXADAQ$ instal list/full sys$share:dec$forrtl.exe

DISK$AXPVMSSYS:<SYS0.SYSCOMMON.SYSLIB>.EXE         
   DEC$FORRTL;3     Open Hdr Shar          Lnkbl 
        Entry access count         = 186
        Current / Maximum shared   = 0 / 11
        Global section count       = 11

AXADAQ$ anal/image/header sys$share:dec$forrtl.exe

Analyze Image                                30-APR-1997 18:57:55.74   Page 1
SYS$COMMON:[SYSLIB]DEC$FORRTL.EXE;3
ANALYZ A07-04

This is an OpenVMS Alpha image file
	Image Identification Information

		image name: "DEC$FORRTL"
		image file identification: "V01-05.292"
		image file build identification: "X6C7-0040069227"
		link date/time: 25-NOV-1996 21:54:39.91
		linker identification: "A11-39"

AXADAQ$ 
AXADAQ$ qptn
No active partitions
%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=FFFFFFFF00EC42C0, PC=0000000000393B08, PS=0000001B
%TRACE-F-NOMSG, Message number 0009804C
  image    module    routine             line      rel PC           abs PC      
 ADARTL                                     0 000000000002BB08 0000000000393B08
 ADARTL                                     0 0000000000054710 00000000003BC710
                                            0 FFFFFFFF80046CC0 FFFFFFFF80046CC0
 PTHREAD$RTL                                0 000000000004D260 00000000004C9260
 PTHREAD$RTL                                0 000000000004C910 00000000004C8910
 PTHREAD$RTL                                0 0000000000030664 00000000004AC664
                                            0 FFFFFFFF855BB0D8 FFFFFFFF855BB0D8
AXADAQ$
AXADAQ$
    
AXADAQ$ copy FOR$DEC$FORRTL-V61.EXE sys$common:[syslib]dec$forrtl.exe
AXADAQ$ dir sys$share:dec$forrtl.exe.*

Directory SYS$COMMON:[SYSLIB]

DEC$FORRTL.EXE;4    DEC$FORRTL.EXE;3    

Total of 2 files.
    
AXADAQ$ anal/image/header SYS$SHARE:DEC$FORRTL.EXE

Analyze Image                                30-APR-1997 19:00:08.00   Page 1
SYS$COMMON:[SYSLIB]DEC$FORRTL.EXE;4
    
ANALYZ A07-04

This is an OpenVMS Alpha image file

	Image Identification Information

		image name: "DEC$FORRTL"
		image file identification: "V01-05.370"
		image file build identification: "X5RG-SSB-0000"
		link date/time: 15-APR-1997 21:40:28.50
		linker identification: "T11-11"

AXADAQ$ instal replace sys$share:DEC$FORRTL.EXE
AXADAQ$ instal list/full sys$share:DEC$FORRTL.EXE
    
DISK$AXPVMSSYS:<SYS0.SYSCOMMON.SYSLIB>.EXE
   DEC$FORRTL;4     Open Hdr Shar          Lnkbl 
        Entry access count         = 0
        Current / Maximum shared   = 0 / 0
        Global section count       = 10

AXADAQ$ qptn
No active partitions
%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=FFFFFFFF00EC42C0, PC=00000000003A3B08, PS=0000001B
%TRACE-F-NOMSG, Message number 0009804C
  image    module    routine             line      rel PC           abs PC      
 ADARTL                                     0 000000000002BB08 00000000003A3B08
 ADARTL                                     0 0000000000054710 00000000003CC710
                                            0 FFFFFFFF80046CC0 FFFFFFFF80046CC0
 PTHREAD$RTL                                0 000000000004D260 00000000004D9260
 PTHREAD$RTL                                0 000000000004C910 00000000004D8910
 PTHREAD$RTL                                0 0000000000030664 00000000004BC664
                                            0 FFFFFFFF855BB0D8 FFFFFFFF855BB0D8
    
    Armand.
1272.13QUARK::LIONELFree advice is worth every centWed Apr 30 1997 14:415
Given that we don't have the ADARTL sources, I suggest you copy this over to
the ADA notesfile and ask for assistance.  If it fails using our non-threaded
RTL, something else is going wrong.

				Steve
1272.14AXPMCS::BRUTTINArmand Bruttin MCS GenevaThu May 01 1997 06:155
    steve,
    
    This problem has been submited to ADA group. ( Notes #3865 ).
    
    Armand.