From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3329 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Broken silent glibc-specific assumptions uncovered by musl Date: Fri, 17 May 2013 13:37:10 -0400 Message-ID: <20130517173710.GA14240@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1368812243 30596 80.91.229.3 (17 May 2013 17:37:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 May 2013 17:37:23 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3333-gllmg-musl=m.gmane.org@lists.openwall.com Fri May 17 19:37:23 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1UdOap-0003nU-D1 for gllmg-musl@plane.gmane.org; Fri, 17 May 2013 19:37:23 +0200 Original-Received: (qmail 3665 invoked by uid 550); 17 May 2013 17:37:22 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 3657 invoked from network); 17 May 2013 17:37:22 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3329 Archived-At: Hi all, There's been at least one request for putting together a list of "silent" application bugs uncovered by building against musl applications which were previously used mainly/only with glibc. By silent, I mean things that are not easily caught as configure- or compile-time errors, but which cause the application to misbehave at runtime. I'm writing down here what I can think of off-hand. This list should probably be expanded by the community and perhaps put on the wiki. Here's what I have so far: Assuming that dlerror is thread-local. (POSIX previously required it to be global; as of 2008-TC1, either behavior is allowed.) Assuming dlclose actually unloads a library (and calls dtors), so that a future dlopen will reset static objects to their initial state (and re-run ctors). (POSIX leaves this implementation-defined, and unloading is impossible to do safely in general, so robust implementations will not do it.) Making wrong assumptions about fsync and fdatasync. (I'm not familiar with this issue so somebody else will have to fill it in.) Calling exit from global destructors. (If an application calls exit more than once, the behavior is undefined.) Assuming pthread_cancel unwinds and calls destructors. (Interaction between cancellation and C++ is undefined.) Use of GNU extensions in regular expressions, especially backslash-prefixed versions of ERE operators in BRE. (Undefined.) Assuming iconv reports characters that cannot be represented in the dest charset via EILSEQ. (This behavior is non-conforming; POSIX requires an implementation-defined replacement and positive return value in this case.) Use of deprecated charset aliases with iconv_open, for example, using "UNICODE" to mean UCS-2. (The list of charsets is implementation-defined, but common sense dictates using the IANA preferred MIME charset names, and especially not misleading names.)