From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#9079: integer overflow etc. issues (e.g., image crashes Emacs) Date: Thu, 14 Jul 2011 09:15:36 -0700 Organization: UCLA Computer Science Department Message-ID: <4E1F1628.8030007@cs.ucla.edu> References: <4E1EA0FB.5070903@cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1310660335 24179 80.91.229.12 (14 Jul 2011 16:18:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 14 Jul 2011 16:18:55 +0000 (UTC) Cc: 9079@debbugs.gnu.org To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 14 18:18:51 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QhOck-0006Jj-Gi for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Jul 2011 18:18:50 +0200 Original-Received: from localhost ([::1]:36949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhOcj-0002Qr-Ex for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Jul 2011 12:18:49 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:38609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhOa8-0001tn-1M for bug-gnu-emacs@gnu.org; Thu, 14 Jul 2011 12:16:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QhOa3-0007Eg-KG for bug-gnu-emacs@gnu.org; Thu, 14 Jul 2011 12:16:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34054) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhOa3-0007Ea-1N for bug-gnu-emacs@gnu.org; Thu, 14 Jul 2011 12:16:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QhOa1-0003yE-O7; Thu, 14 Jul 2011 12:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Jul 2011 16:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 9079-submit@debbugs.gnu.org id=B9079.131066016115255 (code B ref 9079); Thu, 14 Jul 2011 16:16:01 +0000 Original-Received: (at 9079) by debbugs.gnu.org; 14 Jul 2011 16:16:01 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QhOZx-0003xx-5w for submit@debbugs.gnu.org; Thu, 14 Jul 2011 12:16:01 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QhOZs-0003xh-A8 for 9079@debbugs.gnu.org; Thu, 14 Jul 2011 12:15:56 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 14BA939E80F7; Thu, 14 Jul 2011 09:15:46 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MIz7YqDkUB1O; Thu, 14 Jul 2011 09:15:44 -0700 (PDT) Original-Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 8CBF639E80E0; Thu, 14 Jul 2011 09:15:44 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 14 Jul 2011 12:16:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:49029 Archived-At: On 07/14/11 01:22, Andreas Schwab wrote: >> -#define __malloc_size_t int >> +#define __malloc_size_t size_t > > There is no point in using that name any more. Thanks, I can easily install the following further patch as well. There are similar usages in gmalloc.c but that's verging even more into code cleanup and at this point I assume we should be focusing on the bug fixes. * alloc.c (__malloc_size_t): Remove. All uses replaced by size_t. See Andreas Schwab's note . === modified file 'src/alloc.c' --- src/alloc.c 2011-07-13 03:45:56 +0000 +++ src/alloc.c 2011-07-14 16:03:17 +0000 @@ -68,10 +68,6 @@ #ifdef DOUG_LEA_MALLOC #include -/* malloc.h #defines this as size_t, at least in glibc2. */ -#ifndef __malloc_size_t -#define __malloc_size_t size_t -#endif /* Specify maximum number of areas to mmap. It would be nice to use a value that explicitly means "no limit". */ @@ -82,9 +78,8 @@ /* The following come from gmalloc.c. */ -#define __malloc_size_t size_t -extern __malloc_size_t _bytes_used; -extern __malloc_size_t __malloc_extra_blocks; +extern size_t _bytes_used; +extern size_t __malloc_extra_blocks; #endif /* not DOUG_LEA_MALLOC */ @@ -1111,11 +1106,11 @@ # define BYTES_USED _bytes_used #endif -static __malloc_size_t bytes_used_when_reconsidered; +static size_t bytes_used_when_reconsidered; /* Value of _bytes_used, when spare_memory was freed. */ -static __malloc_size_t bytes_used_when_full; +static size_t bytes_used_when_full; /* This function is used as the hook for free to call. */