From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11193 Path: news.gmane.org!.POSTED!not-for-mail From: He X Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: fallback to no translations when gettext("") Date: Sat, 25 Mar 2017 10:36:29 +0800 Message-ID: References: <20170324183637.GI17319@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f40304361d606b8d9b054b84fb4a X-Trace: blaine.gmane.org 1490409424 19336 195.159.176.226 (25 Mar 2017 02:37:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 25 Mar 2017 02:37:04 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-11208-gllmg-musl=m.gmane.org@lists.openwall.com Sat Mar 25 03:36:59 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1crbZZ-0004Qq-On for gllmg-musl@m.gmane.org; Sat, 25 Mar 2017 03:36:57 +0100 Original-Received: (qmail 7868 invoked by uid 550); 25 Mar 2017 02:37:02 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 7843 invoked from network); 25 Mar 2017 02:37:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=5ZSmSzapVnNBiwjTr7Xx0U2nnhGZeOYOxGFw9PBrtPY=; b=hhgsuIImikSwuIE1a4LxtWaYcm2FlYSe9vx+icRQMqeZZC/23CdqvaOlE3LavGwJ3T eLJjqLhuzxW+59Co79lUW85ySN7EBLDKBvlgu1dbEVkPp2e1c5JUBLPTKaFLUgUoie+N Cb/zxnUAAF6eDKxFwl515DC9Id006ENfcVxtL3KC/aCHtcY/1RNAv9d9QcobXofiL9ws 2HV/dA6FsulCUf77LgV+VkrGzIvvowAmCJ5tbXU4UJ/xh5cXTntXppAZC40GuYF2vOv0 P4XCCCqkPtgo0vgCq3ntGtHK+YQF+dBEnS2jzNTEGPQTcrQQUNBr7QTNKVKsdbyVps/L 7Oyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=5ZSmSzapVnNBiwjTr7Xx0U2nnhGZeOYOxGFw9PBrtPY=; b=Sb59VhfPsJSWXl0QrNKmRfLopywz5Mi+BGkPRi2Vi/M4sNjmn1VR0nOke3fLNtMeBU LlSz1iA+d8NolhkjnafvazYAFG5ddmfJM6wl2GABvqKbuLBd5f0FEh7PgB5+IDoqOUUP tekYCHqeLuuf/KHPMUGZz2Ovug39VUEbBRljVhNJBExG5FK3int65g2/ElqQixxwYmpZ e14ObiOeyu7N27l4rUiiYXm2uPxYpEF16kOdXrQqW4vdKRtYhX5sbyzyonggteJyopO5 cQr7qaLLIBQT32tMkpWoirzlpc5tVm9W1MuN6RgKUAVpbkK66WX+m1dz+RHfELNhLOvx jUMQ== X-Gm-Message-State: AFeK/H34+FmgxFdgcuRLO6L1Sgh7SrbGPTeNP3l8orA3no4bh3FzGdPC/9b1/aRE8rE0VUxnBAft7CQ/aFiz0A== X-Received: by 10.176.23.111 with SMTP id k47mr4844654uaf.54.1490409409446; Fri, 24 Mar 2017 19:36:49 -0700 (PDT) In-Reply-To: <20170324183637.GI17319@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:11193 Archived-At: --f40304361d606b8d9b054b84fb4a Content-Type: text/plain; charset=UTF-8 I tested a full-symbol version and found that tar segfaulted due to 'argp'. Tar is using its own internal implementation of argp, instead of linking to the one most musl-based distros are using - argp-standalone. In other words, that internal implementation is not compatible with musl and there's no actual bug in tar. I am satisfied with add -largp, but one more question: what's the reason for not adding argp to musl? I can understand execinfo is hard to add (from mail)and fts is waiting for changes of API(in wiki). They're not portable for adding, so what's wrong with argp then? I did not find any mail related to this question. And I am sorry if i missed anything. He X 2017-03-25 2:36 GMT+08:00 Rich Felker : > On Thu, Mar 23, 2017 at 01:05:55PM +0800, He X wrote: > > Hi, rich, happy that you merged the changes related to dcngettext(). But > > you seems forget this simple patch and did not get it with those changes. > > So i bump it again now. Hope you do not mind if you still remember it. > > > > He X > > > > 2017-03-04 16:08 GMT+08:00 He X : > > > > > following http://www.openwall.com/lists/musl/2017/02/13/8 , > > > http://www.openwall.com/lists/musl/2017/03/04/1 and > > > http://www.openwall.com/lists/musl/2017/02/13/5: > > > > > > > gnu tar showed me segfaults, because he passed a zero msgid1 causing > > > __mo_lookup segfault, we should add a check in dcngettext to avoid > it(if > > > (!msgid1) goto notrans;): > > > > > > #2 0x00007ffff7d82a6f in dcngettext (domainname=0x6737a0 "tar", > > > msgid1=0x0, msgid2=0x0, n=1, > > > category=5) at src/locale/dcngettext.c:211 > > Indeed, I did forget. But looking at it more closely, according to the > GNU gettext manual I think this is a bug in GNU tar: > > "If the argument is NULL the result is undefined." > > https://www.gnu.org/software/gettext/manual/html_node/ > Interface-to-gettext.html > > Whether we commit this patch or not, I think it should be reported as > a bug in GNU tar. > > Given that the API documentation says a NULL pointer is not valid > here, my leaning, in alignment with existing musl practice, is _not_ > to make it silently "work" but to leave it crashing, so that this sort > of bug is caught. But if the documentation is wrong and the practice > of passing null pointers here is widely accepted we can reconsider. > > Rich > --f40304361d606b8d9b054b84fb4a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I tested a full-symbol version and found that tar segfault= ed due to 'argp'. Tar is using its own internal implementation of a= rgp, instead of linking to the one most musl-based distros are using - argp= -standalone. In other words, that internal implementation is not=C2=A0compa= tible with musl and there's no actual bug in tar.

