Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash while running rebar3 hex cut #316

Closed
saleyn opened this issue Jan 25, 2023 · 6 comments
Closed

Crash while running rebar3 hex cut #316

saleyn opened this issue Jan 25, 2023 · 6 comments

Comments

@saleyn
Copy link
Contributor

saleyn commented Jan 25, 2023

Description

When running rebar3 hex cut in the source of the erlcron repository, I get a rebar3.crashdump.

Error: function_clause
[{rebar3_hex_cut,cut,
  [{state_t,"/home/serge/projects/erl-libs/erlcron",
    {dict,28,16,16,8,80,48,
     {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
     {{[],
       [[{deps,default}],
  ...
    0,undefined,"/home/serge/projects/erl-libs/erlcron",
    "/home/serge/projects/erl-libs/erlcron/_build/default/lib/erlcron",
    "/home/serge/projects/erl-libs/erlcron/_build/default/lib/erlcron/ebin",
    undefined,false,false,false,undefined,false},
   #{task => undefined}],
  [{file,
    "/home/serge/projects/erl-libs/erlcron/_build/default/plugins/rebar3_hex/src/rebar3_hex_cut.erl"},
   {line,141}]},
 {lists,foreach_1,2,[{file,"lists.erl"},{line,1442}]},
 {rebar3_hex_cut,handle_task,1,
  [{file,
    "/home/serge/projects/erl-libs/erlcron/_build/default/plugins/rebar3_hex/src/rebar3_hex_cut.erl"},
   {line,122}]},
 {rebar_core,do,2,
  [{file,"/home/serge/projects/erl-libs/rebar3/apps/rebar/src/rebar_core.erl"},
   {line,155}]},
 {rebar_prv_do,do_task,5,
  [{file,
    "/home/serge/projects/erl-libs/rebar3/apps/rebar/src/rebar_prv_do.erl"},
   {line,87}]},
 {rebar_core,do,2,
  [{file,"/home/serge/projects/erl-libs/rebar3/apps/rebar/src/rebar_core.erl"},
   {line,155}]},
 {rebar3,run_aux,2,
  [{file,"/home/serge/projects/erl-libs/rebar3/apps/rebar/src/rebar3.erl"},
   {line,193}]},
 {rebar3,main,1,
  [{file,"/home/serge/projects/erl-libs/rebar3/apps/rebar/src/rebar3.erl"},
   {line,66}]}]

Here's the rebar.config:

$ cat rebar.config 
%% -*- mode: Erlang; fill-column: 80; comment-column: 75; -*-
%% Dependencies ================================================================
{deps, []}.

%% Rebar Plugins ===============================================================
{plugins, [rebar3_hex, rebar3_ex_doc]}.

%% Compiler Options ============================================================
{erl_opts, [debug_info, warnings_as_errors]}.

%% Doc provider  ===============================================================
{ex_doc, [
   {source_url, <<"https://github.com/erlware/erlcron">>},
   {extras, [<<"README.md">>, <<"LICENSE">>]},
   {main, <<"readme">>}
]}.

{hex, [{doc, ex_doc}]}.

%% EUnit =======================================================================
{eunit_opts, [%verbose,
              %{report, {eunit_surefire, [{dir, "."}]}}]}.
             no_tty]}.

{cover_enabled, true}.
{cover_print_enabled, true}.

Environment

$ rebar3 report "hex cut"
Rebar3 report
 version 3.20.0
 generated at 2023-01-24T16:53:39+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task: hex
Entered as:
  hex cut
-----------------
Operating System: x86_64-pc-linux-gnu
ERTS: Erlang/OTP 25 [erts-13.0.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
Root Directory: /opt/sw/erlang/v25.0.4/lib/erlang
Library directory: /opt/sw/erlang/v25.0.4/lib/erlang/lib
-----------------
Loaded Applications:
bbmustache: 1.12.2
certifi: 2.10.0
cf: 0.3.1
common_test: 1.23
compiler: 8.2
crypto: 5.1.1
cth_readable: 1.5.1
dialyzer: 5.0.1
edoc: 1.2
erlware_commons: 1.5.0
eunit: 2.7.1
eunit_formatters: 0.5.0
getopt: 1.0.1
inets: 8.0
kernel: 8.4.2
providers: 1.9.0
public_key: 1.13
relx: 4.7.0
sasl: 4.2
snmp: 5.13
ssl_verify_fun: 1.1.6
stdlib: 4.0.1
syntax_tools: 3.0
tools: 3.5.3

-----------------
Escript path: /opt/bin/rebar3
Providers:
  app_discovery as build clean compile compile cover ct cut deps dialyzer do docs edoc escriptize eunit ex_doc get-deps help install install_deps key list lock new organization owner path pkgs publish release relup repo report repos retire revert search shell state tar tree unlock update upgrade upgrade upgrade user vendor version xref
@saleyn
Copy link
Contributor Author

saleyn commented Jan 25, 2023

I seem to be able to bypass the crash by passing the -i patch option to hex cut, but as I understand it, the -i option is documented as optional, so I don't expect to see a crash if the option is not given.

saleyn added a commit to saleyn/rebar3_hex that referenced this issue Jan 25, 2023
@starbelly
Copy link
Member

Closed via #317

@starbelly starbelly reopened this Jan 28, 2023
@starbelly
Copy link
Member

I closed this an error. It seems you have pointed out there still might seem to be a place to crash. I'll look further in a bit.

@starbelly
Copy link
Member

Hey @saleyn , I can't seem to replicate this (I cloned erlcron repo and ran cut), but I did find a bug if you choose other as the version type to go with when incrementing. Maybe you went down that path? Doesn't seem like it per your issue (i.e., you just ran cut and it blew up).

@saleyn
Copy link
Contributor Author

saleyn commented Jan 31, 2023

Presently I cannot reproduce it either. Maybe it's because my fix to rebar3_hex was merged or some other change was made to the head of the repo?

@saleyn saleyn closed this as completed Jan 31, 2023
@starbelly
Copy link
Member

Presently I cannot reproduce it either. Maybe it's because my fix to rebar3_hex was merged or some other change was made to the head of the repo?

That's possible. It's also possible you were on an older version of rebar3_hex at the time. I'm glad it's all resolved, at least for now! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants