Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* BEWARE of DECunix f77 3.8 compiler!
@ 1995-09-12  4:00 Walter Brueckner
  1995-09-13  4:00 ` Brian McIlwrath
  0 siblings, 1 reply; 7+ messages in thread
From: Walter Brueckner @ 1995-09-12  4:00 UTC (permalink / raw)


Beware of DEC unix f77 3.8 !
---------------------------

The very simple program below ("uhtoc" ouf of the cern library)
is compiled to incorrect code by f77 3.8, as soon as any
optimization level higher than -O1 is selected (e.g. -O2 ,-O3 or
-O4).
Since the routine is rather simple it indicates a serious
malfunction of the compiler and/or optimizer that almost
certainly will affect other code as well.
I have informed Digital and I am waiting for a bug fix.

Walter Brueckner
Cern


Here is the routine:

CDECK  ID>, UHTOC.
      SUBROUTINE UHTOC (MS,NPW,MT,NCH)
C
C CERN PROGLIB# M409    UHTOC           .VERSION KERNFOR  4.21  890323
C ORIG. 10/02/89  JZ
C
      DIMENSION    MS(99)
      CHARACTER    MT*99
 
      PARAMETER   (NCHAPW=4)
      CHARACTER    CHWORD*(NCHAPW)
      INTEGER      IWORD
      EQUIVALENCE (IWORD,CHWORD)
 
 
      IF   (NCH)             91, 29, 11
   11 IF (NPW.LE.0)          GO TO 91
      IF (NPW.EQ.1)          GO TO 21
      IF (NPW.LT.NCHAPW)     GO TO 31
 
C--------          NPW = maximum
 
      JT     = 0
      NWS    = NCH / NCHAPW
      NTRAIL = NCH - NWS*NCHAPW
 
      DO 14  JS=1,NWS
      IWORD  = MS(JS)
      MT(JT+1:JT+NCHAPW) = CHWORD
   14 JT  = JT + NCHAPW
 
      IF (NTRAIL.EQ.0)       RETURN
 
      IWORD = MS(NWS+1)
      MT(JT+1:JT+NTRAIL) = CHWORD(1:NTRAIL)
      RETURN
 
C--------          NPW = 1
C--                equivalent to 'CALL UH1TOC(MS,MT,NCH)'
 
   21 DO 24  JS=1,NCH
      IWORD  = MS(JS)
      MT(JS:JS) = CHWORD(1:1)
   24 CONTINUE
   29 RETURN
 
C--------          NPW = 2 ...
 
   31 JT     = 0
      NWS    = NCH / NPW
      NTRAIL = NCH - NWS*NPW
 
      DO 34  JS=1,NWS
      IWORD  = MS(JS)
      MT(JT+1:JT+NPW) = CHWORD(1:NPW)
   34 JT  = JT + NPW
 
      IF (NTRAIL.EQ.0)       RETURN
 
      IWORD = MS(NWS+1)
      MT(JT+1:JT+NTRAIL) = CHWORD(1:NTRAIL)
      RETURN
 
   91 CALL ABEND
      END



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: BEWARE of DECunix f77 3.8 compiler!
  1995-09-12  4:00 BEWARE of DECunix f77 3.8 compiler! Walter Brueckner
@ 1995-09-13  4:00 ` Brian McIlwrath
  1995-09-13  4:00   ` Steve Lionel
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Brian McIlwrath @ 1995-09-13  4:00 UTC (permalink / raw)


I believe that I have also found another major (but unrelated) bug in
DEC FORTRAN 3.8!

The effect which caused me to look for this bug is that processes were
becoming impervious to SIGTERM signals and were having to be killed by
SIGKILL - thus negating some exit code.

I traced the problem down to the very simple example below. This seems to
show that the RTL is not resetting the process signal mask after altering
it during critical operations.

This was reported to DEC UK about 6 weeks ago but with little obvious
effect.

An example which shows the bug is:

Given the following f77 program

      program bkm
      call showsig
      print *, "Hello world"
      call showsig
      end

where SHOWSIG is in C and is:

#include <stdio.h>
#include <signal.h>

void showsig_(void)
{
    sigset_t curmask=0;
    if( sigprocmask(0, NULL, &curmask) <0)
	perror("sigprocmask");
    fprintf(stderr, "showsig - sigprocmask is %lx\n", curmask);
}


gives the following output when run:

showsig - sigprocmask is 0
 Hello world
showsig - sigprocmask is 3ff4c04e

Tracing calls to sigprocmask() with dbx shows that it is being called twice 
by the RTL function for__add_to_lf_table(). I speculate that it is
disabling signals for a critical operation but then failing to reenable 
them properly. 

System is:

DEC Unix (OSF) V3.2
Fortran V3.8
Fortran RTL V3.6

   -------------------------------------------------------------------------
   Brian McIlwrath, Starlink Project, Rutherford Appleton Laboratory, UK.
   Tel: +44 (0)1235 446478                      e-mail: bkm@star.rl.ac.uk
   -------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: BEWARE of DECunix f77 3.8 compiler!
  1995-09-13  4:00 ` Brian McIlwrath
