[PATCH, libgfortran, committed] PR 64770 Segfault when trying to open existing file with status="new"
Janne Blomqvist
blomqvist.janne@gmail.com
Mon Jan 26 03:23:00 GMT 2015
On Sun, Jan 25, 2015 at 1:28 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Sun, Jan 25, 2015 at 10:35:50AM +0100, Dominique Dhumieres wrote:
>> > ... FAIL: gfortran.dg/open_new_segv.f90 -O0 execution test
>>
>> This is fixed with something such as
>>
>> --- ../_clean/gcc/testsuite/gfortran.dg/open_new_segv.f90 2015-01-25 00:37:43.000000000 +0100
>> +++ gcc/testsuite/gfortran.dg/open_new_segv.f90 2015-01-25 10:31:40.000000000 +0100
>> @@ -1,4 +1,5 @@
>> ! { dg-do run }
>> +! { dg-shouldfail "File already exists" }
>> ! PR 64770 SIGSEGV when trying to open an existing file with status="new"
>> program pr64770
>> implicit none
>> @@ -8,3 +9,5 @@ program pr64770
>> open(99, file="pr64770test.dat", access="stream", form="unformatted", &
>> status="new")
>> end program pr64770
>> +! { dg-output "At line 10 of file.*" }
>> +! { dg-output "Fortran runtime error: File .pr64770test.dat. already exists" }
>>
>> Note that it may be worth to run a second test to cleanup the file 'pr64770test.dat'.
>
> That is not possible in a second test, the second test might be scheduled in
> a different job, in a different directory.
> So you need to solve this either in the test (call some function that
> removes it), or in dg-final.
>
> Jakub
Sorry about that, committed r220098 as obvious which should fix the testcase.
Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog (revision 220097)
+++ gcc/testsuite/ChangeLog (working copy)
@@ -1,3 +1,9 @@
+2015-01-26 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR libfortran/64770
+ * gfortran.dg/open_new_segv.f90: Add dg- stuff to make test work
+ correctly, clean up afterwards.
+
2015-01-25 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/62044
Index: gcc/testsuite/gfortran.dg/open_new_segv.f90
===================================================================
--- gcc/testsuite/gfortran.dg/open_new_segv.f90 (revision 220097)
+++ gcc/testsuite/gfortran.dg/open_new_segv.f90 (working copy)
@@ -1,4 +1,5 @@
! { dg-do run }
+! { dg-shouldfail "File already exists" }
! PR 64770 SIGSEGV when trying to open an existing file with status="new"
program pr64770
implicit none
@@ -8,3 +9,6 @@ program pr64770
open(99, file="pr64770test.dat", access="stream", form="unformatted", &
status="new")
end program pr64770
+! { dg-output "At line 10 of file.*" }
+! { dg-output "Fortran runtime error: File .pr64770test.dat. already exists" }
+! { dg-final { remote_file build delete "pr64770test.dat" } }
--
Janne Blomqvist
More information about the Gcc-patches
mailing list