unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Two fixes for module bug when interleaving threads
@ 2020-11-27 20:57 Philipp Stephani
  2020-11-28  7:25 ` Eli Zaretskii
  2020-11-29 19:44 ` Juri Linkov
  0 siblings, 2 replies; 4+ messages in thread
From: Philipp Stephani @ 2020-11-27 20:57 UTC (permalink / raw)
  To: Emacs developers

Hi,

I just pushed two fixes for the same bug that appears when
interleaving module calls in separate threads:
cdc632fbe6e149318147a98cccf1b7af191f2ce8 for the release branch and
23974cfa48b9245658667eff81d132b3aecd2618 for master. The intention was
that a simpler and more localized fix should go to the release branch,
the "proper" fix to master. Now I've realized that arguably the
simpler fix is overall better: it's more localized, touches fewer
moving pieces, and is probably not significantly slower (though I
haven't benchmarked it). Any opinions? If people agree, we can
overwrite the fix on master with the fix on the release branch.

Thanks,
Philipp



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

* Re: Two fixes for module bug when interleaving threads
  2020-11-27 20:57 Two fixes for module bug when interleaving threads Philipp Stephani
@ 2020-11-28  7:25 ` Eli Zaretskii
  2020-11-29 19:44 ` Juri Linkov
  1 sibling, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2020-11-28  7:25 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: emacs-devel

> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Fri, 27 Nov 2020 21:57:41 +0100
> 
> I just pushed two fixes for the same bug that appears when
> interleaving module calls in separate threads:
> cdc632fbe6e149318147a98cccf1b7af191f2ce8 for the release branch and
> 23974cfa48b9245658667eff81d132b3aecd2618 for master. The intention was
> that a simpler and more localized fix should go to the release branch,
> the "proper" fix to master. Now I've realized that arguably the
> simpler fix is overall better: it's more localized, touches fewer
> moving pieces, and is probably not significantly slower (though I
> haven't benchmarked it). Any opinions? If people agree, we can
> overwrite the fix on master with the fix on the release branch.

Thanks, but the changes are too significant to go to the release
branch before they are properly tested on master.  With the start of
Emacs 27.2 pretest imminent, I feel it's unsafe to make such changes
there.  So I've reverted the commit on the release branch.

We can revisit this for Emacs 27.3, or if the pretest of Emacs 27.2
takes longer than I expect.



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

* Re: Two fixes for module bug when interleaving threads
  2020-11-27 20:57 Two fixes for module bug when interleaving threads Philipp Stephani
  2020-11-28  7:25 ` Eli Zaretskii
@ 2020-11-29 19:44 ` Juri Linkov
  2020-11-29 20:16   ` Philipp Stephani
  1 sibling, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2020-11-29 19:44 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: Emacs developers

> I just pushed two fixes for the same bug that appears when
> interleaving module calls in separate threads:
> cdc632fbe6e149318147a98cccf1b7af191f2ce8 for the release branch and
> 23974cfa48b9245658667eff81d132b3aecd2618 for master. The intention was
> that a simpler and more localized fix should go to the release branch,
> the "proper" fix to master. Now I've realized that arguably the
> simpler fix is overall better: it's more localized, touches fewer
> moving pieces, and is probably not significantly slower (though I
> haven't benchmarked it). Any opinions? If people agree, we can
> overwrite the fix on master with the fix on the release branch.

Unfortunately, 23974cfa48b9245658667eff81d132b3aecd2618 in master
broke module loading: while loading a module, Emacs prints the
message "Loading (module)..." and hangs, doesn't react to input,
becomes completely unresponsive to C-g.

Here's is the shortest reproducible test case:

M-x package-install RET zmq RET
(load-file "~/.emacs.d/elpa/zmq-20200912.1126/emacs-zmq.so")

It hangs after printing to stderr:

  double free or corruption (!prev)
  Fatal error 6: Aborted

Fortunately, this problem doesn't exist in the 27 release branch.



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

* Re: Two fixes for module bug when interleaving threads
  2020-11-29 19:44 ` Juri Linkov
@ 2020-11-29 20:16   ` Philipp Stephani
  0 siblings, 0 replies; 4+ messages in thread
From: Philipp Stephani @ 2020-11-29 20:16 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Emacs developers

Am So., 29. Nov. 2020 um 20:49 Uhr schrieb Juri Linkov <juri@linkov.net>:
>
> > I just pushed two fixes for the same bug that appears when
> > interleaving module calls in separate threads:
> > cdc632fbe6e149318147a98cccf1b7af191f2ce8 for the release branch and
> > 23974cfa48b9245658667eff81d132b3aecd2618 for master. The intention was
> > that a simpler and more localized fix should go to the release branch,
> > the "proper" fix to master. Now I've realized that arguably the
> > simpler fix is overall better: it's more localized, touches fewer
> > moving pieces, and is probably not significantly slower (though I
> > haven't benchmarked it). Any opinions? If people agree, we can
> > overwrite the fix on master with the fix on the release branch.
>
> Unfortunately, 23974cfa48b9245658667eff81d132b3aecd2618 in master
> broke module loading: while loading a module, Emacs prints the
> message "Loading (module)..." and hangs, doesn't react to input,
> becomes completely unresponsive to C-g.
>
> Here's is the shortest reproducible test case:
>
> M-x package-install RET zmq RET
> (load-file "~/.emacs.d/elpa/zmq-20200912.1126/emacs-zmq.so")
>
> It hangs after printing to stderr:
>
>   double free or corruption (!prev)
>   Fatal error 6: Aborted
>

Thanks for the report, fixed with commit
41c338474dd1e086494337fd18ec8828cef1a75c.
(The subtlety here was that this triggered only if a module allocated
more than 512 objects in its initialization function, so the unit
tests didn't catch it.)



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

end of thread, other threads:[~2020-11-29 20:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27 20:57 Two fixes for module bug when interleaving threads Philipp Stephani
2020-11-28  7:25 ` Eli Zaretskii
2020-11-29 19:44 ` Juri Linkov
2020-11-29 20:16   ` Philipp Stephani

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).