From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3180 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: cluts test suite with musl Date: Wed, 24 Apr 2013 09:32:13 -0400 Message-ID: <20130424133213.GD20323@brightrain.aerifal.cx> References: <20130423134038.GX20323@brightrain.aerifal.cx> <20130423153127.GA20323@brightrain.aerifal.cx> <20130423154705.GB20323@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 1366810343 17165 80.91.229.3 (24 Apr 2013 13:32:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Apr 2013 13:32:23 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3184-gllmg-musl=m.gmane.org@lists.openwall.com Wed Apr 24 15:32:27 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 1UUzoB-0001Bt-DW for gllmg-musl@plane.gmane.org; Wed, 24 Apr 2013 15:32:27 +0200 Original-Received: (qmail 32200 invoked by uid 550); 24 Apr 2013 13:32:26 -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 32192 invoked from network); 24 Apr 2013 13:32:26 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3180 Archived-At: On Wed, Apr 24, 2013 at 03:26:57PM +0300, Timerlan Moldobaev wrote: > Thanks ! > > I applied the patch. Still have some tests failing. > > For instance tests/buf fails with the following error message: > > iconv(&<"abcd">, &<4>, &s, &<3>) caused a SIGSEGV! > > I am not sure but it seems that iconv() that is called from wrap_iconv() > should return an error return value and set an errno value. > At least to my understanding that the way the test is written. > For musl implementation of iconv() returns 0 and sets no errno. > > While in the case of standard Linux implementation, errno = E2BIG and -1 > returned ( error return value) . > > For the case buf linked dynamically against the standard libc.so library: > > ldd tests/buf > libpthread.so.0 => /lib64/libpthread.so.0 (0x00000030d1000000) > librt.so.1 => /lib64/librt.so.1 (0x00000030d4400000) > libm.so.6 => /lib64/libm.so.6 (0x00000030d0800000) > libc.so.6 => /lib64/libc.so.6 (0x00000030d0400000) > /lib64/ld-linux-x86-64.so.2 (0x00000030cf400000) > > > uname -a > Linux lnxbdc96 2.6.18-164.11.1.el5 #1 SMP Wed Jan 6 13:26:04 EST 2010 > x86_64 x86_64 x86_64 GNU/Linux > > Can you please look into this ? Yes, the test is invoking undefined behavior by failing to check the return value of iconv_open and passing an invalid conversion descriptor ((iconv_t)-1) to iconv. I don't know why it's crashing for you but not me; probably a difference from being 64-bit vs 32-bit affecting the way the bits of the conversion descriptor are handled. Apparently the test was written based on GNU documentation that allows "" as an alias for the current locale's encoding. This usage is non-portable, but may be something we should add to musl. nl_langinfo(CODESET) is the portable way to get this. Rich