I = am satisfied with add -largp, but one more question: what's the reason = for not adding argp to musl? I can understand execinfo is hard to add (from= mail)and fts is waiting for changes of API(in wiki). They're not porta= ble for adding, so what's wrong with argp then? I did not find any mail= related to this question. And I am sorry if i missed anything.
<= br>
He X

2017-03-25 2:36 GMT+08:00 Rich Felker <dalias@libc.org><= /span>:
On Thu, Mar 23, 2017 at 01:05:55PM +0800, He X wrote:
> Hi, rich, happy that you merged the changes related to dcngettext(). B= ut
> you seems forget this simple patch and did not get it with those chang= es.
> So i bump it again now. Hope you do not mind if you still remember it.=
>
> He X
>
> 2017-03-04 16:08 GMT+08:00 He X <xw897002528@gmail.com>:
>
> > following http://www.openwall.com/lists/musl/2017/02/13/8 ,
> > http://www.openwall.com/lists/musl/2= 017/03/04/1 and
> > http://www.openwall.com/lists/musl/2= 017/02/13/5:
> >
> > > gnu tar showed me segfaults, because he passed a zero msgid1= causing
> > __mo_lookup segfault, we should add a check in dcngettext to avoi= d it(if
> > (!msgid1) goto notrans;):
> >
> >=C2=A0 #2=C2=A0 0x00007ffff7d82a6f in dcngettext (domainname=3D0x6= 737a0 "tar",
> > msgid1=3D0x0, msgid2=3D0x0, n=3D1,
> >=C2=A0 =C2=A0 =C2=A0category=3D5) at src/locale/dcngettext.c:211
Indeed, I did forget. But looking at it more closely, according= to the
GNU gettext manual I think this is a bug in GNU tar:

=C2=A0 =C2=A0 "If the argument is NULL the result is undefined."<= br>
https://www.gnu.org/s= oftware/gettext/manual/html_node/Interface-to-gettext.html
Whether we commit this patch or not, I think it should be reported as
a bug in GNU tar.

Given that the API documentation says a NULL pointer is not valid
here, my leaning, in alignment with existing musl practice, is _not_
to make it silently "work" but to leave it crashing, so that this= sort
of bug is caught. But if the documentation is wrong and the practice
of passing null pointers here is widely accepted we can reconsider.

Rich

--f40304361d606b8d9b054b84fb4a--