From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.diffs,gmane.emacs.devel Subject: Re: emacs-27 41232e6: Avoid crashes due to bidi cache being reset during redisplay Date: Sun, 31 May 2020 15:36:22 +0000 Message-ID: References: <20200531142645.22884.78754@vcs0.savannah.gnu.org> <20200531142647.08FCA20A2B@vcs0.savannah.gnu.org> <837dwskuiy.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="68974"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-diffs@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-diffs-bounces+gnu-emacs-diffs=m.gmane-mx.org@gnu.org Sun May 31 17:37:06 2020 Return-path: Envelope-to: gnu-emacs-diffs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfQ1K-000Hpz-R5 for gnu-emacs-diffs@m.gmane-mx.org; Sun, 31 May 2020 17:37:06 +0200 Original-Received: from localhost ([::1]:58300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfQ1J-0000BT-Sh for gnu-emacs-diffs@m.gmane-mx.org; Sun, 31 May 2020 11:37:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfQ1F-0000An-Gi; Sun, 31 May 2020 11:37:01 -0400 Original-Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]:41406) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfQ1E-0002Hq-Om; Sun, 31 May 2020 11:37:01 -0400 Original-Received: by mail-ot1-x32e.google.com with SMTP id k15so2512326otp.8; Sun, 31 May 2020 08:36:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+WpyM2nI4ua3465rBzo/6KC/ShF92H5/CzMm15cb5wQ=; b=Mw+n2Dr8QzTR9V/gO6sRk8SpCNuNe8jmN06bkyvETS3wYfZNxIXXOPZMElfizKmcCx dctNKyYx7ZrfP8eagaToVgWzw1KwJ+VbCGkDOr95zgxG0DWjhp3bglM7JATAotvwkiFW sJ5bQKB8AXxnb1dMV84R2tcnxEjjqgasoa1lSpxQad6NA6fpGxOU1UsmOy0Ce4IT6orK Z4awxQcNaPgwBI+ncnCGvi3VxwN0Y81K5audLUisxZr9PdtqEVDgF0HH28ySfv1+MLDP DJdYqQY2VcTtNAbGcX6M1b7driIL0g+XrP5OvtCunCs34DWizHaCzLYO3wmBFRK3F9qP 02Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+WpyM2nI4ua3465rBzo/6KC/ShF92H5/CzMm15cb5wQ=; b=uMqCVfdakzgWSsweWxBCPjKDnAKZJiCnCQ/aEvkMBOAUri9hNhOohlkuQN3+TEHjyV Sa7Rwx272I8HrUejYjzEhZdivRTxhWoQqrvsyhfiQkO1V21JIIYdF+/frv89dL/gpMRw GjGqz6ftenfBxfwIhB3ARa0/LQ9DihYqmfR7lftJBkA1nJlCy4Neq1up1oV4qymUlmea AL/XXrjMGWXZDxjQyXqvSiY/GB9+7hP+AuNMXWsmC9q2R1VFwu7vmZo/1ryR97H09HZx 7CSkP6B2V7EmIesLoRA/CrWWSZTWKwuFsaOFzzCEd//Urk5hCZO9DFHp6RmOq7+mAEzA kmxw== X-Gm-Message-State: AOAM530M1uNmQvo32r+5jDmwR2NLvhXRRAabh+XJv28cN7Q9p0oDHSVf iYxGkS3Ge0iWwcrvEZp/ZHiToKl0+oUFJ424U/qVHhbB X-Google-Smtp-Source: ABdhPJzilvcgMYUi2/tIAqF1tSFYEj5EBG2QAWfZ4WHEK3vufTJxTyF6clAg+sYmQjJTg8I6EXO5UHZPQm5auICCryE= X-Received: by 2002:a9d:7a50:: with SMTP id z16mr14328076otm.292.1590939418837; Sun, 31 May 2020 08:36:58 -0700 (PDT) In-Reply-To: <837dwskuiy.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::32e; envelope-from=pipcet@gmail.com; helo=mail-ot1-x32e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-diffs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for Emacs changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-diffs-bounces+gnu-emacs-diffs=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-diffs" Xref: news.gmane.io gmane.emacs.diffs:156396 gmane.emacs.devel:251678 Archived-At: On Sun, May 31, 2020 at 3:12 PM Eli Zaretskii wrote: > > From: Pip Cet > > Date: Sun, 31 May 2020 14:44:54 +0000 > > Cc: emacs-diffs@gnu.org > > > > > + void *itdata = bidi_shelve_cache (); > > > > But what if we're out of memory? bidi_shelve_cache will call xmalloc... > > xmalloc calls memory_full if that happens. Sorry, should have been more explicit: if we run out of memory, memory_full will signal an error, after freeing some "spare" memory. The error handler will call echo_display_area_1. If the bidi iterator is in use, the cache size is much larger than the spare memory we freed, so the allocation will also fail, and I'm not sure we ever recover from that.