This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

SIGSEGV inside a simple gfortran compiled code


Dear Jerry,

Here is again Georgy Salnikov from Novosibirsk, if you remember, several
years ago I reported some problems with gfortran runtime. From that time,
everything worked fine for me.

And now yet another quirk.

The following program, let's say, test.f:

      PROGRAM ERRMES
 9999 FORMAT ('ERROR')
      PRINT 9999
      END

works fine, when compiled simply by `gfortran -o test test.f`, under both
ix86 and x86_64 architectures. However, when compiled under x86_64 with
32-bit compatibility with:

gfortran -m32 -o test test.f

./test
Segmentation fault

The very same crash of such a 32-bit binary under 64-bit OS takes place if
the program was compiled under 32-bit OS with pure 32-bit gfortran and then
copied into 64-bit system and started there.

Gdb shows that the program crashes somewhere inside libgfortran.

At the gcc-3 century the program compiled with g77 -m32... did work under
x86_64. It did work also when compiled with gfortran up to version
gcc-4.1.2. Starting from gcc-4.2, and up to now, it dumps core after
gfortran -m32 followed by starting under x86_64.

Is this behaviour known? Is it deemed to be allowed to print text strings
from inside 32-bit Fortran programs under 64-bit OS? Or is it generally
forbidden?

Best wishes,
Georgy.
_______________________________________________________________________________

Georgy Salnikov
NMR Group
Novosibirsk Institute of Organic Chemistry
Lavrentjeva, 9, 630090 Novosibirsk, Russia
Phone   +7-383-3307864
Email   sge@nmr.nioch.nsc.ru
_______________________________________________________________________________


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]