From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20081 invoked by alias); 27 Nov 2013 05:04:08 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 20012 invoked by uid 48); 27 Nov 2013 05:04:04 -0000 From: "carlos at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug network/10652] getaddrinfo causes segfault if multithreaded and linked statically Date: Wed, 27 Nov 2013 05:04:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: network X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: carlos at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-11/txt/msg00292.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=10652 --- Comment #21 from Carlos O'Donell --- (In reply to Rich Felker from comment #20) > Why is getaddrinfo trying to "optimize" out the locking for single-threaded > programs anyway? Certainly the time spent in getaddrinfo is dominated by > actual lookups, not by locking overhead. I can only assume it does this to avoid requiring libpthread. The actual lookups might also be very fast if they are resolved by /etc/hosts or some other local file-based NSS backend. Requiring the thread library would have a non-zero impact on performance for single-threaded applications. What other reason could there be for using the weak-ref-and-check idiom (which I know you don't like)? -- You are receiving this mail because: You are on the CC list for the bug.