BUG: fatal interaction between application:ensure_all_started(A) and permit(B, false)

Ulf Wiger ulf@REDACTED
Fri Mar 26 20:14:28 CET 2021


Ah, so yet another bug! :)

I guess this how you know that a feature hasn't really been used much.

BR,
Ulf W

Den fre 26 mars 2021 17:06Martin Björklund <mbj@REDACTED> skrev:

> Ulf Wiger <ulf@REDACTED> wrote:
> > Permissions are a bit tricky. :)
>
> Indeed.  This discussion prompted me to use permissions for a use case
> of my own, but the system behaved really strange.  Eventually I found
> the problem.  Have a look at this:
>
> Eshell V11.1.4  (abort with ^G)
> 1> application:load(sasl).
> ok
> 2> application:permit(sasl, false).
> ok
> 3> application:start(sasl).
> ok
> 4> application:permit(sasl, true).
> ok
> 5> application:which_applications().
> [{sasl,"SASL  CXC 138 11","4.0.1"},
>  {stdlib,"ERTS  CXC 138 10","3.14"},
>  {kernel,"ERTS  CXC 138 10","7.2"}]
>
>
> This is fine and as expected.  But now let's throw in an additional
> permit false:
>
>
> Eshell V11.1.4  (abort with ^G)
> 1> application:load(sasl).
> ok
> 2> application:permit(sasl, false).
> ok
> 3> application:start(sasl).
> ok
> 4> application:permit(sasl, false).       % <-- HERE
> ok
> 5> application:permit(sasl, true).
> ok
> 6> application:which_applications().
> [{stdlib,"ERTS  CXC 138 10","3.14"},
>  {kernel,"ERTS  CXC 138 10","7.2"}]
>
>
> Now sasl isn't started!
>
> It turns out that the second permit false will remove the
> application from the start_p_false list in application_controller.erl:
>
>     %% start requested but not started because permit was false
>     {false, {true, _Appl}, false, {value, _Tuple}, false, false} ->
>        update_permissions(AppName, Bool),
>        SS = S#state{start_p_false = keydelete(AppName, 1, SPF)},
>        {reply, ok, SS};
>
> This doesn't seem right.  I think this should be a noop.
>
>
> /martin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20210326/0f8b7faf/attachment.htm>


More information about the erlang-questions mailing list