public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/2914] New: gethostid don't check if file exist before tryng to use it
@ 2006-07-13 12:42 julien dot dumont at certess dot com
  2006-07-13 12:44 ` [Bug libc/2914] " julien dot dumont at certess dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: julien dot dumont at certess dot com @ 2006-07-13 12:42 UTC (permalink / raw)
  To: glibc-bugs

using gethostid() function provide by glibc trying to open twice a file which
don't exist. 

strace output concerning this function. 

open("/etc/hostid", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/etc/hostid", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)

-- 
           Summary: gethostid don't check if file exist before tryng to use
                    it
           Product: glibc
           Version: 2.3.4
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: julien dot dumont at certess dot com
                CC: glibc-bugs at sources dot redhat dot com
  GCC host triplet: i686


http://sourceware.org/bugzilla/show_bug.cgi?id=2914

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/2914] gethostid don't check if file exist before tryng to use it
  2006-07-13 12:42 [Bug libc/2914] New: gethostid don't check if file exist before tryng to use it julien dot dumont at certess dot com
@ 2006-07-13 12:44 ` julien dot dumont at certess dot com
  2006-07-13 12:46 ` julien dot dumont at certess dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: julien dot dumont at certess dot com @ 2006-07-13 12:44 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From julien dot dumont at certess dot com  2006-07-13 12:44 -------
Created an attachment (id=1158)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=1158&action=view)
sample for reproduct

hostid.c is an example for reproduct.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2914

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/2914] gethostid don't check if file exist before tryng to use it
  2006-07-13 12:42 [Bug libc/2914] New: gethostid don't check if file exist before tryng to use it julien dot dumont at certess dot com
  2006-07-13 12:44 ` [Bug libc/2914] " julien dot dumont at certess dot com
@ 2006-07-13 12:46 ` julien dot dumont at certess dot com
  2006-07-13 12:48 ` julien dot dumont at certess dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: julien dot dumont at certess dot com @ 2006-07-13 12:46 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From julien dot dumont at certess dot com  2006-07-13 12:46 -------
Created an attachment (id=1159)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=1159&action=view)
patch for fedora core 3 SRPMS glibc-2.3.3-74.src.rpm 

patch for fedora core 3 SRPMS glibc-2.3.3-74.src.rpm 

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2914

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/2914] gethostid don't check if file exist before tryng to use it
  2006-07-13 12:42 [Bug libc/2914] New: gethostid don't check if file exist before tryng to use it julien dot dumont at certess dot com
  2006-07-13 12:44 ` [Bug libc/2914] " julien dot dumont at certess dot com
  2006-07-13 12:46 ` julien dot dumont at certess dot com
@ 2006-07-13 12:48 ` julien dot dumont at certess dot com
  2006-07-13 12:51 ` julien dot dumont at certess dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: julien dot dumont at certess dot com @ 2006-07-13 12:48 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From julien dot dumont at certess dot com  2006-07-13 12:48 -------
Created an attachment (id=1160)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=1160&action=view)
patch for generic GNU glibc 2.3

patch for generic GNU glibc 2.3

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2914

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/2914] gethostid don't check if file exist before tryng to use it
  2006-07-13 12:42 [Bug libc/2914] New: gethostid don't check if file exist before tryng to use it julien dot dumont at certess dot com
                   ` (3 preceding siblings ...)
  2006-07-13 12:51 ` julien dot dumont at certess dot com
@ 2006-07-13 12:51 ` julien dot dumont at certess dot com
  2006-08-03  8:51 ` drepper at redhat dot com
  2006-08-03 20:15 ` julien dot dumont at certess dot com
  6 siblings, 0 replies; 8+ messages in thread
From: julien dot dumont at certess dot com @ 2006-07-13 12:51 UTC (permalink / raw)
  To: glibc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.3.4                       |2.3.3


http://sourceware.org/bugzilla/show_bug.cgi?id=2914

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/2914] gethostid don't check if file exist before tryng to use it
  2006-07-13 12:42 [Bug libc/2914] New: gethostid don't check if file exist before tryng to use it julien dot dumont at certess dot com
                   ` (2 preceding siblings ...)
  2006-07-13 12:48 ` julien dot dumont at certess dot com
@ 2006-07-13 12:51 ` julien dot dumont at certess dot com
  2006-07-13 12:51 ` julien dot dumont at certess dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: julien dot dumont at certess dot com @ 2006-07-13 12:51 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From julien dot dumont at certess dot com  2006-07-13 12:50 -------
This exist also on glibc 2.4 and the patch is the same. ( use stat )


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2914

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/2914] gethostid don't check if file exist before tryng to use it
  2006-07-13 12:42 [Bug libc/2914] New: gethostid don't check if file exist before tryng to use it julien dot dumont at certess dot com
                   ` (4 preceding siblings ...)
  2006-07-13 12:51 ` julien dot dumont at certess dot com
@ 2006-08-03  8:51 ` drepper at redhat dot com
  2006-08-03 20:15 ` julien dot dumont at certess dot com
  6 siblings, 0 replies; 8+ messages in thread
From: drepper at redhat dot com @ 2006-08-03  8:51 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2006-08-03 08:51 -------
I've changed this is CVS.  The patch isn't OK.  There is no need for the stat
because a) it's not really much faster than the open and b) if somebody uses
gethostid there better be such a file.  The real problem was that the patch
introducing the OLD_HOSTIDFILE macro contained  abug.  This is now fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=2914

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libc/2914] gethostid don't check if file exist before tryng to use it
  2006-07-13 12:42 [Bug libc/2914] New: gethostid don't check if file exist before tryng to use it julien dot dumont at certess dot com
                   ` (5 preceding siblings ...)
  2006-08-03  8:51 ` drepper at redhat dot com
@ 2006-08-03 20:15 ` julien dot dumont at certess dot com
  6 siblings, 0 replies; 8+ messages in thread
From: julien dot dumont at certess dot com @ 2006-08-03 20:15 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From julien dot dumont at certess dot com  2006-08-03 20:15 -------
Thanks for this ;)

I'm agree with you about open and stat and their performance on local filesystem.
But It seems thant it's not the case over Network filesystem or Virtual filesystem.

Sure isn't a good idea to have /etc/ over VFS or NFS, but in this case it seems
than using 'open' have mores 'impact' than using only stat. Performance be
better and we don't have problem with concurent remote access.
 

But in fact is it true or it's just my feelings ?

Julien

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2914

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-08-03 20:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-13 12:42 [Bug libc/2914] New: gethostid don't check if file exist before tryng to use it julien dot dumont at certess dot com
2006-07-13 12:44 ` [Bug libc/2914] " julien dot dumont at certess dot com
2006-07-13 12:46 ` julien dot dumont at certess dot com
2006-07-13 12:48 ` julien dot dumont at certess dot com
2006-07-13 12:51 ` julien dot dumont at certess dot com
2006-07-13 12:51 ` julien dot dumont at certess dot com
2006-08-03  8:51 ` drepper at redhat dot com
2006-08-03 20:15 ` julien dot dumont at certess dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).