Bug 110476 - glibc-2.3.2 seems to cause file stream open call to fail
Summary: glibc-2.3.2 seems to cause file stream open call to fail
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 9
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Benjamin Kosnik
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-11-19 21:05 UTC by Sam Byrne
Modified: 2013-08-09 05:46 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-01-02 18:21:48 UTC
Embargoed:


Attachments (Terms of Use)
a simple test C++ application (848 bytes, text/plain)
2003-11-19 21:06 UTC, Sam Byrne
no flags Details

Description Sam Byrne 2003-11-19 21:05:17 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5)
Gecko/20031015 Firebird/0.7

Description of problem:
This problem was encountered on a RH9 system running glibc-2.3.2-27.9
Intel processor.

In a sample C++ application a call to access followed by a call to
<fstream object>::open fails.  An strace demonstrates that the open
call is never executed.  The same code executed on a RH7.3 system
running glibc-2.2.5-43 performs as expected.

Refer to the attached code that was executed on both systems:

After building on RH9, the output looks like:
[sbyrne@sbyrne1 glibctest]$ strace -e trace=file ./test dummy.txt
execve("./test", ["./test", "dummy.txt"], [/* 35 vars */]) = 0
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=64967, ...}) = 0
open("/usr/lib/libstdc++.so.5", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=710608, ...}) = 0
open("/lib/tls/libm.so.6", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=212020, ...}) = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=30324, ...}) = 0
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=1536292, ...}) = 0
access("dummy.txt", F_OK)               = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 7), ...}) = 0
fd good after open: 0
fd good after clear: 1
fd good after seek to end: 0
./test: bad input: dummy.txt

After building on RH7.3 the output looks like:
[sbyrne@sam glibctest]$ strace -e trace=file ./test dummy.txt
execve("./test", ["./test", "dummy.txt"], [/* 29 vars */]) = 0
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=109048, ...}) = 0
open("/usr/lib/libstdc++-libc6.2-2.so.3", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0555, st_size=426442, ...}) = 0
open("/lib/i686/libm.so.6", O_RDONLY)   = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=173359, ...}) = 0
open("/lib/i686/libc.so.6", O_RDONLY)   = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=1402035, ...}) = 0
access("dummy.txt", F_OK)               = 0
open("dummy.txt", O_RDWR|O_APPEND|O_CREAT|O_LARGEFILE, 0664) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=16, ...}) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=16, ...}) = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
fd good after open: 1
fd good after clear: 1
fstat64(3, {st_mode=S_IFREG|0644, st_size=16, ...}) = 0
fd good after seek to end: 1


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

How reproducible:
Always

Steps to Reproduce:
1.compile the attached file on a system running glibc-2.2.5-43
2.compile the attached file on a system running glibc-2.3.2-27.9
3.run the produced binary on both systems passing in a file containing
a couple lines of text.
4.the system using glibc-2.3.2-27.9 will fail to execute the code
properly.
    

Actual Results:  [sbyrne@sbyrne1 glibctest]$ strace -e trace=file
./test dummy.txt
execve("./test", ["./test", "dummy.txt"], [/* 35 vars */]) = 0
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=64967, ...}) = 0
open("/usr/lib/libstdc++.so.5", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=710608, ...}) = 0
open("/lib/tls/libm.so.6", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=212020, ...}) = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=30324, ...}) = 0
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=1536292, ...}) = 0
access("dummy.txt", F_OK)               = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 7), ...}) = 0
fd good after open: 0
fd good after clear: 1
fd good after seek to end: 0
./test: bad input: dummy.txt

Expected Results:  [sbyrne@sam glibctest]$ strace -e trace=file ./test
dummy.txt
execve("./test", ["./test", "dummy.txt"], [/* 29 vars */]) = 0
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=109048, ...}) = 0
open("/usr/lib/libstdc++-libc6.2-2.so.3", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0555, st_size=426442, ...}) = 0
open("/lib/i686/libm.so.6", O_RDONLY)   = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=173359, ...}) = 0
open("/lib/i686/libc.so.6", O_RDONLY)   = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=1402035, ...}) = 0
access("dummy.txt", F_OK)               = 0
open("dummy.txt", O_RDWR|O_APPEND|O_CREAT|O_LARGEFILE, 0664) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=16, ...}) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=16, ...}) = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
fd good after open: 1
fd good after clear: 1
fstat64(3, {st_mode=S_IFREG|0644, st_size=16, ...}) = 0
fd good after seek to end: 1

Additional info:

Comment 1 Sam Byrne 2003-11-19 21:06:33 UTC
Created attachment 96069 [details]
a simple test C++ application

Comment 2 Jakub Jelinek 2003-11-20 00:07:59 UTC
This has nothing to do with glibc, but with different libstdc++.

Comment 3 Bill Nottingham 2006-08-05 03:00:45 UTC
Red Hat apologizes that these issues have not been resolved yet. We do want to
make sure that no important bugs slip through the cracks.

Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
They are maintained by the Fedora Legacy project (http://www.fedoralegacy.org/)
for security updates only. If this is a security issue, please reassign to the
'Fedora Legacy' product in bugzilla. Please note that Legacy security update
support for these products will stop on December 31st, 2006.

If this is not a security issue, please check if this issue is still present
in a current Fedora Core release. If so, please change the product and version
to match, and check the box indicating that the requested information has been
provided.

If you are currently still running Red Hat Linux 7.3 or 9, please note that
Fedora Legacy security update support for these products will stop on December
31st, 2006. You are strongly advised to upgrade to a current Fedora Core release
or Red Hat Enterprise Linux or comparable. Some information on which option may
be right for you is available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Any bug still open against Red Hat Linux 7.3 or 9 at the end of 2006 will be
closed 'CANTFIX'. Again, if this bug still exists in a current release, or is a
security issue, please change the product as necessary. We thank you for your
help, and apologize again that we haven't handled these issues to this point.


Comment 5 Bill Nottingham 2007-01-02 18:21:48 UTC
Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
f you are currently still running Red Hat Linux 7.3 or 9, you are strongly
advised to upgrade to a current Fedora Core release or Red Hat Enterprise Linux
or comparable. Some information on which option may be right for you is
available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Closing as CANTFIX.


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