From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Re: xnrealloc: How and when to properly use it. Date: Sun, 28 Apr 2019 13:43:17 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="150797"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 28 22:44:03 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hKqeY-000d5e-Bo for ged-emacs-devel@m.gmane.org; Sun, 28 Apr 2019 22:44:02 +0200 Original-Received: from localhost ([127.0.0.1]:48238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKqeX-0002qj-6z for ged-emacs-devel@m.gmane.org; Sun, 28 Apr 2019 16:44:01 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKqdu-0002qT-PV for emacs-devel@gnu.org; Sun, 28 Apr 2019 16:43:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hKqdt-0005ZK-8o for emacs-devel@gnu.org; Sun, 28 Apr 2019 16:43:22 -0400 Original-Received: from gateway33.websitewelcome.com ([192.185.146.80]:45712) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hKqds-0005YY-Aa for emacs-devel@gnu.org; Sun, 28 Apr 2019 16:43:20 -0400 Original-Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 181EED667C for ; Sun, 28 Apr 2019 15:43:19 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id KqdqhgcKoYTGMKqdqhlr8d; Sun, 28 Apr 2019 15:43:19 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=SS4uQ3e6/+Ak1OWc494vIFI0MGBv0T/w8ACb5JEh4lg=; b=IkT4SEOOewJsvnOf1+zV2L1ZLs PmFtL/UY0I45qfjTDyBOB7qFKV4cWxN0sEDLJAjB4hh6ihJWrKioQyp06eZfoXaPvgKk8CrVpbNGa 4cVRpMY+Bi0ydyf/PZhn0f2FsFI+5cjrjcdKqr52rx8bbg7ZNxWHCW3QW5NCE+EeC7kgcD+do4RGc YEQ8s4uhUxLJU0vE8cV2P4SmoIbE7Ez8I1S3fDSh8upCtGTWK0JUknOUNMhBZzSz0Dzp7lY5ZB8kP GXjqsay3cC9DVbeyHdvRF/kmyMLYUM/5DUizs9w6p/Qel8ZCEkjU/wQbx9McAhGsclOL0j1ihtEPW Jx9hDTMQ==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52526 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1hKqdq-003ab8-B2; Sun, 28 Apr 2019 15:43:18 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hKqdq-003ab8-B2 X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:52526 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 192.185.146.80 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:236014 Archived-At: I did some additional testing today and confirmed that assigning the returned value of xnrealloc back to w->mc_elts.caches has resolved the issue. Thank you for the help -- greatly appreciated! Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > Date: [04-27-2019 18:51:51] <27 Apr 2019 18:51:51 -0700> > From: Paul Eggert > To: Keith David Bershatsky > Cc: Emacs Devel > Subject: Re: xnrealloc: How and when to properly use it. > > Keith David Bershatsky wrote: > > On a W32 build of Emacs (built with MinGW_32 and ezwinports downloaded a few years ago), my usage of xnrealloc (more often than not) causes Emacs to crash when_not_ running under gdb. > > Try the GDB command 'set disable-randomization off'. Of course this makes > debugging more ... interesting. > > + /* Decrease the size of the array to a bare minimum. */ > + xnrealloc (w->mc_elts.caches, 1, sizeof *w->mc_elts.caches); > > That can't be right; at the very least you need to assign the returned value of xnrealloc back to w->mc_elts.caches.