From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4597 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: Removing sbrk and brk Date: Fri, 21 Feb 2014 12:09:03 -0500 Message-ID: <20140221170903.GZ184@brightrain.aerifal.cx> References: <20140103181906.GV24286@brightrain.aerifal.cx> <20140103190350.GW24286@brightrain.aerifal.cx> <20140106224036.GC24286@brightrain.aerifal.cx> <20140107160627.GD24286@brightrain.aerifal.cx> <20140107220053.GG24286@brightrain.aerifal.cx> <20140221163639.GP23551@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1393002549 5694 80.91.229.3 (21 Feb 2014 17:09:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Feb 2014 17:09:09 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4601-gllmg-musl=m.gmane.org@lists.openwall.com Fri Feb 21 18:09:17 2014 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 1WGtbB-0008LL-4L for gllmg-musl@plane.gmane.org; Fri, 21 Feb 2014 18:09:17 +0100 Original-Received: (qmail 9521 invoked by uid 550); 21 Feb 2014 17:09:16 -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 9513 invoked from network); 21 Feb 2014 17:09:16 -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:4597 Archived-At: On Fri, Feb 21, 2014 at 05:47:05PM +0100, Daniel Cegiełka wrote: > 2014-02-21 17:36 GMT+01:00 Szabolcs Nagy : > > * Daniel Cegie?ka [2014-02-21 17:03:36 +0100]: > >> And what do we do with failures when sbrk is used? > >> > > > > most of these only call sbrk(0) which is supported > > ok, thank you for the information. > > > >> http://ex-vi.cvs.sourceforge.net/viewvc/ex-vi/ex-vi/ex_subr.c?revision=1.8&view=markup > >> > > > > the "old musl" did not support sbrk either (the cited code uses it > > with malloc), the "new musl" just helps you find the bug more easily > > ex/vi doesn't work with the new musl. Too bad, because it is the > traditional unix ex/vi. Maybe Gunnar Ritter still fixes bugs. Then it didn't work before either; it was silently corrupting memory. The only difference now is that you know that it's not working. The lazy way around this would be writing a fake sbrk that just mmaps a huge PROT_NONE region the first time it's called then mprotects more of it to PROT_READ|PROT_WRITE every time sbrk is called to make more available. This is a *portable* fake sbrk that should work on any system. Rich