Bug 705116 - --profile-use won't read GCDA files of non-owner
Summary: --profile-use won't read GCDA files of non-owner
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gcc44
Version: 5.6
Hardware: i386
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-16 17:24 UTC by Steve Snyder
Modified: 2011-05-17 09:39 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-17 09:39:09 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Steve Snyder 2011-05-16 17:24:31 UTC
Description of problem:

After doing a profiling run of an instrumented binary, a *.gcda file is generated.  When rebuilding with --profile-use gcc44 will say that a *.cgda file owned by another user (but with readable permissions) "does not exist" even though the file is readable.

Version-Release number of selected component (if applicable):

gcc44-4.4.4-13.el5 (x86)

How reproducible:

Always

Steps to Reproduce:
1.  As User A use gcc44 to create *.gcda file
2.  As User B attempt to read *.gcda with gcc44's --profile-use
3.
  
Actual results:

gcc44 complains that a file that is clearly present and readable is "not found"

Expected results:

Given appropriate read permissions, *.gcda files should be readable by gcc44.

Additional info:


[steve@nemesis ~]$ vi /tmp/testapp.c
[steve@nemesis ~]$ gcc44 --profile-dir=/tmp --profile-generate -O2 -o /tmp/testapp /tmp/testapp.c
[steve@nemesis ~]$ /tmp/testapp
got here
[steve@nemesis ~]$ ll /tmp/testapp*
-rwxr-xr-x 1 steve users 15984 May 16 13:12 /tmp/testapp
-rw-r--r-- 1 steve users    98 May 16 13:12 /tmp/testapp.c
-rw-r--r-- 1 steve users   144 May 16 13:13 /tmp/testapp.gcda
[steve@nemesis ~]$ rm -f /tmp/testapp
[steve@nemesis ~]$ su - nancy

Password:
[nancy@nemesis ~]$ gcc44 --profile-dir=/tmp --profile-use -O2 -o /tmp/testapp /tmp/testapp.c
/tmp/testapp.c: In function âmainâ:
/tmp/testapp.c:8: note: file /tmp/testapp.gcda not found, execution counts estimated
[nancy@nemesis ~]$ file /tmp/testapp.gcda
/tmp/testapp.gcda: data

[nancy@nemesis ~]$ rm -f /tmp/testapp
[nancy@nemesis ~]$ exit
[steve@nemesis ~]$ gcc44 --profile-dir=/tmp --profile-use -O2 -o /tmp/testapp /tmp/testapp.c
[steve@nemesis ~]$ ll /tmp/testapp*
-rwxr-xr-x 1 steve users 4951 May 16 13:18 /tmp/testapp
-rw-r--r-- 1 steve users   98 May 16 13:12 /tmp/testapp.c
-rw-r--r-- 1 steve users  144 May 16 13:13 /tmp/testapp.gcda

Comment 1 Jakub Jelinek 2011-05-17 09:39:09 UTC
This is something that has been changed in gcc 4.5:
http://gcc.gnu.org/ml/gcc-patches/2009-09/msg01170.html
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152419
In older gccs it used to open them always in write mode.
I don't think this is severe enough for it to be backported.


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