From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3370 Path: news.gmane.org!not-for-mail From: plan9assembler Newsgroups: gmane.linux.lib.musl.general Subject: Re: util-linux-2.23 mount segmentation fault error Date: Tue, 28 May 2013 06:40:14 +0900 Message-ID: References: <20130525162604.GY20323@brightrain.aerifal.cx> <20130526091432.GE31915@port70.net> <20130527142929.GF31915@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff1c3d4797e8704ddb9fe50 X-Trace: ger.gmane.org 1369690827 21033 80.91.229.3 (27 May 2013 21:40:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 May 2013 21:40:27 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3374-gllmg-musl=m.gmane.org@lists.openwall.com Mon May 27 23:40:29 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 1Uh59Y-0000Lr-P3 for gllmg-musl@plane.gmane.org; Mon, 27 May 2013 23:40:28 +0200 Original-Received: (qmail 16297 invoked by uid 550); 27 May 2013 21:40:27 -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 16283 invoked from network); 27 May 2013 21:40:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=MdTbrLAh3bkX6tOP9Ci8sAff2KyI1e4FuI7D+yDuPxA=; b=hlvj95GjJHef9yw6LHu1QVpFqWI2bAr88j2rpHlcP/DjAt770tn/rLCqGe5PDCKWz/ ME5WfChmEELXcCH4Mx35M2EUFs5XStQjHZIuANouMRK7UPiIl5l0BI8cgWav7RRXTOCZ xxEk/SXXYDcoQGTe9EYlYUwT2U3CPYcpRgVeZPEUtI2TrWb9mO8l5vzoCBrdD06au3+y Z+hSA2GUiXPfsI+7X0mgwH1F5gfu4WxJsKX4E6QB4Djn+W4Hha74rKNgjKskOekWXGtF a1Q/Wylz0npAE9XoK+CBdOfD58yBgfkZ2WhAMwiwWB6At1k/gfOzHDOJGQpwGfC/iWh0 1mSQ== X-Received: by 10.68.201.132 with SMTP id ka4mr30302921pbc.162.1369690814904; Mon, 27 May 2013 14:40:14 -0700 (PDT) In-Reply-To: <20130527142929.GF31915@port70.net> Xref: news.gmane.org gmane.linux.lib.musl.general:3370 Archived-At: --e89a8ff1c3d4797e8704ddb9fe50 Content-Type: text/plain; charset=ISO-8859-1 Hi, i am sure but it works for me. actually, it little strange, because, after modification, first time, it getting segfaults, later, it works fine. flags in util-linux-2.23 was created automatically. musl linux system could be set by this method: https://github.com/pikhq/bootstrap-linux/issues/8 https://github.com/pikhq/bootstrap-linux/issues/9 http://plan9assembler.wordpress.com/2013/04/26/bootstrap-linux-musl-cross/ gcc-4.8 CC = gcc -std=gnu99 CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 CPP = gcc -E TIA On Mon, May 27, 2013 at 11:29 PM, Szabolcs Nagy wrote: > * plan9assembler [2013-05-27 23:05:37 +0900]: > > util-linux-2.23 mount segfault error seems to be solved. > > no more segfault error, when i test mount binary. > > > > i modified follow macros in musl /include/bits/ioctl.h and musl libc > > reinstalled. > > > > - #define _IOR(a,b,c) _IOC(2,(a),(b),sizeof(c)) > > - #define _IOWR(a,b,c) _IOC(3,(a),(b),sizeof(c)) > > > > + #define _IOR(a,b,c) _IOC(2U,(a),(b),sizeof(c)) > > + #define _IOWR(a,b,c) _IOC(3U,(a),(b),sizeof(c)) > > > > hm are you sure this was the change that solved the segfault? > > that would be scary since the linux headers have signed > int left shift overflows in many places > (and as far as i know users of those headers dont use > special compilation flags to make signed overflow > well-defined like gcc -fwrapv) > > which compiler did you use and with what flags? > (this could break a lot of legacy code) > --e89a8ff1c3d4797e8704ddb9fe50 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi, i am sure but it works for me.

<= /div>actually, it little strange, because,
after modification, fir= st time, it getting segfaults,
later, it works fine.

gcc-4.8
CC =3D gcc -std=3Dgnu99
CCDEPMODE =3D depmode= =3Dgcc3
CFLAGS =3D -g -O2
CPP =3D gcc -E

TIA



On Mon, May 27, 2013 at 11:29 PM, Szabolcs Nagy <nsz@port70.net> wrote:
* plan9assembler <plan9assem= bler@gmail.com> [2013-05-27 23:05:37 +0900]:
> util-linux-2.23 mount segfault error seems to be sol= ved.
> no more segfault error, when i test mount binary.
>
> i modified follow macros in musl /include/bits/ioctl.h and musl libc > reinstalled.
>
> - #define _IOR(a,b,c) _IOC(2,(a),(b),sizeof(c))
> - #define _IOWR(a,b,c) _IOC(3,(a),(b),sizeof(c))
>
> + #define _IOR(a,b,c) _IOC(2U,(a),(b),sizeof(c))
> + #define _IOWR(a,b,c) _IOC(3U,(a),(b),sizeof(c))
>

hm are you sure this was the change that solved the segfault?

that would be scary since the linux headers have signed
int left shift overflows in many places
(and as far as i know users of those headers dont use
special compilation flags to make signed overflow
well-defined like gcc -fwrapv)

which compiler did you use and with what flags?
(this could break a lot of legacy code)

--e89a8ff1c3d4797e8704ddb9fe50--