[Bug libfortran/67412] New: gfortran.dg/execute_command_line_2.f90 FAILs

ro at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Aug 31 14:30:00 GMT 2015


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

            Bug ID: 67412
           Summary: gfortran.dg/execute_command_line_2.f90 FAILs
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: fxcoudert at gcc dot gnu.org
  Target Milestone: ---
            Target: *-*-solaris2.10

The new gfortran.dg/execute_command_line_2.f90 test FAILs on Solaris 10:

FAIL: gfortran.dg/execute_command_line_2.f90   -O0  execution test
FAIL: gfortran.dg/execute_command_line_2.f90   -O1  execution test
FAIL: gfortran.dg/execute_command_line_2.f90   -O2  execution test
FAIL: gfortran.dg/execute_command_line_2.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/execute_command_line_2.f90   -O3 -g  execution test
FAIL: gfortran.dg/execute_command_line_2.f90   -Os  execution test

both 32 and 64-bit.  Solaris 11 and 12 are ok.

In the log, I find

spawn [open ...]^M
sh: /nosuchfile: not found

Program aborted. Backtrace:
#0  0xfee7efdf

Running the testcase under gdb reveals that the c == 0 check causes the abort.

I notice that on Solaris 10, system exits with res = 256 (0x0100), while on
Solaris 12 I get res = 32512 (0x7F00).

Trying the essence of the test manually, I see

* Solaris 10 /bin/sh:

  /nosuchfile => exit code 1

* Solaris 10 /bin/ksh:

  /nosuchfile => exit code 127

It seems the old buggy Solaris /bin/sh is the culprit.  According to the
OpenSolaris sources, per default system(3C) uses /bin/sh, but if linked
with values-xpg4.o (which isn't currently used, while the Studio c89 compiler
does), /usr/xpg4/bin/sh is, which is a posix conformant shell and yields
the correct exit code.

I'm uncertain how best to handle this.

  Rainer



More information about the Gcc-bugs mailing list