help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dynamic reload of dynamic module not dynamic?


From: Emanuel Berg
Subject: Re: dynamic reload of dynamic module not dynamic?
Date: Tue, 19 Apr 2022 13:08:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

tomas wrote:

> This is not completely trivial. Parts of the application may
> have become dependent on the loaded library. [...]

I don't see how that is any different from eval'ing a Lisp
function, if something else uses it and the new version don't
do what the old did it sure won't happen (or fail, if you
change the interface which you should always change with care
anyway). Or introduce another bug. But how would it else be,
dynamic update of code which only works when the updates
makes sense?

> Just imagine your application storing a pointer to some
> function in that DL. You remove it, the address space
> becomes free and is replaced by something totally different.
> The above code calls into this pointer and... kaboom.
> You literally pulled the rug from under your poor
> application :-)

What we are imagining is rather a change that made sense so
the poor application can have its own rags to riches story ...

> Now you would say you wouldn't ever hoard pointers to random
> library functions, but that's exactly what the dynamic
> loader is doing for you.

You mean like this?

  https://dataswamp.org/~incal/emacs-init/random-urandom/random-urandom.c

> Not saying it's impossible, but that it's trickier than it
> seems. Most of the time you'll have to live with several
> incarnations of "some functions" because your "old function"
> refuses to die. Most applications choose to restart.

Tricky but maybe it can be made simple, look

  1. a uses b, what happens is b
  2. b is edited (let's call it b' just to denote the change)
  3. a uses b, what happens is b'

?

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]