From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#47067: 28.0.50; [feature/native-comp] Crash while scrolling through dispnew.c Date: Sat, 13 Mar 2021 17:10:08 +0000 Message-ID: References: <83sg52lykn.fsf@gnu.org> <83mtv8lrmf.fsf@gnu.org> <83czw4lelg.fsf@gnu.org> <83mtv8jgn2.fsf@gnu.org> <834khfjv7q.fsf@gnu.org> <83tupfia1m.fsf@gnu.org> <83mtv7hy5c.fsf@gnu.org> <83k0qbhvnh.fsf@gnu.org> <83czw3hu5f.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33139"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andrea Corallo , 47067@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 13 18:12:05 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lL7o5-0008Sk-NJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Mar 2021 18:12:05 +0100 Original-Received: from localhost ([::1]:57770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lL7o4-0004vg-Nl for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Mar 2021 12:12:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lL7n5-0004D3-2w for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 12:11:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49070) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lL7n4-00019j-Rj for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 12:11:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lL7n4-0002gR-No for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 12:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Mar 2021 17:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47067 X-GNU-PR-Package: emacs Original-Received: via spool by 47067-submit@debbugs.gnu.org id=B47067.161565545310293 (code B ref 47067); Sat, 13 Mar 2021 17:11:02 +0000 Original-Received: (at 47067) by debbugs.gnu.org; 13 Mar 2021 17:10:53 +0000 Original-Received: from localhost ([127.0.0.1]:60615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lL7mv-0002fw-9Y for submit@debbugs.gnu.org; Sat, 13 Mar 2021 12:10:53 -0500 Original-Received: from mail-oi1-f173.google.com ([209.85.167.173]:43906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lL7ms-0002fh-C8 for 47067@debbugs.gnu.org; Sat, 13 Mar 2021 12:10:51 -0500 Original-Received: by mail-oi1-f173.google.com with SMTP id d20so30216334oiw.10 for <47067@debbugs.gnu.org>; Sat, 13 Mar 2021 09:10:50 -0800 (PST) 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=X4GnuwNz3HskfJIz8XoKs4pAHOMMyemlDiHeRoqr6wQ=; b=DwW6fph0k2cK2lF8EPJUGQgLXa5qVZvKk0x0NmHTNhiExa+PNKTpIgHxPIUUUNIdb7 lZak52Z1qzN04R2kTBVLGptuD9YvgUjWlW0y3V3aUcRdZnl0VAzok5UqC/e+nhUVSl91 wHGDIpu+IuSQwXPLcEodNFyqFeOf+UtQPpOtdkQkSoxV0qp/iTMZc8ttNCKTwF4pxLW3 mPTvbWDMsZsZz26zGDEx/Wht8RFMSn134Av62RRKtWNlh+ST98uRk+SpaOG7q3DOBpI/ PNPgeU6TvYTm78Xb+fak7WfO1a1mx0pW0ElpNM9AmFT+Zw7WufTHW7t5cBJzZkpZ+2po BvHQ== 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=X4GnuwNz3HskfJIz8XoKs4pAHOMMyemlDiHeRoqr6wQ=; b=bIEJrxegpCLSd4JmVFZpdw71uJMwHDDiNJ3tIRPCznlVBlz7B+2xt04q2k5B2jP/RS M5RMRJ7AlAoktEIZxe6A2JWl02S86tllbEbqJ2bwwRxqWnqHrZ8NrTAVdu6OjsTSqQ+L 0kHKtyDRb1tEiUnX8B1FPikcGR196EyozXjLt2XMmxz1ebFYB7v/Oxy1cxw/fmNA8J8T cJlSIlX0zhnH1eD1WX50HNX9+zj9AXcu5cPiGiljtYlRlVifhdjgqxXQvmKRta0fsyrg +NZBgZUS16Ga92JKEVwWYWTsUxTFbnosuMoEvs8mDVB4ayh2VMXwCkRxy69VafkILQgT yqMg== X-Gm-Message-State: AOAM533jg94LGQBcPZZV20C6A2vJYZC4Q8mp+tY0971WI4hqqbPGuGNt QgF6MNmaKu229X4SNq27RIFXL0KXbG9wn9gZu+s= X-Google-Smtp-Source: ABdhPJxYaVuHueQKTP4aUWq+/zyshJ9UeLo2nAyvBXm/n07bxj04G5SzQXrDKvNc14irxXoiRYCQXhG1VzeowFQoSJY= X-Received: by 2002:a54:4196:: with SMTP id 22mr13131378oiy.30.1615655444692; Sat, 13 Mar 2021 09:10:44 -0800 (PST) In-Reply-To: <83czw3hu5f.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:202280 Archived-At: On Sat, Mar 13, 2021 at 4:53 PM Eli Zaretskii wrote: > > From: Pip Cet > > Date: Sat, 13 Mar 2021 16:32:50 +0000 > > Cc: Andrea Corallo , 47067@debbugs.gnu.org > > > > > > > > So EDI is bunk at this point. Can you go back a bit further to where > > > > > > it's initialized? > > > > > > > > > > Sorry, I don't understand: I gave you the disassembly of 512 bytes > > > > > before, isn't that enough to see where EDI is assigned the value? Or > > > > > what do you mean by "go back"? > > > > > > > > It's not enough, no. we're looking for an insn of the form mov XXX, > > > > %edi or lea XXX, %edi, or anything like that. > > > > > > I went back 4KB, and the only two instructions that write into EDI are > > > > It's a long function, that might not have been enough. > > But since I found those two, everything before that is irrelevant, > right? Assuming all code paths hit these insns, yes. > > I just checked the only "mingw"-like sources I could find, and they > > don't appear to use the frame pointer argument properly... > > Why is this suddenly relevant when native compilation is involved? Native-compiled code assumes, on Windows, that you can call setjmp through a function pointer. If the implementation of setjmp is such that you can't, we shouldn't do that. Portable code will never call setjmp through a function pointer. Since mingw (at least the version I could find) declares setjmp with the "returns_twice" attribute, I'm assuming their implementation is not such that you can call it through a function pointer. > > > > Is it possible that you're on Windows, but unlike other Windows > > > > setjmps, it's unsafe to call your setjmp through a function pointer? > > > > > > How do I tell? > > > > Well, you could just apply this untested patch, fix any obvious > > compile errors I might not have spotted, and try to reproduce it. I'm > > not currently on a Windows (or x86) machine, so it's a bit hard for me > > to test... > > I'd like this investigation to be less of a blind search, sorry. can > you tell what to check or look at to see if this is relevant? > > And how is setjmp related to the code which causes segfault? I see no > call to setjmp in the disassembly. That might be because it's called through a function pointer? If you look at the Lisp code, the thing it does just before the code dies is to exit from a long-ish (catch ...) form. Which involves setjmp, unless the byte compiler is smart enough to optimize it away. > > > Note how arguments to Funcall's are the same, whereas arguments to > > > funcall_lambda's aren't. Even the garbage in the 2 arguments to > > > wrong_type_argument are identical. > > > > Which non-stack addresses are invariant in that backtrace? > > Not sure how stack-based vs non-stack based is important here. If non-stack addresses vary between runs and stack addresses don't, I don't see any evidence we're looking at corruption here.