@ 1995-09-13  4:00   ` Steve Lionel
  1995-09-19  4:00   ` Signals (was Re: BEWARE of DECunix f77 3.8 compiler!) Juergen Fuhrmann
       [not found]   ` <1995Sep18.143529.7809@cronkite.res.utc.com>
  2 siblings, 0 replies; 7+ messages in thread
From: Steve Lionel @ 1995-09-13  4:00 UTC (permalink / raw)



In article <436d1k$1qn0@unixfe.rl.ac.uk>, bkm@rlsaxp.bnsc.rl.ac.uk 
(Brian McIlwrath) writes:
|>I believe that I have also found another major (but unrelated) bug in
|>DEC FORTRAN 3.8!
|>
|>The effect which caused me to look for this bug is that processes were
|>becoming impervious to SIGTERM signals and were having to be killed by
|>SIGKILL - thus negating some exit code.

This is a known problem which will be addressed by a corrected RTL included
in a compiler kit we will make available through Digital customer support
shortly.  Please contact Digital support about this and any other problems you
may find - they are in the best position to help you.
-- 

Steve Lionel                      Mail: lionel@quark.enet.dec.com
DEC Fortran Development           WWW:  http://www.digital.com/info/slionel.html
Digital Equipment Corporation     CompuServe: 75263,3001
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698             "Free advice is worth every cent"

For information on DEC Fortran 90, see http://www.digital.com/info/hpc/f90/



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Signals (was Re: BEWARE of DECunix f77 3.8 compiler!)
  1995-09-13  4:00 ` Brian McIlwrath
  1995-09-13  4:00   ` Steve Lionel
@ 1995-09-19  4:00   ` Juergen Fuhrmann
  1995-09-20  4:00     ` Steve Lionel
       [not found]   ` <1995Sep18.143529.7809@cronkite.res.utc.com>
  2 siblings, 1 reply; 7+ messages in thread
From: Juergen Fuhrmann @ 1995-09-19  4:00 UTC (permalink / raw)


>>>>> "Steve" == Steve Lionel <lionel@quark.enet.dec.com> writes:

	In article <436d1k$1qn0@unixfe.rl.ac.uk>, bkm@rlsaxp.bnsc.rl.ac.uk 
	(Brian McIlwrath) writes:
	|>I believe that I have also found another major (but unrelated) bug in
	|>DEC FORTRAN 3.8!
	|>
	|>The effect which caused me to look for this bug is that processes were
	|>becoming impervious to SIGTERM signals and were having to be killed by
	|>SIGKILL - thus negating some exit code.

	This is a known problem which will be addressed by a corrected RTL included
	in a compiler kit we will make available through Digital customer support
	shortly.  Please contact Digital support about this and any other problems you
	may find - they are in the best position to help you.

I had the same problem, it can be tracked down in the code below:
On SGI's and SUN's this works as expected, on OSF1 it seems to be 
broken. I it is the same error, we would be very happy to get new
compiler versions.
How to refer to this bug when contacting the support ? Do they
no it ?

Juergen Fuhrmann


Begin Sample code:

      subroutine sigenable(isig)
      integer*4 isig
      external sighand
      call signal(isig,sighand,-1)
      return
      end

      subroutine sighand(isig)
      integer*4 isig
      call sigenable(isig)
      type *,'break, enter i (0 for stop)>'
      accept *,i
      if (i.eq.0) stop
      return
      end
     
      
      program tio
      call sigenable(2)
      do i=1,10000
         type *, 'i=',i
         do j=1,100
            x=i+j+sin(x)
         enddo
      enddo
      end

End Sample code

