unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Problem with portable dumper
@ 2020-02-15 18:45 Michael Albinus
  2020-02-15 19:20 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Albinus @ 2020-02-15 18:45 UTC (permalink / raw)
  To: emacs-devel

Hi,

after sleeping for months, I have decided to revive the
feature/tramp-thread-safe branch. I've merged it with master, and I've
recompiled. This results in an error:

--8<---------------cut here---------------start------------->8---
Dumping under the name bootstrap-emacs.pdmp
dumping fingerprint: 406add9509f46ad13554dfa8c2b5c4d2346e735f891479807515cd7a5226ec69
unsupported object type in dump: mutex
--8<---------------cut here---------------end--------------->8---

The error message comes from pdumper.c/dump_vectorlike, and it is likely
because I use threads, mutexes and condvars in some pre-loaded files,
like files.el or vc-hooks.el.

How could this be solved? Does dump_vectorlike needs to be extended?

Best regards, Michael.



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

* Re: Problem with portable dumper
  2020-02-15 18:45 Problem with portable dumper Michael Albinus
@ 2020-02-15 19:20 ` Eli Zaretskii
  2020-02-15 20:33   ` Michael Albinus
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2020-02-15 19:20 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-devel

> From: Michael Albinus <michael.albinus@gmx.de>
> Date: Sat, 15 Feb 2020 19:45:36 +0100
> 
> Dumping under the name bootstrap-emacs.pdmp
> dumping fingerprint: 406add9509f46ad13554dfa8c2b5c4d2346e735f891479807515cd7a5226ec69
> unsupported object type in dump: mutex
> --8<---------------cut here---------------end--------------->8---
> 
> The error message comes from pdumper.c/dump_vectorlike, and it is likely
> because I use threads, mutexes and condvars in some pre-loaded files,
> like files.el or vc-hooks.el.
> 
> How could this be solved? Does dump_vectorlike needs to be extended?

Either extend dump_vectorlike, or figure out how to leave mutex
variables out of state that is dumped, I think.  Why do you need
mutexes to be dumped?



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

* Re: Problem with portable dumper
  2020-02-15 19:20 ` Eli Zaretskii
@ 2020-02-15 20:33   ` Michael Albinus
  2020-02-15 20:42     ` Stefan Monnier
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Albinus @ 2020-02-15 20:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

>> Dumping under the name bootstrap-emacs.pdmp
>> dumping fingerprint:
>> 406add9509f46ad13554dfa8c2b5c4d2346e735f891479807515cd7a5226ec69
>> unsupported object type in dump: mutex
>>
>> The error message comes from pdumper.c/dump_vectorlike, and it is likely
>> because I use threads, mutexes and condvars in some pre-loaded files,
>> like files.el or vc-hooks.el.
>>
>> How could this be solved? Does dump_vectorlike needs to be extended?
>
> Either extend dump_vectorlike,

I would like to do, but I fear this is out of my capabilities :-(

> or figure out how to leave mutex variables out of state that is
> dumped, I think.  Why do you need mutexes to be dumped?

I'm working in the feature/tramp-thread-safe branch. I simply need it.

Bestz regards, Michael.



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

* Re: Problem with portable dumper
  2020-02-15 20:33   ` Michael Albinus
@ 2020-02-15 20:42     ` Stefan Monnier
  2020-02-15 20:58       ` Michael Albinus
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2020-02-15 20:42 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Eli Zaretskii, emacs-devel

>> or figure out how to leave mutex variables out of state that is
>> dumped, I think.  Why do you need mutexes to be dumped?
> I'm working in the feature/tramp-thread-safe branch. I simply need it.

That doesn't explain why you need a mutex object to be written in the
dumped image of Emacs.

AFAICT Tramp is not even preloaded, so changing Tramp should simply not
affect the dump at all.


        Stefan




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

* Re: Problem with portable dumper
  2020-02-15 20:42     ` Stefan Monnier
@ 2020-02-15 20:58       ` Michael Albinus
  2020-02-15 21:03         ` Stefan Monnier
  2020-02-16  3:28         ` Eli Zaretskii
  0 siblings, 2 replies; 10+ messages in thread
From: Michael Albinus @ 2020-02-15 20:58 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Eli Zaretskii, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

Hi Stefan,

> That doesn't explain why you need a mutex object to be written in the
> dumped image of Emacs.
>
> AFAICT Tramp is not even preloaded, so changing Tramp should simply not
> affect the dump at all.

The changes in files.el and vc-hooks.el are not related to Tramp. I have
changed the find-file* family of functions as well as vc-refresh-state
to run asynchronously if indicated. Tramp just profits from it.

All of this was discussed in detail months ago, when I did work on that
branch. The pdumper was introduced later, while I was away from this
work, and now I have the said problem being back.

If you want to see what happened, compare doc/emacs/files.texi,
doc/lispref/files.texi, files.el and vc-hooks.el from between master and
feature/tramp-thread-safe. etc/NEWS in the branch says also something
about (condensed).

