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.bugs Subject: bug#56443: 28.1; Mac segmentation fault with ffap Date: Fri, 08 Jul 2022 08:39:49 +0300 Message-ID: <83sfnc40yi.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24751"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56443@debbugs.gnu.org, sje30@cam.ac.uk To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 08 07:41:19 2022 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 1o9gjv-0006IR-CY for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Jul 2022 07:41:19 +0200 Original-Received: from localhost ([::1]:45906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9gjt-0001uo-OP for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Jul 2022 01:41:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9gje-0001tU-2p for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2022 01:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o9gjd-0003bt-QB for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2022 01:41:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o9gjd-0000uO-Ma for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2022 01:41:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Jul 2022 05:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56443 X-GNU-PR-Package: emacs Original-Received: via spool by 56443-submit@debbugs.gnu.org id=B56443.16572588053370 (code B ref 56443); Fri, 08 Jul 2022 05:41:01 +0000 Original-Received: (at 56443) by debbugs.gnu.org; 8 Jul 2022 05:40:05 +0000 Original-Received: from localhost ([127.0.0.1]:58528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9gij-0000sH-G9 for submit@debbugs.gnu.org; Fri, 08 Jul 2022 01:40:05 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9gif-0000rd-OS for 56443@debbugs.gnu.org; Fri, 08 Jul 2022 01:40:03 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38052) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9giZ-0003KC-AC; Fri, 08 Jul 2022 01:39:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=XeJRAWULOdOMi5/7VyMMjlo2Z7YQz7s+AjX/MMcQ1wU=; b=WBmneb/v+b3c3BVBnxtz 6iPNqSXCgP6kLKGixxCSzHm970z4jYYPamFWTi99JVHoY5nCrydgw3k1yjGf/wtWHVRv+DdWE05CB ygTh7CsOSKssGxuC1FHEYGULUpElAtIv1fD1Aj6P+gevKDgTil4TMiftD/ul3DIH2jUgar62Bqtsl HSUJIONnsip2+fvWg6g+bHNQNkNzXoeca7BMq2ZAMslfcs7sXaVsHIXr356pI/kLNegHiLbK1Mik9 K6UWP5G1jfpIXtCVpVy6lUSRkJetmKE2KMGE6p4RctJm6lpjoL2aIHfNz8spGIs451KiJIwpNMIej j25SlAp4BRJXsA==; Original-Received: from [87.69.77.57] (port=3863 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9giW-00039C-B0; Fri, 08 Jul 2022 01:39:54 -0400 In-Reply-To: (bug-gnu-emacs@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:236425 Archived-At: > Cc: 56443@debbugs.gnu.org > Date: Thu, 07 Jul 2022 22:36:53 +0200 > From: Daniel Martín via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Stephen Eglen writes: > > > Can anyone replicate the following on Mac M1? I'm using the 'emacs' > > cask from homebrew, and I get the crash both with GUI and terminal > > version of Emacs. This seems to be mac-specific; I do not see the > > problem on linux. > > > > Yes, I can reproduce the crash. Attaching a debugger I see that the > filename passed through file-name-case-insensitive-p is NULL: > > * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x4) > * frame #0: 0x0000000100d61c2c emacs`STRING_MULTIBYTE(str=0x0000000000000000) at lisp.h:1613:34 > frame #1: 0x0000000100d64f68 emacs`encode_file_name_1(fname=0x0000000000000000) at coding.c:10397:8 > frame #2: 0x0000000100d64f28 emacs`encode_file_name(fname=0x0000000000000000) at coding.c:10419:25 > frame #3: 0x0000000100e2e098 emacs`file_name_case_insensitive_err(file=0x0000000000000000) at fileio.c:2555:28 > frame #4: 0x0000000100e2dfcc emacs`Ffile_name_case_insensitive_p(filename=0x0000000000000000) at fileio.c:2600:17 > frame #5: 0x0000000100ec47ac emacs`funcall_subr(subr=0x0000000101083bb8, numargs=1, args=0x0000000138058580) at eval.c:2996:15 That's not NULL, that's nil (which is represented as zero). But I don't understand how could that happen, because Ffile_name_case_insensitive_p checks the argument for validity: DEFUN ("file-name-case-insensitive-p", Ffile_name_case_insensitive_p, Sfile_name_case_insensitive_p, 1, 1, 0, doc: /* Return t if file FILENAME is on a case-insensitive filesystem. Return nil if FILENAME does not exist or is not on a case-insensitive filesystem, or if there was trouble determining whether the filesystem is case-insensitive. */) (Lisp_Object filename) { Lisp_Object handler; CHECK_STRING (filename); <<<<<<<<<<<<<<<<<<<<<<<<<<<< filename = Fexpand_file_name (filename, Qnil); So it seems like expand-file-name returned nil in this case? Can someone step through the code, including stepping into Fexpand_file_name, and see how we get that nil in this case? (I tried to reproduce on my system, which is not a Mac, but I don't see any nil filenames in that case.)