Bug 31616 - testsuite failures in gfortran.dg/open_errors.f90
Summary: testsuite failures in gfortran.dg/open_errors.f90
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Kaveh Ghazi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-18 05:40 UTC by Kaveh Ghazi
Modified: 2007-04-25 18:08 UTC (History)
2 users (show)

See Also:
Host:
Target: sparc-sun-solaris2.10
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-04-25 18:07:23


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kaveh Ghazi 2007-04-18 05:40:02 UTC
I'm getting testsuite failures in gfortran.dg/open_errors.f90 with mainline on sparc-sun-solaris2.10:

http://gcc.gnu.org/ml/gcc-testresults/2007-04/msg00897.html

The logfile only says:

FAIL: gfortran.dg/open_errors.f90  -O0  execution test

at all optimization levels.  Running it by hand, it simply says:

Abort (core dumped)

If I run it under gdb-6.4, then gdb core dumps, so I don't have a backtrace or any useful info at the moment.  I'll try and see if a later version of gdb does any better.
Comment 1 Jerry DeLisle 2007-04-18 05:48:21 UTC
This could be as simple as the error messages returned by the OS don't match what we put in the test case.  Try changing:

call abort()

to:

print *, msg

This will then print the error messages instead of aborting and you may be able to see what is going on.
Comment 2 Kaveh Ghazi 2007-04-18 06:58:27 UTC
(In reply to comment #1)
> Try changing:
> call abort()
> to:
> print *, msg
> This will then print the error messages instead of aborting and you may be able
> to see what is going on.


If I make your suggested change, I see that I get a failure in the third abort test, where it opens "./" and the msg is " Invalid argument".

PS: gdb-6.6 was no help, it crashes as well. :-(
Comment 3 Jerry DeLisle 2007-04-19 04:05:55 UTC
It looks like this platform has different error messages for a given error.  I suggest that this test case be either marked as expected to fail for this platform  or we could delete the test case altogether.

Another possibility is to pre-process it to check for the different message instead.  I am not sure how to do that within the testsuite.
#ifdef
  do this
#else
  do that

for example.
Comment 4 Kaveh Ghazi 2007-04-19 04:49:43 UTC
(In reply to comment #3)
> It looks like this platform has different error messages for a given error.

Yes that's correct.  I ran open_errors.exe under the solaris truss command and saw this:

open64("./", O_RDWR|O_CREAT, 0666)              Err#22 EINVAL

So solaris generates EINVAL in this situation.  I can easily change the testcase to also expect this possibility.  However I'm not sure how reliable it is to string compare the english message from strerror as this testcase does.

Anyway, I'll create a patch.
Comment 5 Kaveh Ghazi 2007-04-23 05:58:44 UTC
Patch posted here:

http://gcc.gnu.org/ml/gcc-patches/2007-04/msg01457.html

Comment 6 Kaveh Ghazi 2007-04-23 08:52:41 UTC
Subject: Bug 31616

Author: ghazi
Date: Mon Apr 23 08:52:24 2007
New Revision: 124059

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124059
Log:
	PR fortran/31616
	* gfortran.dg/open_errors.f90: Allow a different error message.


Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/open_errors.f90

Comment 7 Kaveh Ghazi 2007-04-25 18:07:23 UTC
Patch installed
Comment 8 Kaveh Ghazi 2007-04-25 18:08:29 UTC
Updated testsuite results:

http://gcc.gnu.org/ml/gcc-testresults/2007-04/msg01287.html