From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.emacs.devel Subject: Re: Dumper issue, revisited; invalid realloc/free Date: Wed, 4 Feb 2015 15:08:42 -0500 Message-ID: <20150204200842.GC23507@brightrain.aerifal.cx> References: <20150204175709.GX23507@brightrain.aerifal.cx> <83oap9fppc.fsf@gnu.org> <20150204193732.GZ23507@brightrain.aerifal.cx> <83k2zxfomm.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1423080536 24041 80.91.229.3 (4 Feb 2015 20:08:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Feb 2015 20:08:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 04 21:08:52 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YJ6Fo-0006DS-57 for ged-emacs-devel@m.gmane.org; Wed, 04 Feb 2015 21:08:52 +0100 Original-Received: from localhost ([::1]:38536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ6Fn-0001cj-Cp for ged-emacs-devel@m.gmane.org; Wed, 04 Feb 2015 15:08:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ6Fk-0001cS-GT for emacs-devel@gnu.org; Wed, 04 Feb 2015 15:08:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJ6Fj-0000VN-J3 for emacs-devel@gnu.org; Wed, 04 Feb 2015 15:08:48 -0500 Original-Received: from 216-12-86-13.cv.mvl.ntelos.net ([216.12.86.13]:51462 helo=brightrain.aerifal.cx) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ6Ff-0000U5-8A; Wed, 04 Feb 2015 15:08:43 -0500 Original-Received: from dalias by brightrain.aerifal.cx with local (Exim 3.15 #2) id 1YJ6Fe-0004JT-00; Wed, 04 Feb 2015 20:08:42 +0000 Content-Disposition: inline In-Reply-To: <83k2zxfomm.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 216.12.86.13 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:182399 Archived-At: On Wed, Feb 04, 2015 at 09:44:17PM +0200, Eli Zaretskii wrote: > > Date: Wed, 4 Feb 2015 14:37:32 -0500 > > From: Rich Felker > > Cc: emacs-devel@gnu.org > > > > > > http://www.openwall.com/lists/musl/2015/02/03/1 > > > > > > I suggest that you take a look at src/w32heap.c on Emacs's master > > > branch. There' you will see a simple solution of a very similar (if > > > not identical) problem we have on MS-Windows. It even includes a > > > simple handling of large allocations. > > > > As I suspected, this code is used only if you use gmalloc.c. It's not > > used with system_malloc=yes, which is the case I'm concerned about. > > No, you are mistaken. The 'master' version of Emacs uses the system > malloc on MS-Windows. Perhaps you are looking at the 'emacs-24' > branch, where indeed we use gmalloc.c and ralloc.c, with sbrk > emulation in w32heap.c. But that's not what I had in mind. Upon checking master, w32heap.c is not using the system malloc. It's its own implementation of the malloc API written on top of the Win32 HeapAlloc API. Rich