From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Unexec dumping results in "Segmentation fault" on Windows Msys2 Date: Thu, 15 Apr 2021 19:08:09 +0300 Message-ID: <83eefby1hy.fsf@gnu.org> References: <83im52ed8b.fsf@gnu.org> <989be2e0-a090-309b-58cb-8064c6bd5aee@gmail.com> <83y2dycmgr.fsf@gnu.org> <835z0oyrct.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5805"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Nikolay Kudryavtsev Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 15 18:12:34 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lX4bZ-0001Mf-GD for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Apr 2021 18:12:33 +0200 Original-Received: from localhost ([::1]:41012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX4bY-0000v6-HL for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Apr 2021 12:12:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX4XX-0005vV-5c for emacs-devel@gnu.org; Thu, 15 Apr 2021 12:08:23 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39390) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX4XS-0002Y7-19; Thu, 15 Apr 2021 12:08:22 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4636 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lX4XR-0006kL-BE; Thu, 15 Apr 2021 12:08:17 -0400 In-Reply-To: (message from Nikolay Kudryavtsev on Thu, 15 Apr 2021 18:47:31 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:268102 Archived-At: > From: Nikolay Kudryavtsev > Cc: emacs-devel@gnu.org > Date: Thu, 15 Apr 2021 18:47:31 +0300 > > Binutils triggered segfault: > > $ temacs.exe -Q > Warning: Lisp directory > 'd:/Emacs/configurations/msys2-brake-test/src/lisp': No such file or > directory > Cannot open load file: No such file or directory, loadup.el Does the directory d:/Emacs/configurations/msys2-brake-test/src/lisp exist? If so, please try running temacs.exe from cmd.exe, not from MSYS2 Bash. If that fails with the same error message, then please step into the call to file_accessible_directory_p in this function (from lread.c): static void load_path_check (Lisp_Object lpath) { Lisp_Object path_tail; /* The only elements that might not exist are those from PATH_LOADSEARCH, EMACSLOADPATH. Anything else is only added if it exists. */ for (path_tail = lpath; !NILP (path_tail); path_tail = XCDR (path_tail)) { Lisp_Object dirfile; dirfile = Fcar (path_tail); if (STRINGP (dirfile)) { dirfile = Fdirectory_file_name (dirfile); if (! file_accessible_directory_p (dirfile)) <<<<<<<<<<<<<<<<< dir_warning ("Lisp directory", XCAR (path_tail)); } } } and see why it fails, including the code in w32_accessible_directory_p that it calls. > (gdb) p &stack_bottom_variable > $1 = (void **) 0xbd3cbff6c8 Nothing wrong with that. And what do these produce: (gdb) p current_thread (gdb) p current_thread->m_stack_bottom > I went for bisecting hoping to find that simple localized change. It was > not my intention to tease you, at least not since the second letter. ;-) > I can grab as many full backtraces or do other tests as needed. It's > just that the GDB session looked completely fine to me in my admittedly > limited understanding of low level Emacs internals. The crash happens > when bootstrap-emacs is doing dumping(same place as the other problem). > Here's a couple backtraces: > > https://gist.githubusercontent.com/sg2002/32ea64634a89e7b407f50e29b4ab5f7e/raw/aa0bcc517e1a4de733a9dc2678f8c45daefb95f9/gistfile1.txt > > https://gist.githubusercontent.com/sg2002/d9cfaf1268973b20d66d79f5df575498/raw/06091019c1d30b863e6000fb642e09316d82a344/gistfile1.txt These look like some kind of infinite recursion that causes stack overflow. So the final segfault is not interesting; what's interesting is why there's infinite recursion.