From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping Date: Wed, 23 May 2012 10:16:17 -0400 Message-ID: References: <83d360yw48.fsf@gnu.org> <834nrazrtl.fsf@gnu.org> <831umez1p7.fsf@gnu.org> <83vcjpxw18.fsf@gnu.org> <83k404xcpt.fsf@gnu.org> <83hav8xak1.fsf@gnu.org> <83ehqby542.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1337782655 1574 80.91.229.3 (23 May 2012 14:17:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 May 2012 14:17:35 +0000 (UTC) Cc: schwab@linux-m68k.org, Richard Stallman , 11519@debbugs.gnu.org, lekktu@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 23 16:17:32 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1SXCNV-0002bA-RO for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 May 2012 16:17:30 +0200 Original-Received: from localhost ([::1]:36473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXCNV-0008Nq-D1 for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 May 2012 10:17:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXCNL-0008NT-PX for bug-gnu-emacs@gnu.org; Wed, 23 May 2012 10:17:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXCNF-00053A-3x for bug-gnu-emacs@gnu.org; Wed, 23 May 2012 10:17:19 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXCNE-000533-W9 for bug-gnu-emacs@gnu.org; Wed, 23 May 2012 10:17:13 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SXCO2-0004bP-0I for bug-gnu-emacs@gnu.org; Wed, 23 May 2012 10:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 May 2012 14:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11519 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11519-submit@debbugs.gnu.org id=B11519.133778263517635 (code B ref 11519); Wed, 23 May 2012 14:18:01 +0000 Original-Received: (at 11519) by debbugs.gnu.org; 23 May 2012 14:17:15 +0000 Original-Received: from localhost ([127.0.0.1]:40768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SXCNH-0004aN-1C for submit@debbugs.gnu.org; Wed, 23 May 2012 10:17:15 -0400 Original-Received: from ironport-out.teksavvy.com ([206.248.143.162]:44104) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SXCNF-0004aC-FQ for 11519@debbugs.gnu.org; Wed, 23 May 2012 10:17:13 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu09MCpYd/2dsb2JhbABEtBGBCIIVAQEEAVYjBQsLNBIUGA0QAROIHAW6CZBEA6MzgViDBQ X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="181969250" Original-Received: from 76-10-150-29.dsl.teksavvy.com (HELO pastel.home) ([76.10.150.29]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 23 May 2012 10:16:18 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id DF00658C01; Wed, 23 May 2012 10:16:17 -0400 (EDT) In-Reply-To: <83ehqby542.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 23 May 2012 05:59:41 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:60305 Archived-At: > Which other places use C pointers to buffer text and call functions > that can allocate memory? IIUC any place that uses STRING_CHAR_AND_LENGTH on buffer text is vulnerable to the problem. > Anyway, are you against committing this to the release branch? I'd be > very sad if you were, having invested so much time in hunting this > bug, but I guess I'll survive. I'm not dead set against it, and I'm glad we found the culprit so we can fix it: fixing it on the release branch is not that important, since this bug has been with us since Emacs-23.1, AFAICT. If you really want to install your workaround on the emacs-24 branch, go for it but let's try to find a real fix for the trunk. >> >> I wonder: why do we use REL_ALLOC? >> > AFAIK, we do that only on platforms that don't support mmap for >> > allocating buffer text. >> So, IIUC the only reason to use it is so that we can more often return >> memory to the OS even for the non-mmap case? Is that because returning >> memory can only be done via sbrk style memory management? > I don't think this is only about _returning_ memory. It is first and > foremost about not _asking_ for more memory when we can come up with > it by reshuffling buffer text. So you're saying it's use for fragmentation reasons? But on other platforms where we use mmap, we do suffer from this fragmentation, and yet it doesn't seem to be a real source of problem. That's why I think the only real reason is because memory can only be returned via sbrk-style memory management (i.e. only free memory at the end of the heap can be returned). Is that right? I guess my question turns into "why do we use gmalloc.c instead of a malloc library that uses mmap (or some other mechanism that lets it return large free chunks to the OS)"? AFAIK, Windows is pretty much the only system where we use gmalloc.c and ralloc.c nowadays. Does anyone remember why we don't use the system malloc under Windows (and Cygwin)? Stefan