GNU bug report logs - #53136
28.0.90; segfault in lock_file

Previous Next

Package: emacs;

Reported by: Po Lu <luangruo <at> yahoo.com>

Date: Sun, 9 Jan 2022 06:05:01 UTC

Severity: normal

Found in version 28.0.90

Full log


Message #53 received at 53136 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Po Lu <luangruo <at> yahoo.com>, 53136 <at> debbugs.gnu.org
Subject: Re: bug#53136: 28.0.90; segfault in lock_file
Date: Mon, 10 Jan 2022 15:11:04 -0800
[Message part 1 (text/plain, inline)]
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.
[0001-Improve-port-to-Haiku-errno-values.patch (text/x-patch, attachment)]

This bug report was last modified 3 years and 254 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.