>         Stefan

Best regards, Michael.



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

* Re: Problem with portable dumper
  2020-02-15 20:58       ` Michael Albinus
@ 2020-02-15 21:03         ` Stefan Monnier
  2020-02-16  3:28         ` Eli Zaretskii
  1 sibling, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2020-02-15 21:03 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Eli Zaretskii, emacs-devel

> The changes in files.el and vc-hooks.el are not related to Tramp. I have
> changed the find-file* family of functions as well as vc-refresh-state
> to run asynchronously if indicated. Tramp just profits from it.

Ah, I see, thanks.
Then, yes, we need to add support for mutexes to the pdumper.


        Stefan




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

* Re: Problem with portable dumper
  2020-02-15 20:58       ` Michael Albinus
  2020-02-15 21:03         ` Stefan Monnier
@ 2020-02-16  3:28         ` Eli Zaretskii
  2020-02-16 10:19           ` Michael Albinus
  1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2020-02-16  3:28 UTC (permalink / raw)
  To: Michael Albinus; +Cc: monnier, emacs-devel

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: Eli Zaretskii <eliz@gnu.org>,  emacs-devel@gnu.org
> Date: Sat, 15 Feb 2020 21:58:13 +0100
> 
> The changes in files.el and vc-hooks.el are not related to Tramp. I have
> changed the find-file* family of functions as well as vc-refresh-state
> to run asynchronously if indicated. Tramp just profits from it.

Why can't you make the mutex nil before dumping and restore it at
startup?



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

* Re: Problem with portable dumper
  2020-02-16  3:28         ` Eli Zaretskii
@ 2020-02-16 10:19           ` Michael Albinus
  2020-02-16 15:24             ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Albinus @ 2020-02-16 10:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: monnier, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> The changes in files.el and vc-hooks.el are not related to Tramp. I have
>> changed the find-file* family of functions as well as vc-refresh-state
>> to run asynchronously if indicated. Tramp just profits from it.
>
> Why can't you make the mutex nil before dumping and restore it at
> startup?

That works, thanks!

Best regards, Michael.



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

* Re: Problem with portable dumper
  2020-02-16 10:19           ` Michael Albinus
@ 2020-02-16 15:24             ` Eli Zaretskii
  2020-02-16 16:56               ` Michael Albinus
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2020-02-16 15:24 UTC (permalink / raw)
  To: Michael Albinus; +Cc: monnier, emacs-devel

> From: Michael Albinus <michael.albinus@gmx.de>
> Date: Sun, 16 Feb 2020 11:19:46 +0100
> Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> The changes in files.el and vc-hooks.el are not related to Tramp. I have
> >> changed the find-file* family of functions as well as vc-refresh-state
> >> to run asynchronously if indicated. Tramp just profits from it.
> >
> > Why can't you make the mutex nil before dumping and restore it at
> > startup?
> 
> That works, thanks!

I'm glad my idea worked.

Btw, on a more general note: I presume that your code has a way to
disable threading in file I/O.  (If it doesn't, it should IMO, for
debugging purposes and also for situations where threading cannot be
allowed for some other reasons.)  Then you could simply arrange for
threading to be disabled during dumping, and enable it in startup.el
when Emacs starts normally.  And when threading is disabled, there
should be no need to have any mutex variables.



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

* Re: Problem with portable dumper
  2020-02-16 15:24             ` Eli Zaretskii
@ 2020-02-16 16:56               ` Michael Albinus
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Albinus @ 2020-02-16 16:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: monnier, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

> Btw, on a more general note: I presume that your code has a way to
> disable threading in file I/O.  (If it doesn't, it should IMO, for
> debugging purposes and also for situations where threading cannot be
> allowed for some other reasons.)  Then you could simply arrange for
> threading to be disabled during dumping, and enable it in startup.el
> when Emacs starts normally.  And when threading is disabled, there
> should be no need to have any mutex variables.

For the time being, I haven't given disabling threading much
attention. There is just an additional optional argument ASYNC for the
find-file-* functions and friends.

But yes, when it will be ready for merge into master, it must be
possible to disable this in general. Debugging is one example, an Emacs
configured --without-threads another one.

Best regards, Michael.



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

end of thread, other threads:[~2020-02-16 16:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-15 18:45 Problem with portable dumper Michael Albinus
2020-02-15 19:20 ` Eli Zaretskii
2020-02-15 20:33   ` Michael Albinus
2020-02-15 20:42     ` Stefan Monnier
2020-02-15 20:58       ` Michael Albinus
2020-02-15 21:03         ` Stefan Monnier
2020-02-16  3:28         ` Eli Zaretskii
2020-02-16 10:19           ` Michael Albinus
2020-02-16 15:24             ` Eli Zaretskii
2020-02-16 16:56               ` Michael Albinus

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).