ソースを参照

Prevent hard crash on duplicate plugin paths

When a global plugin is used both locally and within the project, there
are cases when the rebar3 program will hard crash (killed in do_boot).
This has been traced to plugin-handling in compilation, where the same
code path may be purged twice in a row without further reloading for the
compile operation.

This of course yields the result where the code handling on the VM kills
all processes holding references to the module in memory, in this case
the rebar3 process itself.

By deduplicating the paths first, we ensure at most one purge before
reloading plugins and paths, and this prevents a hard crash.
pull/1650/head
Fred Hebert 7年前
コミット
e57c8b7427
2個のファイルの変更2行の追加1行の削除
  1. +1
    -0
      src/rebar_core.erl
  2. +1
    -1
      src/rebar_utils.erl

+ 1
- 0
src/rebar_core.erl ファイルの表示

@ -136,6 +136,7 @@ process_command(State, Command) ->
do([], State) ->
{ok, State};
do([ProviderName | Rest], State) ->
?DEBUG("Provider: ~p", [ProviderName]),
%% Special providers like 'as', 'do' or some hooks may be passed
%% as a tuple {Namespace, Name}, otherwise not. Handle them
%% on a per-need basis.

+ 1
- 1
src/rebar_utils.erl ファイルの表示

@ -766,7 +766,7 @@ remove_from_code_path(Paths) ->
[begin code:purge(M), code:delete(M) end || M <- Modules]
end,
code:del_path(Path)
end, Paths).
end, lists:usort(Paths)).
%% @doc Revert to only having the beams necessary for running rebar3 and
%% plugins in the path

読み込み中…
キャンセル
保存