all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Can Emacs deal with segfaults more gracefully (on Mac)
@ 2024-08-01 22:18 Ag Ibragimov
  2024-08-02  4:23 ` Gerd Möllmann
  2024-08-02  5:55 ` Eli Zaretskii
  0 siblings, 2 replies; 3+ messages in thread
From: Ag Ibragimov @ 2024-08-01 22:18 UTC (permalink / raw)
  To: emacs-devel


After a lengthy hiatus, I am having to work on Mac again. Almost immediately, I stumbled on a problem with crashing Emacs. Long story short (you can read all about it here https://www.reddit.com/r/emacs/comments/1eg9hdg/multilingual_spellchecking_omg_what_a_rabbit_hole), it turned out that a package calls a command-line utility that segfaults in certain cases. This isn't a quest to help me with the problem; I identified and found a workaround for it.

It did make me wonder, though, why did Emacs crash to begin with? Shouldn't it be handling offending subprocesses more gracefully? I think, typically, Emacs (I think) would handle subprocess errors gracefully; my guess is that in this specific case, the error was too severe, or something like that?

Also, I just realized - Emacs almost never (at least I don't remember when that happened to me last time) crashes in Linux. On Mac, it does. Can't say quite often, yet occasionally, that happens.

I'm just curious; is that due to how Emacs runs on Macs, or for some other reasons?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Can Emacs deal with segfaults more gracefully (on Mac)
  2024-08-01 22:18 Can Emacs deal with segfaults more gracefully (on Mac) Ag Ibragimov
@ 2024-08-02  4:23 ` Gerd Möllmann
  2024-08-02  5:55 ` Eli Zaretskii
  1 sibling, 0 replies; 3+ messages in thread
From: Gerd Möllmann @ 2024-08-02  4:23 UTC (permalink / raw)
  To: Ag Ibragimov; +Cc: emacs-devel

Ag Ibragimov <agzam.ibragimov@gmail.com> writes:

> Also, I just realized - Emacs almost never (at least I don't remember
> when that happened to me last time) crashes in Linux. On Mac, it does.
> Can't say quite often, yet occasionally, that happens.

It crashes or freezes for me about once a week, on average. Something
like that. Sometimes more often, sometimes less.

> I'm just curious; is that due to how Emacs runs on Macs, or for some
> other reasons?

I'd say it's unmaintained, old, and hard to understand code, especially
in the Cocoa/Objective-C GUI part.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Can Emacs deal with segfaults more gracefully (on Mac)
  2024-08-01 22:18 Can Emacs deal with segfaults more gracefully (on Mac) Ag Ibragimov
  2024-08-02  4:23 ` Gerd Möllmann
@ 2024-08-02  5:55 ` Eli Zaretskii
  1 sibling, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2024-08-02  5:55 UTC (permalink / raw)
  To: Ag Ibragimov; +Cc: emacs-devel

> From: Ag Ibragimov <agzam.ibragimov@gmail.com>
> Date: Thu, 01 Aug 2024 17:18:55 -0500
> 
> After a lengthy hiatus, I am having to work on Mac again. Almost immediately, I stumbled on a problem with crashing Emacs. Long story short (you can read all about it here https://www.reddit.com/r/emacs/comments/1eg9hdg/multilingual_spellchecking_omg_what_a_rabbit_hole), it turned out that a package calls a command-line utility that segfaults in certain cases. This isn't a quest to help me with the problem; I identified and found a workaround for it.
> 
> It did make me wonder, though, why did Emacs crash to begin with? Shouldn't it be handling offending subprocesses more gracefully? I think, typically, Emacs (I think) would handle subprocess errors gracefully; my guess is that in this specific case, the error was too severe, or something like that?

Emacs should never crash because a subprocess crashed.  But AFAIU in
your case it is not a subprocess that crashed, it's a dynamic module,
i.e. a shared library loaded by Emacs.  Because that's how jinx is
implemented: it is a dynamic Emacs module that uses the Enchant
_library_ (not Enchant the program) to perform the spell-checking.
When a shared library loaded by Emacs segfaults, the fatal signal is
delivered to Emacs itself, and Emacs cannot possibly continue to run.
What Emacs does in this case is catch the fatal signal and attempt to
auto-save before exiting, so as to at least save your edits.  But exit
it must in this case; there's no way around that.

> Also, I just realized - Emacs almost never (at least I don't remember when that happened to me last time) crashes in Linux. On Mac, it does. Can't say quite often, yet occasionally, that happens.
> 
> I'm just curious; is that due to how Emacs runs on Macs, or for some other reasons?

That is unrelated, but yes, Emacs on macOS is less stable, mainly
because we don't have experts on board who can invest time into
maintaining the macOS port.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-02  5:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-01 22:18 Can Emacs deal with segfaults more gracefully (on Mac) Ag Ibragimov
2024-08-02  4:23 ` Gerd Möllmann
2024-08-02  5:55 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.