Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 231134 - gfortan-generated code cannot handle r/o partitions.
Summary: gfortan-generated code cannot handle r/o partitions.
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-03-06 13:56 UTC by Pawel Salek
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 4.1.2-4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-03-13 14:53:42 UTC


Attachments (Terms of Use)

Description Pawel Salek 2007-03-06 13:56:38 UTC
Description of problem:


Version-Release number of selected component (if applicable):
gcc-gfortran-4.1.1-51.fc6

How reproducible:
Always

Steps to Reproduce:
1. Compile following program with gfortran:
       program a
       open(10,file='aaa',err=10,
     & status='old')
       close(10)
       print *, "opening succeeded"
       goto 20
10     print *, "opening failed"
20     continue
       end
2. touch aaa; sudo -s mount -oremount,ro /home
3. Run the compiled program
  
Actual results:
The program will fail to open the file.

Expected results:
The program should open the file in the read-only mode.

Additional info:
This feature worked with with g77. Following straces may be interesting:
g77-compiled code:
access("aaa", F_OK) = 0
open("aaa", O_RDWR|O_LARGEFILE) = -1 EROFS (Read-only file system)
open("aaa", O_RDONLY|O_LARGEFILE) = 3

gfortran-compiled code on r/o file on r/w partition:
open("afile", O_RDWR|O_LARGEFILE)       = -1 EACCES (Permission denied)
open("afile", O_RDONLY|O_LARGEFILE)     = 3

gfotran-compiled code on r/o partition:
open("aaa", O_RDWR|O_LARGEFILE) = -1 EROFS (Read-only file system)
write(1, " opening failed", 15 opening failed)         = 15

Comment 1 Jakub Jelinek 2007-03-13 14:53:42 UTC
Should be fixed in libgfortran-4.1.2-4 in rawhide.


Note You need to log in before you can comment on or make changes to this bug.