From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel =?UTF-8?Q?Mart=C3=ADn?= via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#56443: 28.1; Mac segmentation fault with ffap Date: Fri, 08 Jul 2022 11:54:04 +0200 Message-ID: References: <83sfnc40yi.fsf@gnu.org> Reply-To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23087"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (darwin) Cc: 56443@debbugs.gnu.org, sje30@cam.ac.uk To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 08 11:55:12 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 1o9khc-0005rD-0r for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Jul 2022 11:55:12 +0200 Original-Received: from localhost ([::1]:34278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9khb-0000Ta-2M for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Jul 2022 05:55:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9khS-0000TD-UO for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2022 05:55:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36747) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o9khS-00032I-KQ for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2022 05:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o9khS-0005xP-JN for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2022 05:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Jul 2022 09:55:02 +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.165727405722787 (code B ref 56443); Fri, 08 Jul 2022 09:55:02 +0000 Original-Received: (at 56443) by debbugs.gnu.org; 8 Jul 2022 09:54:17 +0000 Original-Received: from localhost ([127.0.0.1]:58877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9kgi-0005vQ-JB for submit@debbugs.gnu.org; Fri, 08 Jul 2022 05:54:16 -0400 Original-Received: from sonic312-25.consmr.mail.ir2.yahoo.com ([77.238.178.96]:45153) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9kge-0005v4-OM for 56443@debbugs.gnu.org; Fri, 08 Jul 2022 05:54:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1657274047; bh=/t3L7+RyCDmVXBLK+lRuZMXriPMKRe+Q0SeBJ6dagh0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=pYnnK7DxGmS8QKSDHRZlmr9b32EB+/7BMiQnfqJUUXyopQhRYvsRWfuSWw31CXI3QzN8WBag9sU9kddb+Nfdo6A8qaPE6RpZYmbm5wzhdaWwvk8bt6Ovnsjf5ICU73mIpWunngsURRMAxqtB+TpbInh2218LNBBn5+FSY8D4FcqQR47EY0+5n9amCRJgkVHjtMXpRAmPmxZMAKdpyiX53Nf3il7bDk4zQc9WVWjBtHJBfDRFBe7wMb3liFPRhVQJrXML8WJEedBhow68rfeJXWgrbYn9tNiNOOtSVZ+TwKu4Z8INv0MblWrWce3S60k/e0ukgE153snDG+vVZNQQIA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1657274047; bh=TihGErjD0f4r1oD9YCpay8AXb1jNSG5Gf0VXL0vCbQ1=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=QQGdYZRGK/InCQuekRyjliNH77Pf3/+srkWdp6wVqZpXCFhWFsub8AK3OetGsnEAIxJcyBAcVZ1JOUYf5uwp/nG8Or+S4LZI/ttcC8v4gdE2flAZ8ey6JAhjkFknUpLCu83cjL5Xi5lJtvGDYx6gR/KrLpoiZnfs8r1pJXmkVGpk0WwYtKH7Vox8Jb2nTzwkmQ8b5rOFlKcRvGUPPZNVFPl5FevJmDDF4L6qm2Gf5pPfLD7jDVre7gjFXC8MypFFXX5FULkkf9Sr5wK1kFum3Ydk3DJblWyC5EcAUpHM0yqy9Nx9udTrz4F1es6IjJo6q2qSBZwPsRlQFy1IzPSbsg== X-YMail-OSG: 3wcqsHUVM1k3wME05Bc4.5iGJnTsZ3nOYxCcaoEfKnVOu80ygyoF1adJH08Nhqk pAPHFSql5nlpHAWGXvxEfPgdQacn42y8QVqxVSs72UB.9iC9cZgbPpcG2UaeabIbtDkRfADvozMp MpVQamA8DSXHKDwOCGkG0705bOTkYiOO.nTMXO9wtk8zl3_ZgVGRedBGEXWQFl2AK9w1U6VDvCrZ XRDsmDWqaoaoAi20jZc8vtn6HcCfcGNOmXEFiWnL300A9oYR8bqJioAn0GYfKQYxFgyXIaHKz07g oGgiv7DqhnNJlTa81abHqeQ507.9RiLbC_rWN5JvCbNpart1YSCXCLiDTHEpMekLHitaER.2fIvB KvQCxrS8kKx8Z_Xg18QK9UxkyPVE7XeoXHairgYy4SJPiJz2uzyP8Iu6G.EHxKbEWPkVJPUY1NAm rhgKZ4JEywFn1S.xr0UA7aGuohKB20fZZgZmPZBCYL.0N8gmZVIIzbuDjEn2m4KGvgudmXMW0RXE hexsI3zFgcpimvi.wqZrKBekHDxgUtfhNvqgdOtVFlB8C_R5.OzgJEJfFZy1x1nLpneDVzi_RKEn 2dkAU_wCbg7iV16lnt2V_YM_y7VXcheYYf9QKX8mbeun8KWDk8084AkC44jr3ZcfPJaGQxvJ4dM6 Egm36a7JWEBkE9FKD7zJiVOVvk_P8ORH..PZMQwCv4u33bHxJWo2h.EIxz7I_RtArZ2hi5PorxQh 8YwuM9M0NgeoaXkvuahcS7BXR_Zr8tfASfPVnS7PkQKF1CoUItqx23U9296OKHd5lJhWqzfyLTwg IkFExE64iQbc3G4pDCZM4osUWctBkLJrGrPE2tyQzp X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ir2.yahoo.com with HTTP; Fri, 8 Jul 2022 09:54:07 +0000 Original-Received: by hermes--canary-production-ir2-74b4d6d794-ddpc4 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 9b6a52851b1e2182a9ff20bc67109b99; Fri, 08 Jul 2022 09:54:05 +0000 (UTC) In-Reply-To: <83sfnc40yi.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 08 Jul 2022 08:39:49 +0300") X-Mailer: WebService/1.1.20381 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:236441 Archived-At: Eli Zaretskii writes: > > 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.) Apparently it comes from the "parent" variable, which is the result of the file_name_directory call: Process 61514 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 frame #0: 0x000000010064fefc emacs`Ffile_name_case_insensitive_p(filename=0x000000011534dc44) at fileio.c:2608:18 2605 (impossible?). */ 2606 if (!NILP (Fstring_equal (parent, filename))) 2607 return Qnil; -> 2608 filename = parent; 2609 } 2610 } 2611 Target 0: (emacs) stopped. (lldb) fr v parent (Lisp_Object) parent = NULL Is the following expression the correct way to manually interpret the Lisp_Object as a Lisp_String? (where $ptr is the memory address of "filename" in this scenario): (char *) ((struct Lisp_String *)$ptr)->u.s.data That prints an empty string in LLDB. BTW, I don't really understand the semantics of file-name-case-insensitive-p. The docstring says that it returns nil if the file is not found, but these calls return t on my system: (file-name-case-insensitive-p "") (file-name-case-insensitive-p "FileThatDoesNotExist") Does that make sense?