--
   Juergen Fuhrmann                          fuhrmann@wias-berlin.de
   Weierstrass Institute for Applied Analysis and Stochastics (WIAS)  
   Mohrenstrasse          39                 D-10117 Berlin, Germany     
   phone: (49) 030 20377 560                 fax:   (49) 030 2044975   
                                          
                    *  Bad News is No News *
                   
                   






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: BEWARE of DECunix f77 3.8 compiler!
       [not found]   ` <1995Sep18.143529.7809@cronkite.res.utc.com>
@ 1995-09-19  4:00     ` Steve Lionel
  0 siblings, 0 replies; 7+ messages in thread
From: Steve Lionel @ 1995-09-19  4:00 UTC (permalink / raw)



In article <1995Sep18.143529.7809@cronkite.res.utc.com>,  
0 Bradley_Pete x9338 b-000  <m107072@ws7217> writes:
|>
|>    I have a similar problem with TERM signals under 3.8.  Dec Support in
|>the US was not aware of it, so I forwarded your post and example program
|>to them.  
|

They are aware of it, just not using that terminology.  As I mentioned earlier,
this is a minor problem and a fix will be available shortly.
-- 

Steve Lionel                      Mail: lionel@quark.enet.dec.com
DEC Fortran Development           WWW:  http://www.digital.com/info/slionel.html
Digital Equipment Corporation     CompuServe: 75263,3001
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698             "Free advice is worth every cent"

For information on DEC Fortran 90, see http://www.digital.com/info/hpc/f90/



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Signals (was Re: BEWARE of DECunix f77 3.8 compiler!)
  1995-09-19  4:00   ` Signals (was Re: BEWARE of DECunix f77 3.8 compiler!) Juergen Fuhrmann
@ 1995-09-20  4:00     ` Steve Lionel
  1995-09-21  4:00       ` 0 Bradley_Pete x9338 b-000
  0 siblings, 1 reply; 7+ messages in thread
From: Steve Lionel @ 1995-09-20  4:00 UTC (permalink / raw)



In article <FUHRMANN.95Sep19150515@weyl.wias-berlin.de>, 
fuhrmann@weyl.wias-berlin.de (Juergen Fuhrmann) writes:

|>I had the same problem, it can be tracked down in the code below:
|>On SGI's and SUN's this works as expected, on OSF1 it seems to be 
|>broken. I it is the same error, we would be very happy to get new
|>compiler versions.
|>How to refer to this bug when contacting the support ? Do they
|>no it ?

Yes, they know it.  A fix is available now - ask for DFARTL363.  It is not
a compiler bug, the problem is in the run-time library.
-- 

Steve Lionel                      Mail: lionel@quark.enet.dec.com
DEC Fortran Development           WWW:  http://www.digital.com/info/slionel.html
Digital Equipment Corporation     CompuServe: 75263,3001
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698             "Free advice is worth every cent"

For information on DEC Fortran 90, see http://www.digital.com/info/hpc/f90/



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Signals (was Re: BEWARE of DECunix f77 3.8 compiler!)
  1995-09-20  4:00     ` Steve Lionel
@ 1995-09-21  4:00       ` 0 Bradley_Pete x9338 b-000
  0 siblings, 0 replies; 7+ messages in thread
From: 0 Bradley_Pete x9338 b-000 @ 1995-09-21  4:00 UTC (permalink / raw)


Steve Lionel writes:

> 
> Yes, they know it.  A fix is available now - ask for DFARTL363.  It is not
> a compiler bug, the problem is in the run-time library.
> -- 

    Thanks for your help Steve.  We use TERM signals in the orderly shutdown
of our a parallel CFD application, so this problem has had a significant
impact.

                                             Pete Bradley



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1995-09-21  4:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-09-12  4:00 BEWARE of DECunix f77 3.8 compiler! Walter Brueckner
1995-09-13  4:00 ` Brian McIlwrath
1995-09-13  4:00   ` Steve Lionel
1995-09-19  4:00   ` Signals (was Re: BEWARE of DECunix f77 3.8 compiler!) Juergen Fuhrmann
1995-09-20  4:00     ` Steve Lionel
1995-09-21  4:00       ` 0 Bradley_Pete x9338 b-000
     [not found]   ` <1995Sep18.143529.7809@cronkite.res.utc.com>
1995-09-19  4:00     ` BEWARE of DECunix f77 3.8 compiler! Steve Lionel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox