From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10440 Path: news.gmane.org!.POSTED!not-for-mail From: u-uy74@aetey.se Newsgroups: gmane.linux.lib.musl.general Subject: Re: incompatibility between libtheora/mmx and musl ? Date: Wed, 14 Sep 2016 12:32:53 +0200 Message-ID: <20160914103253.GO16436@example.net> References: <20160913180649.GN16436@example.net> <20160913204304.GY15995@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1473849213 11708 195.159.176.226 (14 Sep 2016 10:33:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Sep 2016 10:33:33 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10453-gllmg-musl=m.gmane.org@lists.openwall.com Wed Sep 14 12:33:26 2016 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 1bk7VI-0001nd-6L for gllmg-musl@m.gmane.org; Wed, 14 Sep 2016 12:33:20 +0200 Original-Received: (qmail 28191 invoked by uid 550); 14 Sep 2016 10:33:19 -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 28155 invoked from network); 14 Sep 2016 10:33:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fripost.org; h= in-reply-to:content-disposition:content-type:content-type :mime-version:references:message-id:subject:subject:from:from :date:date; s=20140703; t=1473849187; x=1475663588; bh=s9vhy8DZD 4hmq5RsvFcnxlWS4rzBUsqh4tma78D1hXM=; b=HFrPfY1DpvflLyhyRKbB1wmD5 qYiTFVPNce0ygUf9KTyiN+3fNv071dVgXms1hYfUAiFG9N6XBxoQw6Oq5F4aGr+S S7YCCGal4Yp/fiE7j3F3j5yZkiJBbz1LX8dXJJ162Pq1arr2jTMovXdCHvrI+Lmm b6Y7rvF0jZFDzPSyrM= X-Virus-Scanned: Debian amavisd-new at fripost.org Content-Disposition: inline In-Reply-To: <20160913204304.GY15995@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:10440 Archived-At: On Tue, Sep 13, 2016 at 04:43:04PM -0400, Rich Felker wrote: > > Libtheora contains an assembler part for ia32 and x86_64 which has been > > in use for many years, with at least both glibc and uclibc. > > > > Now, musl-based builds of libtheora for ia32 with this code enabled > > lead to the encoder segfaulting. No problem when using the C version. > > https://trac.xiph.org/ticket/2287 > > > > There is also a corresponding > > > > https://bugs.alpinelinux.org/issues/6132 > > The most likely explanation is that they're overflowing a heap buffer. > Perhaps it would be possible to pad all their malloc/realloc calls > with +64 or so to see if that makes the problem go away. If so that > gives a good starting point for tracking down the bug. Thanks for the suggestion, indeed libtheora seems to consistently use ogg_malloc() which is redefinable. Building with #define _ogg_malloc(x) malloc((x)+256) #define _ogg_calloc(x,y) calloc((x)+256,(y)) #define _ogg_realloc(y,x) realloc((y),(x)+256) #define _ogg_free free instead of the default #define _ogg_malloc malloc #define _ogg_calloc calloc #define _ogg_realloc realloc #define _ogg_free free did not make any difference. The crash on a test file occurs in the same way and the resulting partial output file is as long as otherwise. This may mean that this is not a simple overflowing but rather overwriting or reading distant "random" places (?) (register corruption?) Rune