public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/106295] New: INQUIRE statement bus error at runtime
@ 2022-07-14 13:09 ghlixo at gmail dot com
  2022-07-14 13:11 ` [Bug libfortran/106295] " ghlixo at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ghlixo at gmail dot com @ 2022-07-14 13:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106295

            Bug ID: 106295
           Summary: INQUIRE statement bus error at runtime
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ghlixo at gmail dot com
  Target Milestone: ---

Created attachment 53296
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53296&action=edit
Main program (to be compiled with latest release, e.g. 11.2.0)

Fortran subroutine using INQUIRE(UNIT=..., OPENED=...) compiled with gfortran
4.9.2 fails with bus error when linked by gfortran 11.2.0 to main program. 
Works OK if subroutine recompiled with gfortran 11.2.0; clearly a run-time
library version skew; possibly a library versioning bug.

If not a bug, and instead a fact of life of libfortran evolution, there should
be better user-level documentation of when library incompatibilities happen,
ideally in the gfortran/news wiki.  Then those who provide subroutine packages
for general use can alert their users of runtime library compatibility issues. 
The only gfortran documentation I've seen discussing library version
incompatibilities is in

https://gcc.gnu.org/wiki/LibgfortranAbiCleanup

which mentions the ABI being broken in version 7 and again in version 8; I
wouldn't quite call this user-level information. 

Target:  x86_64-apple-darwin18.7.0

Debug output:
#/usr/local/bin/gfortran -g -c -o /tmp/inqtest.o /tmp/inqtest.f  # gfortran
4.9.2
#gfortran -g -o /tmp/inqmain /tmp/inqmain.o /tmp/inqtest.o       # gfortran
11.2.0
#gdb /tmp/inqmain
GNU gdb (GDB) 9.2-macos-20220204
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin18.7.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /tmp/inqmain...
(gdb) run
Starting program: /private/tmp/inqmain 
[New Thread 0x2603 of process 92337]
[New Thread 0x1803 of process 92337]
[New Thread 0x2303 of process 92337]

Thread 3 received signal SIGBUS, Bus error.
0x00000001002e6fe5 in ?? () from /opt/gfortran/lib/libgfortran.5.dylib
(gdb) where
#0  0x00000001002e6fe5 in ?? () from /opt/gfortran/lib/libgfortran.5.dylib
#1  0x00000001002e7f35 in ?? () from /opt/gfortran/lib/libgfortran.5.dylib
#2  0x0000000100000d55 in zgtfun (nfun=19, nerr=0) at /tmp/inqtest.f:10
#3  0x0000000100000c83 in MAIN__ () at /tmp/inqmain.f:6
(gdb) up
#1  0x00000001002e7f35 in ?? () from /opt/gfortran/lib/libgfortran.5.dylib
(gdb) up
#2  0x0000000100000d55 in zgtfun (nfun=19, nerr=0) at /tmp/inqtest.f:10
10              inquire(unit=nfun,opened=lopen)
(gdb) q
A debugging session is active.

        Inferior 1 [process 92337] will be killed.

Quit anyway? (y or n) y
#

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

end of thread, other threads:[~2024-03-19 17:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14 13:09 [Bug libfortran/106295] New: INQUIRE statement bus error at runtime ghlixo at gmail dot com
2022-07-14 13:11 ` [Bug libfortran/106295] " ghlixo at gmail dot com
2022-07-14 13:12 ` ghlixo at gmail dot com
2022-07-14 13:13 ` ghlixo at gmail dot com
2022-07-14 18:37 ` anlauf at gcc dot gnu.org
2024-03-06  2:49 ` jvdelisle at gcc dot gnu.org
2024-03-19 16:07 ` ghlixo at gmail dot com
2024-03-19 17:22 ` jvdelisle at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).