From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#53136: 28.0.90; segfault in lock_file Date: Mon, 10 Jan 2022 15:11:04 -0800 Organization: UCLA Computer Science Department Message-ID: <37cd3017-38cb-fa2c-7b52-fbeb3b085744@cs.ucla.edu> References: <871r1hv40o.fsf.ref@yahoo.com> <871r1hv40o.fsf@yahoo.com> <83bl0l2we3.fsf@gnu.org> <87r19htjlp.fsf@yahoo.com> <838rvp2tcw.fsf@gnu.org> <875yqtt9qk.fsf@yahoo.com> <8335lxazg6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------Z23g48mICuPKU4XoiAwxO6i9" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40180"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Cc: Po Lu , 53136@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 11 00:12:25 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 1n73pw-000AHw-Vu for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 Jan 2022 00:12:25 +0100 Original-Received: from localhost ([::1]:51800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n73pu-00053s-HH for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Jan 2022 18:12:23 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n73pa-00050Q-IR for bug-gnu-emacs@gnu.org; Mon, 10 Jan 2022 18:12:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60613) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n73pa-0005w0-9f for bug-gnu-emacs@gnu.org; Mon, 10 Jan 2022 18:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n73pa-0004qJ-1t for bug-gnu-emacs@gnu.org; Mon, 10 Jan 2022 18:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Jan 2022 23:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53136 X-GNU-PR-Package: emacs Original-Received: via spool by 53136-submit@debbugs.gnu.org id=B53136.164185627718535 (code B ref 53136); Mon, 10 Jan 2022 23:12:02 +0000 Original-Received: (at 53136) by debbugs.gnu.org; 10 Jan 2022 23:11:17 +0000 Original-Received: from localhost ([127.0.0.1]:53516 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n73or-0004ot-HN for submit@debbugs.gnu.org; Mon, 10 Jan 2022 18:11:17 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:58212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n73oo-0004og-Vs for 53136@debbugs.gnu.org; Mon, 10 Jan 2022 18:11:15 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2C5221601A0; Mon, 10 Jan 2022 15:11:09 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id x48D5l2v6Bh5; Mon, 10 Jan 2022 15:11:04 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E4D161601A2; Mon, 10 Jan 2022 15:11:04 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id J_4IuRSdPCgG; Mon, 10 Jan 2022 15:11:04 -0800 (PST) Original-Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id B5F461601A0; Mon, 10 Jan 2022 15:11:04 -0800 (PST) Content-Language: en-US In-Reply-To: <8335lxazg6.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:223907 Archived-At: This is a multi-part message in MIME format. --------------Z23g48mICuPKU4XoiAwxO6i9 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/9/22 04:03, Eli Zaretskii wrote: > Paul, could you please take a look? The problem (as Po deduced) seems to be that Haiku errno values are negative by default. However, I see some problems with the recently installed fix. 1. It uses BE_USE_POSITIVE_POSIX_ERRORS but Haiku spells it B_USE_POSITIVE_POSIX_ERRORS. 2. There's no need to replace "if (err < 0)" with "if (err == -1 || err == -2)", as this replacement is not needed given the "#if !defined HAIKU ..." stuff. 3. More importantly, I'm sure there are other places where Emacs assumes that errno values are positive. I doubt whether it's reasonable to expect Emacs developers to remember and work around this Haiku incompatibility, every time they call a function that sets errno or returns an errno value. Instead, we should arrange for Haiku builds to use positive errno values, they way errno behaves on GNU and other POSIX-compatible hosts. This should be a much more maintainable solution. Proposed patch attached. --------------Z23g48mICuPKU4XoiAwxO6i9 Content-Type: text/x-patch; charset=UTF-8; name="0001-Improve-port-to-Haiku-errno-values.patch" Content-Disposition: attachment; filename="0001-Improve-port-to-Haiku-errno-values.patch" Content-Transfer-Encoding: base64 RnJvbSAwMjZhZWY4NjhhZDI0MmMzY2NhZjBkNTQyYWI4MWI2MjFhMjZlMGE5IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1 PgpEYXRlOiBNb24sIDEwIEphbiAyMDIyIDE1OjA3OjUxIC0wODAwClN1YmplY3Q6IFtQQVRD SF0gSW1wcm92ZSBwb3J0IHRvIEhhaWt1IGVycm5vIHZhbHVlcwoKKiBjb25maWd1cmUuYWMg KEJfVVNFX1BPU0lUSVZFX1BPU0lYX0VSUk9SUyk6IERlZmluZSBvbiBIYWlrdS4KKiBzcmMv ZmlsZWxvY2suYyAobG9ja19pZl9mcmVlKTogUmV2ZXJ0IHJlY2VudCBjaGFuZ2VzLCBzaW5j ZQpkZWZpbmluZyBCX1VTRV9QT1NJVElWRV9QT1NJWF9FUlJPUlMgc2hvdWxkIGZpeCB0aGUg Z2VuZXJhbCBwcm9ibGVtLgotLS0KIGNvbmZpZ3VyZS5hYyAgIHwgMiArKwogc3JjL2ZpbGVs b2NrLmMgfCA5ICstLS0tLS0tLQogMiBmaWxlcyBjaGFuZ2VkLCAzIGluc2VydGlvbnMoKyks IDggZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvY29uZmlndXJlLmFjIGIvY29uZmlndXJl LmFjCmluZGV4IGJhZjhjODAxOGUuLmM1ZDk3ODkwYzcgMTAwNjQ0Ci0tLSBhL2N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