From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 872E13858294; Thu, 14 Jul 2022 13:09:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 872E13858294 From: "ghlixo at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/106295] New: INQUIRE statement bus error at runtime Date: Thu, 14 Jul 2022 13:09:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ghlixo at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2022 13:09:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106295 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=3D53296&action=3Dedit Main program (to be compiled with latest release, e.g. 11.2.0) Fortran subroutine using INQUIRE(UNIT=3D..., OPENED=3D...) compiled with gf= ortran 4.9.2 fails with bus error when linked by gfortran 11.2.0 to main program.= =20 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 sho= uld be better user-level documentation of when library incompatibilities happen, ideally in the gfortran/news wiki. Then those who provide subroutine packa= ges for general use can alert their users of runtime library compatibility issu= es.=20 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.=20 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 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: . Find the GDB manual and other documentation resources online at: . 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=20 [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=3D19, nerr=3D0) 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=3D19, nerr=3D0) at /tmp/inqtest.f:10 10 inquire(unit=3Dnfun,opened=3Dlopen) (gdb) q A debugging session is active. Inferior 1 [process 92337] will be killed. Quit anyway? (y or n) y #=