elixir-lang / elixir

Elixir is a dynamic, functional language for building scalable and maintainable applications
https://elixir-lang.org/
Apache License 2.0
24.3k stars 3.35k forks source link

Argument error to erl_anno.set #6015

Closed KronicDeth closed 7 years ago

KronicDeth commented 7 years ago

I know there are some pre-existing issues related to erl_anno, generated and line -1, but the pre-existing steps of deleting _build and updating all dependencies is not working for https://github.com/C-S-D/retort.

Environment

Current behavior

  1. git clone git@github.com:C-S-D/retort.git
  2. cd retort
  3. git checkout elixir-lang-elixir-6015
  4. mix deps.get
  5. mix coveralls

Stacktrace

``` 10:14:28.364 [error] Process #PID<0.6238.0> raised an exception ** (ArgumentError) argument error (stdlib) erl_anno.erl:318: :erl_anno.set(:location, -1, [location: -1, generated: true]) (stdlib) erl_parse.yrl:1516: anonymous fn/3 in :erl_parse.map_anno/2 (stdlib) erl_parse.yrl:1649: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1641: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1652: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3 ** (exit) an exception was raised: ** (ArgumentError) argument error (stdlib) erl_anno.erl:318: :erl_anno.set(:location, -1, [location: -1, generated: true]) (stdlib) erl_parse.yrl:1516: anonymous fn/3 in :erl_parse.map_anno/2 (stdlib) erl_parse.yrl:1649: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1641: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1652: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3 cover.erl:583: :cover.call/1 lib/excoveralls.ex:30: ExCoveralls.start/2 (mix) lib/mix/tasks/test.ex:206: Mix.Tasks.Test.run/1 (mix) lib/mix/task.ex:294: Mix.Task.run_task/3 (mix) lib/mix/task.ex:326: Mix.Task.run_alias/3 (mix) lib/mix/task.ex:259: Mix.Task.run/2 lib/mix/tasks.ex:54: Mix.Tasks.Coveralls.do_run/2 (mix) lib/mix/task.ex:294: Mix.Task.run_task/3 10:14:28.365 [error] Process #PID<0.6233.0> raised an exception ** (ArgumentError) argument error (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Poison.Encoder.Retort.Request, :__info__, 1, 2, 0}, 0}) cover.erl:1789: :cover.munge_body/4 cover.erl:1740: :cover.munge_clauses/4 cover.erl:1719: :cover.munge/4 cover.erl:1635: :cover.transform_2/5 cover.erl:1620: :cover.transform/3 cover.erl:1568: :cover.do_compile_beam2/5 cover.erl:1478: :cover.do_compile_beam/3 10:14:28.366 [error] Process #PID<0.6235.0> raised an exception ** (ArgumentError) argument error (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Retort.Case, :__info__, 1, 1, 0}, 0}) cover.erl:1789: :cover.munge_body/4 cover.erl:1740: :cover.munge_clauses/4 cover.erl:1719: :cover.munge/4 cover.erl:1635: :cover.transform_2/5 cover.erl:1620: :cover.transform/3 cover.erl:1568: :cover.do_compile_beam2/5 cover.erl:1478: :cover.do_compile_beam/3 10:14:28.366 [error] Process #PID<0.6243.0> raised an exception ** (ArgumentError) argument error (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Retort.Server.Generic.Logger, :__info__, 1, 1, 0}, 0}) cover.erl:1789: :cover.munge_body/4 cover.erl:1740: :cover.munge_clauses/4 cover.erl:1719: :cover.munge/4 cover.erl:1635: :cover.transform_2/5 cover.erl:1620: :cover.transform/3 cover.erl:1568: :cover.do_compile_beam2/5 cover.erl:1478: :cover.do_compile_beam/3 10:14:28.366 [error] Process #PID<0.6244.0> raised an exception ** (ArgumentError) argument error (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Retort.Server.Pool, :__info__, 1, 1, 0}, 0}) cover.erl:1789: :cover.munge_body/4 cover.erl:1740: :cover.munge_clauses/4 cover.erl:1719: :cover.munge/4 cover.erl:1635: :cover.transform_2/5 cover.erl:1620: :cover.transform/3 cover.erl:1568: :cover.do_compile_beam2/5 cover.erl:1478: :cover.do_compile_beam/3 10:14:28.367 [error] Process #PID<0.6242.0> raised an exception ** (ArgumentError) argument error (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Retort.Sandbox, :__info__, 1, 1, 0}, 0}) cover.erl:1789: :cover.munge_body/4 cover.erl:1740: :cover.munge_clauses/4 cover.erl:1719: :cover.munge/4 cover.erl:1635: :cover.transform_2/5 cover.erl:1620: :cover.transform/3 cover.erl:1568: :cover.do_compile_beam2/5 cover.erl:1478: :cover.do_compile_beam/3 10:14:28.367 [error] Process #PID<0.6240.0> raised an exception ** (ArgumentError) argument error (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Retort.RemoteTestAuthors, :__info__, 1, 1, 0}, 0}) cover.erl:1789: :cover.munge_body/4 cover.erl:1740: :cover.munge_clauses/4 cover.erl:1719: :cover.munge/4 cover.erl:1635: :cover.transform_2/5 cover.erl:1620: :cover.transform/3 cover.erl:1568: :cover.do_compile_beam2/5 cover.erl:1478: :cover.do_compile_beam/3 10:14:28.368 [error] Process #PID<0.6245.0> raised an exception ** (ArgumentError) argument error (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Retort.TestAuthors, :__info__, 1, 1, 0}, 0}) cover.erl:1789: :cover.munge_body/4 cover.erl:1740: :cover.munge_clauses/4 cover.erl:1719: :cover.munge/4 cover.erl:1635: :cover.transform_2/5 cover.erl:1620: :cover.transform/3 cover.erl:1568: :cover.do_compile_beam2/5 cover.erl:1478: :cover.do_compile_beam/3 10:14:28.368 [error] Process #PID<0.6239.0> raised an exception ** (ArgumentError) argument error (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Retort.Meta, :__info__, 1, 1, 0}, 0}) cover.erl:1789: :cover.munge_body/4 cover.erl:1740: :cover.munge_clauses/4 cover.erl:1719: :cover.munge/4 cover.erl:1635: :cover.transform_2/5 cover.erl:1620: :cover.transform/3 cover.erl:1568: :cover.do_compile_beam2/5 cover.erl:1478: :cover.do_compile_beam/3 10:14:28.368 [error] Process #PID<0.6241.0> raised an exception ** (ArgumentError) argument error (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Retort.Resources, :__info__, 1, 1, 0}, 0}) cover.erl:1789: :cover.munge_body/4 cover.erl:1740: :cover.munge_clauses/4 cover.erl:1719: :cover.munge/4 cover.erl:1635: :cover.transform_2/5 cover.erl:1620: :cover.transform/3 cover.erl:1568: :cover.do_compile_beam2/5 cover.erl:1478: :cover.do_compile_beam/3 10:14:28.369 [error] Process #PID<0.6236.0> raised an exception ** (ArgumentError) argument error (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Retort.Client.Generic, :__info__, 1, 1, 0}, 0}) cover.erl:1789: :cover.munge_body/4 cover.erl:1740: :cover.munge_clauses/4 cover.erl:1719: :cover.munge/4 cover.erl:1635: :cover.transform_2/5 cover.erl:1620: :cover.transform/3 cover.erl:1568: :cover.do_compile_beam2/5 cover.erl:1478: :cover.do_compile_beam/3 10:14:28.369 [error] Process #PID<0.6234.0> raised an exception ** (ArgumentError) argument error (stdlib) :ets.insert(:cover_internal_clause_table, {Retort.AMQP.Default, [{Retort.AMQP.Default, :__info__, 1, 1, 1}, {Retort.AMQP.Default, :__info__, 1, 2, 1}, {Retort.AMQP.Default, :__info__, 1, 3, 1}, {Retort.AMQP.Default, :consume, 2, 1, 1}, {Retort.AMQP.Default, :declare_queue, 2, 1, 1}, {Retort.AMQP.Default, :open, 1, 1, 1}, {Retort.AMQP.Default, :prefetch_count, 2, 1, 1}]}) cover.erl:1584: :cover.do_compile_beam2/5 cover.erl:1478: :cover.do_compile_beam/3 (stdlib) lists.erl:1239: :lists.map/2 cover.erl:2732: anonymous fn/2 in :cover.pmap_spawn/4 10:14:28.370 [error] Process #PID<0.6237.0> raised an exception ** (ArgumentError) argument error (stdlib) :ets.insert(:cover_internal_clause_table, {Retort.Client.Stream, [{Retort.Client.Stream, :__info__, 1, 1, 1}, {Retort.Client.Stream, :__info__, 1, 2, 1}, {Retort.Client.Stream, :__info__, 1, 3, 1}, {Retort.Client.Stream, :__struct__, 0, 1, 1}, {Retort.Client.Stream, :__struct__, 1, 1, 2}, {Retort.Client.Stream, :new, 1, 1, 1}, {Retort.Client.Stream, :new, 2, 1, 1}, {Retort.Client.Stream, :new, 3, 1, 3}, {Retort.Client.Stream, :next, 2, 1, 1}, {Retort.Client.Stream, :next, 2, 2, 1}, {Retort.Client.Stream, :page, 1, 1, 1}, {Retort.Client.Stream, :page, 1, 2, 2}, {Retort.Client.Stream, :page_params, 2, 1, 1}, {Retort.Client.Stream, :page_params, 2, 2, 1}]}) cover.erl:1584: :cover.do_compile_beam2/5 cover.erl:1478: :cover.do_compile_beam/3 (stdlib) lists.erl:1239: :lists.map/2 cover.erl:2732: anonymous fn/2 in :cover.pmap_spawn/4 10:14:28.370 [error] GenServer #PID<0.6189.0> terminating ** (ArgumentError) argument error (stdlib) erl_anno.erl:318: :erl_anno.set(:location, -1, [location: -1, generated: true]) (stdlib) erl_parse.yrl:1516: anonymous fn/3 in :erl_parse.map_anno/2 (stdlib) erl_parse.yrl:1649: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1641: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1652: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3 Last message: {:EXIT, #PID<0.70.0>, {:badarg, [{:erl_anno, :set, [:location, -1, [location: -1, generated: true]], [file: 'erl_anno.erl', line: 318]}, {:erl_parse, :"-map_anno/2-fun-0-", 3, [file: 'erl_parse.yrl', line: 1516]}, {:erl_parse, :modify_anno1, 3, [file: 'erl_parse.yrl', line: 1649]}, {:erl_parse, :modify_anno1, 3, [file: 'erl_parse.yrl', line: 1662]}, {:erl_parse, :modify_anno1, 3, [file: 'erl_parse.yrl', line: 1641]}, {:erl_parse, :modify_anno1, 3, [file: 'erl_parse.yrl', line: 1662]}, {:erl_parse, :modify_anno1, 3, [file: 'erl_parse.yrl', line: 1652]}, {:erl_parse, :modify_anno1, 3, [file: 'erl_parse.yrl', line: 1662]}]}} 10:14:28.371 [error] GenServer #PID<0.6183.0> terminating ** (ArgumentError) argument error (stdlib) erl_anno.erl:318: :erl_anno.set(:location, -1, [location: -1, generated: true]) (stdlib) erl_parse.yrl:1516: anonymous fn/3 in :erl_parse.map_anno/2 (stdlib) erl_parse.yrl:1649: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1641: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1652: :erl_parse.modify_anno1/3 (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3 Last message: {:EXIT, #PID<0.70.0>, {:badarg, [{:erl_anno, :set, [:location, -1, [location: -1, generated: true]], [file: 'erl_anno.erl', line: 318]}, {:erl_parse, :"-map_anno/2-fun-0-", 3, [file: 'erl_parse.yrl', line: 1516]}, {:erl_parse, :modify_anno1, 3, [file: 'erl_parse.yrl', line: 1649]}, {:erl_parse, :modify_anno1, 3, [file: 'erl_parse.yrl', line: 1662]}, {:erl_parse, :modify_anno1, 3, [file: 'erl_parse.yrl', line: 1641]}, {:erl_parse, :modify_anno1, 3, [file: 'erl_parse.yrl', line: 1662]}, {:erl_parse, :modify_anno1, 3, [file: 'erl_parse.yrl', line: 1652]}, {:erl_parse, :modify_anno1, 3, [file: 'erl_parse.yrl', line: 1662]}]}} ```

Expected behavior

Tests are run and coverage information is generated.

Triage information

excoveralls' s mix coveralls works in both the underlying alembic and calcinator packages, so some dependency adding on top of those or some code in retort itself is likely causing this issue.

calcinator deps tree

``` calcinator ├── junit_formatter ~> 1.0 (Hex package) ├── dialyze ~> 0.2.1 (Hex package) ├── excoveralls ~> 0.6.3 (Hex package) │ ├── exjsx ~> 3.0 (Hex package) │ │ └── jsx ~> 2.8.0 (Hex package) │ └── hackney >= 0.12.0 (Hex package) │ ├── certifi 1.0.0 (Hex package) │ ├── idna 4.0.0 (Hex package) │ ├── metrics 1.0.1 (Hex package) │ ├── mimerl 1.0.2 (Hex package) │ └── ssl_verify_fun 1.1.1 (Hex package) ├── ex_doc ~> 0.15.1 (Hex package) │ └── earmark ~> 1.1 (Hex package) ├── credo 0.7.3 (Hex package) │ └── bunt ~> 0.2.0 (Hex package) ├── alembic >= 3.1.1 and < 4.0.0 (Hex package) │ ├── ecto ~> 2.0 (Hex package) │ │ ├── decimal ~> 1.2 (Hex package) │ │ ├── poison ~> 2.2 or ~> 3.0 (Hex package) │ │ └── poolboy ~> 1.5 (Hex package) │ └── poison ~> 1.5 or ~> 2.0 or ~> 3.0 (Hex package) ├── ja_serializer >= 0.11.2 and < 0.13.0 (Hex package) │ ├── inflex ~> 1.4 (Hex package) │ ├── plug > 1.0.0 (Hex package) │ │ └── mime ~> 1.0 (Hex package) │ └── poison >= 1.4.0 (Hex package) ├── phoenix ~> 1.0 (Hex package) │ ├── phoenix_pubsub ~> 1.0 (Hex package) │ ├── plug ~> 1.4 or ~> 1.3.3 or ~> 1.2.4 or ~> 1.1.8 or ~> 1.0.5 (Hex package) │ └── poison ~> 1.5 or ~> 2.0 (Hex package) └── inch_ex ~> 0.5.1 (Hex package) └── poison ~> 1.5 or ~> 2.0 or ~> 3.0 (Hex package) ```

retort deps tree

``` retort ├── faker ~> 0.7.0 (Hex package) ├── connection ~> 1.0 (Hex package) ├── poison ~> 2.0 or ~> 3.0 (Hex package) ├── junit_formatter ~> 1.0 (Hex package) ├── dialyze ~> 0.2.1 (Hex package) ├── excoveralls ~> 0.6.3 (Hex package) │ ├── exjsx ~> 3.0 (Hex package) │ │ └── jsx ~> 2.8.0 (Hex package) │ └── hackney >= 0.12.0 (Hex package) │ ├── certifi 1.0.0 (Hex package) │ ├── idna 4.0.0 (Hex package) │ ├── metrics 1.0.1 (Hex package) │ ├── mimerl 1.0.2 (Hex package) │ └── ssl_verify_fun 1.1.1 (Hex package) ├── timex ~> 3.0 (Hex package) │ ├── combine ~> 0.7 (Hex package) │ ├── gettext ~> 0.10 (Hex package) │ └── tzdata ~> 0.1.8 or ~> 0.5 (Hex package) │ └── hackney ~> 1.0 (Hex package) ├── ex_doc ~> 0.15.1 (Hex package) │ └── earmark ~> 1.1 (Hex package) ├── credo 0.7.3 (Hex package) │ └── bunt ~> 0.2.0 (Hex package) ├── amqp ~> 0.1.4 or ~> 0.2.0 (Hex package) │ ├── amqp_client ~> 3.6.8 (Hex package) │ │ └── rabbit_common 3.6.9 (Hex package) │ └── rabbit_common ~> 3.6.8 (Hex package) ├── uuid ~> 1.1 (Hex package) ├── ja_serializer >= 0.11.0 and < 0.13.0 (Hex package) │ ├── inflex ~> 1.4 (Hex package) │ ├── plug > 1.0.0 (Hex package) │ │ └── mime ~> 1.0 (Hex package) │ └── poison >= 1.4.0 (Hex package) ├── inch_ex ~> 0.5.1 (Hex package) │ └── poison ~> 1.5 or ~> 2.0 or ~> 3.0 (Hex package) ├── postgrex ~> 0.13.0 (Hex package) │ ├── connection ~> 1.0 (Hex package) │ ├── db_connection ~> 1.1 (Hex package) │ │ ├── connection ~> 1.0.2 (Hex package) │ │ └── poolboy ~> 1.5 (Hex package) │ └── decimal ~> 1.0 (Hex package) ├── ecto ~> 2.1 (Hex package) │ ├── db_connection ~> 1.1 (Hex package) │ ├── decimal ~> 1.2 (Hex package) │ ├── poison ~> 2.2 or ~> 3.0 (Hex package) │ ├── poolboy ~> 1.5 (Hex package) │ └── postgrex ~> 0.13.0 (Hex package) ├── alembic >= 3.1.1 and < 4.0.0 (Hex package) │ ├── ecto ~> 2.0 (Hex package) │ └── poison ~> 1.5 or ~> 2.0 or ~> 3.0 (Hex package) ├── calcinator >= 1.5.1 and < 3.0.0 (Hex package) │ ├── alembic >= 3.1.1 and < 4.0.0 (Hex package) │ └── ja_serializer >= 0.11.2 and < 0.13.0 (Hex package) └── ex_machina ~> 2.0 (Hex package) └── ecto ~> 2.1 (Hex package) ```

Deps to Check

The following deps are in retort and not calcinator and need to be checked for incompatibility by adding excoveralls and running mix coveralls to see if they trigger the bug on their own

No dep isolation failed mix coveralls. Moving on to slicing retort itself to try to remove or isolating triggering line in retort and trace that back to a dep or a quote in retort itself.

josevalim commented 7 years ago

Can you please check master? We have pushed many improvements on this area.

josevalim commented 7 years ago

Also, if you are using Elixir, is it precompiled? If so, with which Erlang version? It may be code compiler on 18 running on 19 or vice-versa.

ericmj commented 7 years ago

I can confirm it happens on master.

josevalim commented 7 years ago

Oh, it the error happens only in retort, it is a dependency in retort that is generating lines with -1 metadata. They need to do what Phoenix do: https://github.com/phoenixframework/phoenix_html/blob/master/lib/phoenix_html/engine.ex#L7-L11

Please try to pinpoint which dependency is causing the issue and let us know so we can reopen the issue as we have limited time to prune down the dependency tree ourselves.

KronicDeth commented 7 years ago

@josevalim I've reproduced the error with a minimal repo and it's kinda surprising. It's this line:

assert {:ok, _} = :ok

The right-hand doesn't seem to matter, but there does need to be a match as

assert :ok

Doesn't cause a problem.

Reproduction Steps

  1. git clone git@github.com:KronicDeth/elixir_lang_elixir6015.git
  2. cd elixir_lang_elixir6015
  3. mix deps.get
  4. mix coveralls

Errors

Compiling 1 file (.ex)
Generated elixir_lang_elixir6015 app

12:07:03.370 [error] Process #PID<0.177.0> raised an exception
** (ArgumentError) argument error
    (stdlib) erl_anno.erl:318: :erl_anno.set(:location, -1, [location: -1, generated: true])
    (stdlib) erl_parse.yrl:1516: anonymous fn/3 in :erl_parse.map_anno/2
    (stdlib) erl_parse.yrl:1649: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1641: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1652: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3
** (exit) an exception was raised:
    ** (ArgumentError) argument error
        (stdlib) erl_anno.erl:318: :erl_anno.set(:location, -1, [location: -1, generated: true])
        (stdlib) erl_parse.yrl:1516: anonymous fn/3 in :erl_parse.map_anno/2
        (stdlib) erl_parse.yrl:1649: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1641: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1652: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1662: :erl_parse.modify_anno1/3
    cover.erl:583: :cover.call/1
    lib/excoveralls.ex:30: ExCoveralls.start/2
    (mix) lib/mix/tasks/test.ex:206: Mix.Tasks.Test.run/1
    (mix) lib/mix/task.ex:294: Mix.Task.run_task/3
    lib/mix/tasks.ex:54: Mix.Tasks.Coveralls.do_run/2
    (mix) lib/mix/task.ex:294: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2

Original Code

The original line in retort where that assert comes from

assert {:ok, _} = Connection.await

-- https://github.com/C-S-D/retort/blob/559bfa4575d183a94f05f9b71b70562196c52c79/lib/retort/connection_case.ex#L59

josevalim commented 7 years ago

Thank you @KronicDeth, you are awesome for providing such detailed steps!

josevalim commented 7 years ago

Hi @KronicDeth, I can't reproduce it on master.

This is what I have done:

  1. git clone git@github.com:KronicDeth/elixir_lang_elixir6015.git
  2. cd elixir_lang_elixir6015
  3. mix deps.get
  4. touch test/foo_test.exs
  5. mix coveralls

Everything works just fine, as I suspected, because all of those bugs have been fixed in master.

@ericmj when you said you were able to reproduce it on master, which commit were you using?

KronicDeth commented 7 years ago

@josevalim I think there's more than one error in retort and I just isolated one that master happened to have fixed. I updated elixir-lang/elixir to latest master and ran mix coveralls and I still get errors, just different errors:

Environment

elixir --version:

Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Elixir 1.5.0-dev (e9292c37b)

mix coveralls output

The database for Retort.Repo has been dropped
19:07:00.042 [error] Process #PID<0.254.0> raised an exception
** (ArgumentError) argument error
    (stdlib) erl_anno.erl:318: :erl_anno.set(:location, -584, [generated: true, location: 11])
    (stdlib) erl_parse.yrl:1516: anonymous fn/3 in :erl_parse.map_anno/2
    (stdlib) erl_parse.yrl:1649: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1517: :erl_parse.map_anno/2
    (stdlib) epp.erl:1698: :epp.interpret_file_attr/3
    (stdlib) epp.erl:1699: :epp.interpret_file_attr/3
    (stdlib) epp.erl:1690: :epp.interpret_file_attr/3
    (stdlib) epp.erl:1699: :epp.interpret_file_attr/3
** (exit) an exception was raised:
    ** (ArgumentError) argument error
        (stdlib) erl_anno.erl:318: :erl_anno.set(:location, -584, [generated: true, location: 11])
        (stdlib) erl_parse.yrl:1516: anonymous fn/3 in :erl_parse.map_anno/2
        (stdlib) erl_parse.yrl:1649: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1517: :erl_parse.map_anno/2
        (stdlib) epp.erl:1698: :epp.interpret_file_attr/3
        (stdlib) epp.erl:1699: :epp.interpret_file_attr/3
        (stdlib) epp.erl:1690: :epp.interpret_file_attr/3
        (stdlib) epp.erl:1699: :epp.interpret_file_attr/3
    cover.erl:583: :cover.call/1
    lib/excoveralls.ex:30: ExCoveralls.start/2
    (mix) lib/mix/tasks/test.ex:206: Mix.Tasks.Test.run/1
    (mix) lib/mix/task.ex:301: Mix.Task.run_task/3
    (mix) lib/mix/task.ex:333: Mix.Task.run_alias/3
    (mix) lib/mix/task.ex:266: Mix.Task.run/2
    lib/mix/tasks.ex:54: Mix.Tasks.Coveralls.do_run/2
    (mix) lib/mix/task.ex:301: Mix.Task.run_task/3

19:07:00.047 [error] Process #PID<0.259.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Retort.Resources, :"MACRO-__using__", 2, 1, 0}, 0})
    cover.erl:1789: :cover.munge_body/4
    cover.erl:1740: :cover.munge_clauses/4
    cover.erl:1719: :cover.munge/4
    cover.erl:1635: :cover.transform_2/5
    cover.erl:1620: :cover.transform/3
    cover.erl:1568: :cover.do_compile_beam2/5
    cover.erl:1478: :cover.do_compile_beam/3
19:07:00.047 [error] Process #PID<0.262.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_clause_table, {Retort.Server.Pool, [{Retort.Server.Pool, :__info__, 1, 1, 1}, {Retort.Server.Pool, :__info__, 1, 2, 1}, {Retort.Server.Pool, :__info__, 1, 3, 1}, {Retort.Server.Pool, :init, 1, 1, 2}, {Retort.Server.Pool, :start_link, 1, 1, 1}, {Retort.Server.Pool, :start_link, 2, 1, 1}]})
    cover.erl:1584: :cover.do_compile_beam2/5
    cover.erl:1478: :cover.do_compile_beam/3
    (stdlib) lists.erl:1239: :lists.map/2
    cover.erl:2732: anonymous fn/2 in :cover.pmap_spawn/4
19:07:00.048 [error] Process #PID<0.260.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_clause_table, {Retort.Sandbox, [{Retort.Sandbox, :__info__, 1, 1, 1}, {Retort.Sandbox, :__info__, 1, 2, 1}, {Retort.Sandbox, :__info__, 1, 3, 1}, {Retort.Sandbox, :allow_access, 1, 1, 1}, {Retort.Sandbox, :allow_access, 2, 1, 1}, {Retort.Sandbox, :version1_token, 1, 1, 1}]})
    cover.erl:1584: :cover.do_compile_beam2/5
    cover.erl:1478: :cover.do_compile_beam/3
    (stdlib) lists.erl:1239: :lists.map/2
    cover.erl:2732: anonymous fn/2 in :cover.pmap_spawn/4
19:07:00.048 [error] Process #PID<0.261.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_clause_table, {Retort.Server.Generic.Logger, [{Retort.Server.Generic.Logger, :__info__, 1, 1, 1}, {Retort.Server.Generic.Logger, :__info__, 1, 2, 1}, {Retort.Server.Generic.Logger, :__info__, 1, 3, 1}, {Retort.Server.Generic.Logger, :call, 1, 1, 4}, {Retort.Server.Generic.Logger, :formatted_diff, 1, 1, 1}, {Retort.Server.Generic.Logger, :formatted_diff, 1, 2, 1}, {Retort.Server.Generic.Logger, :time_diff, 2, 1, 2}]})
    cover.erl:1584: :cover.do_compile_beam2/5
    cover.erl:1478: :cover.do_compile_beam/3
    (stdlib) lists.erl:1239: :lists.map/2
    cover.erl:2732: anonymous fn/2 in :cover.pmap_spawn/4
19:07:00.048 [error] Process #PID<0.253.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_clause_table, {Retort.Case, [{Retort.Case, :__info__, 1, 1, 1}, {Retort.Case, :__info__, 1, 2, 1}, {Retort.Case, :__info__, 1, 3, 1}, {Retort.Case, :create_list!, 3, 1, 2}, {Retort.Case, :stringify_keys, 1, 1, 10}, {Retort.Case, :unknown_relationship_path_document, 0, 1, 1}]})
    cover.erl:1584: :cover.do_compile_beam2/5
    cover.erl:1478: :cover.do_compile_beam/3
    (stdlib) lists.erl:1239: :lists.map/2
    cover.erl:2732: anonymous fn/2 in :cover.pmap_spawn/4
19:07:00.049 [error] Process #PID<0.257.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_clause_table, {Retort.Meta, [{Retort.Meta, :__info__, 1, 1, 1}, {Retort.Meta, :__info__, 1, 2, 1}, {Retort.Meta, :__info__, 1, 3, 1}, {Retort.Meta, :database_backed?, 1, 1, 1}, {Retort.Meta, :valid!, 2, 1, 1}, {Retort.Meta, :valid!, 3, 1, 1}, {Retort.Meta, :valid!, 3, 2, 1}, {Retort.Meta, :valid!, 3, 3, 4}, {Retort.Meta, :valid!, 3, 4, 1}, {Retort.Meta, :valid!, 3, 5, 1}]})
    cover.erl:1584: :cover.do_compile_beam2/5
    cover.erl:1478: :cover.do_compile_beam/3
    (stdlib) lists.erl:1239: :lists.map/2
    cover.erl:2732: anonymous fn/2 in :cover.pmap_spawn/4
19:07:00.049 [error] Process #PID<0.255.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_clause_table, {Retort.Client.Stream, [{Retort.Client.Stream, :__info__, 1, 1, 1}, {Retort.Client.Stream, :__info__, 1, 2, 1}, {Retort.Client.Stream, :__info__, 1, 3, 1}, {Retort.Client.Stream, :__struct__, 0, 1, 1}, {Retort.Client.Stream, :__struct__, 1, 1, 2}, {Retort.Client.Stream, :new, 1, 1, 1}, {Retort.Client.Stream, :new, 2, 1, 1}, {Retort.Client.Stream, :new, 3, 1, 3}, {Retort.Client.Stream, :next, 2, 1, 1}, {Retort.Client.Stream, :next, 2, 2, 1}, {Retort.Client.Stream, :page, 1, 1, 1}, {Retort.Client.Stream, :page, 1, 2, 2}, {Retort.Client.Stream, :page_params, 2, 1, 1}, {Retort.Client.Stream, :page_params, 2, 2, 1}]})
    cover.erl:1584: :cover.do_compile_beam2/5
    cover.erl:1478: :cover.do_compile_beam/3
    (stdlib) lists.erl:1239: :lists.map/2
    cover.erl:2732: anonymous fn/2 in :cover.pmap_spawn/4
19:07:00.050 [error] Process #PID<0.251.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_clause_table, {Poison.Encoder.Retort.Request, [{Poison.Encoder.Retort.Request, :__info__, 1, 1, 1}, {Poison.Encoder.Retort.Request, :__info__, 1, 2, 1}, {Poison.Encoder.Retort.Request, :__info__, 1, 3, 1}, {Poison.Encoder.Retort.Request, :__impl__, 1, 1, 1}, {Poison.Encoder.Retort.Request, :__impl__, 1, 2, 1}, {Poison.Encoder.Retort.Request, :__impl__, 1, 3, 1}, {Poison.Encoder.Retort.Request, :encode, 2, 1, 1}]})
    cover.erl:1584: :cover.do_compile_beam2/5
    cover.erl:1478: :cover.do_compile_beam/3
    (stdlib) lists.erl:1239: :lists.map/2
    cover.erl:2732: anonymous fn/2 in :cover.pmap_spawn/4
19:07:00.050 [error] Process #PID<0.252.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_clause_table, {Retort.AMQP.Default, [{Retort.AMQP.Default, :__info__, 1, 1, 1}, {Retort.AMQP.Default, :__info__, 1, 2, 1}, {Retort.AMQP.Default, :__info__, 1, 3, 1}, {Retort.AMQP.Default, :consume, 2, 1, 1}, {Retort.AMQP.Default, :declare_queue, 2, 1, 1}, {Retort.AMQP.Default, :open, 1, 1, 1}, {Retort.AMQP.Default, :prefetch_count, 2, 1, 1}]})
    cover.erl:1584: :cover.do_compile_beam2/5
    cover.erl:1478: :cover.do_compile_beam/3
    (stdlib) lists.erl:1239: :lists.map/2
    cover.erl:2732: anonymous fn/2 in :cover.pmap_spawn/4
19:07:00.051 [error] Process #PID<0.263.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_clause_table, {Retort.TestAuthors, [{Retort.TestAuthors, :__info__, 1, 1, 1}, {Retort.TestAuthors, :__info__, 1, 2, 1}, {Retort.TestAuthors, :__info__, 1, 3, 1}, {Retort.TestAuthors, :allow_sandbox_access, 1, 1, 1}, {Retort.TestAuthors, :changeset, 1, 1, 1}, {Retort.TestAuthors, :changeset, 2, 1, 1}, {Retort.TestAuthors, :delete, 1, 1, 1}, {Retort.TestAuthors, :ecto_schema_module, 0, 1, 1}, {Retort.TestAuthors, :full_associations, 1, 1, 1}, {Retort.TestAuthors, :get, 2, 1, 1}, {Retort.TestAuthors, :insert, 2, 1, 1}, {Retort.TestAuthors, :list, 1, 1, 1}, {Retort.TestAuthors, :repo, 0, 1, 1}, {Retort.TestAuthors, :sandboxed?, 0, 1, 1}, {Retort.TestAuthors, :update, 2, 1, 1}, {Retort.TestAuthors, :update, 3, 1, 1}]})
    cover.erl:1584: :cover.do_compile_beam2/5
    cover.erl:1478: :cover.do_compile_beam/3
    (stdlib) lists.erl:1239: :lists.map/2
    cover.erl:2732: anonymous fn/2 in :cover.pmap_spawn/4
19:07:00.052 [error] Process #PID<0.258.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_clause_table, {Retort.RemoteTestAuthors, [{Retort.RemoteTestAuthors, :__info__, 1, 1, 1}, {Retort.RemoteTestAuthors, :__info__, 1, 2, 1}, {Retort.RemoteTestAuthors, :__info__, 1, 3, 1}, {Retort.RemoteTestAuthors, :allow_sandbox_access, 1, 1, 1}, {Retort.RemoteTestAuthors, :association_to_include, 1, 1, 1}, {Retort.RemoteTestAuthors, :changeset, 1, 1, 1}, {Retort.RemoteTestAuthors, :changeset, 2, 1, 1}, {Retort.RemoteTestAuthors, :client_start_link, 0, 1, 1}, {Retort.RemoteTestAuthors, :delete, 1, 1, 1}, {Retort.RemoteTestAuthors, :ecto_schema_module, 0, 1, 1}, {Retort.RemoteTestAuthors, :full_associations, 1, 1, 1}, {Retort.RemoteTestAuthors, :get, 2, 1, 1}, {Retort.RemoteTestAuthors, :insert, 2, 1, 1}, {Retort.RemoteTestAuthors, :list, 1, 1, 1}, {Retort.RemoteTestAuthors, :sandboxed?, 0, 1, 1}, {Retort.RemoteTestAuthors, :timeout, 1, 1, 1}, {Retort.RemoteTestAuthors, :update, 2, 1, 1}, {Retort.RemoteTestAuthors, :update, 3, 1, 1}]})
    cover.erl:1584: :cover.do_compile_beam2/5
    cover.erl:1478: :cover.do_compile_beam/3
    (stdlib) lists.erl:1239: :lists.map/2
    cover.erl:2732: anonymous fn/2 in :cover.pmap_spawn/4
19:07:00.052 [error] Process #PID<0.256.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_clause_table, {Retort.ConnectionCase, [{Retort.ConnectionCase, :__info__, 1, 1, 1}, {Retort.ConnectionCase, :__info__, 1, 2, 1}, {Retort.ConnectionCase, :__info__, 1, 3, 1}, {Retort.ConnectionCase, :__ex_unit__, 2, 1, 1}, {Retort.ConnectionCase, :__ex_unit__, 2, 2, 1}, {Retort.ConnectionCase, :__ex_unit_setup_0, 1, 1, 4}, {Retort.ConnectionCase, :"MACRO-__using__", 2, 1, 1}, {Retort.ConnectionCase, :capture_reconnect_log, 0, 1, 13}, {Retort.ConnectionCase, :log_queue_error_count, 2, 1, 4}, {Retort.ConnectionCase, :override_connection_timeout, 1, 1, 5}, {Retort.ConnectionCase, :override_url, 1, 1, 5}]})
    cover.erl:1584: :cover.do_compile_beam2/5
    cover.erl:1478: :cover.do_compile_beam/3
    (stdlib) lists.erl:1239: :lists.map/2
    cover.erl:2732: anonymous fn/2 in :cover.pmap_spawn/4
19:07:00.053 [error] GenServer #PID<0.207.0> terminating
** (ArgumentError) argument error
    (stdlib) erl_anno.erl:318: :erl_anno.set(:location, -584, [generated: true, location: 11])
    (stdlib) erl_parse.yrl:1516: anonymous fn/3 in :erl_parse.map_anno/2
    (stdlib) erl_parse.yrl:1649: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1517: :erl_parse.map_anno/2
    (stdlib) epp.erl:1698: :epp.interpret_file_attr/3
    (stdlib) epp.erl:1699: :epp.interpret_file_attr/3
    (stdlib) epp.erl:1690: :epp.interpret_file_attr/3
    (stdlib) epp.erl:1699: :epp.interpret_file_attr/3
Last message: {:EXIT, #PID<0.70.0>, {:badarg, [{:erl_anno, :set, [:location, -584, [generated: true, location: 11]], [file: 'erl_anno.erl', line: 318]}, {:erl_parse, :"-map_anno/2-fun-0-", 3, [file: 'erl_parse.yrl', line: 1516]}, {:erl_parse, :modify_anno1, 3, [file: 'erl_parse.yrl', line: 1649]}, {:erl_parse, :map_anno, 2, [file: 'erl_parse.yrl', line: 1517]}, {:epp, :interpret_file_attr, 3, [file: 'epp.erl', line: 1698]}, {:epp, :interpret_file_attr, 3, [file: 'epp.erl', line: 1699]}, {:epp, :interpret_file_attr, 3, [file: 'epp.erl', line: 1690]}, {:epp, :interpret_file_attr, 3, [file: 'epp.erl', line: 1699]}]}}

I'll attempt to make another root cause repo, but now we know that all the ArgumentErrors aren't actually linked as I originally thought. The new first error is this:

erl_anno.set(:location, -584, [generated: true, location: 11])

Annotated stacktrace

  1. erl_anno.erl:318:
    set(Item, Value, Anno) ->
     case {is_settable(Item, Value), Anno} of
          {true, Line} when ?ALINE(Line) ->
              set_anno(Item, Value, [{location, Line}]);
          {true, {L, C}=Location} when ?ALINE(L), ?ACOLUMN(C) ->
              set_anno(Item, Value, [{location, Location}]);
          {true, A} when is_list(A), A =/= [] ->
              set_anno(Item, Value, Anno);
          _ ->
              erlang:error(badarg, [Item, Value, Anno])
      end.

    -- https://github.com/erlang/otp/blob/OTP-19.3/lib/stdlib/src/erl_anno.erl#L309-L319

  2. erl_parse.yrl:1516:
    map_anno(F0, Abstr) ->
      F = fun(A, Acc) -> {F0(A), Acc} end,
      {NewAbstr, []} = modify_anno1(Abstr, [], F),
      NewAbstr.

    -- https://github.com/erlang/otp/blob/OTP-19.3/lib/stdlib/src/erl_parse.yrl#L1515-L1518

  3. erl_parse.yrl:1649:
    modify_anno1({Tag,A,E1,E2,E3}, Ac, Mf) ->
       {A1,Ac1} = Mf(A, Ac),
       {E11,Ac2} = modify_anno1(E1, Ac1, Mf),
       {E21,Ac3} = modify_anno1(E2, Ac2, Mf),
       {E31,Ac4} = modify_anno1(E3, Ac3, Mf),
       {{Tag,A1,E11,E21,E31},Ac4};

    -- https://github.com/erlang/otp/blob/OTP-19.3/lib/stdlib/src/erl_parse.yrl#L1648-L1653

  4. erl_parse.yrl:1517:
    map_anno(F0, Abstr) ->
      F = fun(A, Acc) -> {F0(A), Acc} end,
      {NewAbstr, []} = modify_anno1(Abstr, [], F),
      NewAbstr.

    -- https://github.com/erlang/otp/blob/OTP-19.3/lib/stdlib/src/erl_parse.yrl#L1515-L1518

  5. epp.erl:1698:
    interpret_file_attr([Form0 | Forms], Delta, Fs) ->
       F = fun(Anno) ->
                   Line = erl_anno:line(Anno),
                   erl_anno:set_line(Line + Delta, Anno)
           end,
       Form = erl_parse:map_anno(F, Form0),
       [Form | interpret_file_attr(Forms, Delta, Fs)];

    --- https://github.com/erlang/otp/blob/OTP-19.3/lib/stdlib/src/epp.erl#L1693-L1699

  6. epp.erl:1699:
    interpret_file_attr([Form0 | Forms], Delta, Fs) ->
       F = fun(Anno) ->
                   Line = erl_anno:line(Anno),
                   erl_anno:set_line(Line + Delta, Anno)
           end,
       Form = erl_parse:map_anno(F, Form0),
       [Form | interpret_file_attr(Forms, Delta, Fs)];

    --- https://github.com/erlang/otp/blob/OTP-19.3/lib/stdlib/src/epp.erl#L1693-L1699

  7. epp.erl:1690:
    interpret_file_attr([{attribute,Anno,file,{File,Line}}=Form | Forms],
                       Delta, Fs) ->
       L = get_line(Anno),
       Generated = erl_anno:generated(Anno),
       if
           Generated ->
               %% -file attribute
               interpret_file_attr(Forms, (L + Delta) - Line, Fs);
           not Generated ->
               %% -include or -include_lib
               % true = L =:= Line,
               case Fs of
                   [_, File | Fs1] -> % end of included file
                       [Form | interpret_file_attr(Forms, 0, [File | Fs1])];
                   _ -> % start of included file
                       [Form | interpret_file_attr(Forms, 0, [File | Fs])]
               end
       end;

    --- https://github.com/erlang/otp/blob/OTP-19.3/lib/stdlib/src/epp.erl#L1675-L1692

ericmj commented 7 years ago

I can only reproduce when cloning git@github.com:C-S-D/retort.git, git@github.com:KronicDeth/elixir_lang_elixir6015.git works without issues.

fishcakez commented 7 years ago

@KronicDeth I think you have a problem with your paths, please can you show the output to:

mix run -e "IO.puts System.version"
KronicDeth commented 7 years ago

I can confirm mix coveralls working on retort with 65c1bd50a0e3ad21a57e52925be700c722f9fa23:

Randomized with seed 870889
----------------
COV    FILE                                        LINES RELEVANT   MISSED
100.0% lib/retort.ex                                  41        5        0
  0.0% lib/retort/amqp.ex                             46        0        0
100.0% lib/retort/amqp/default.ex                     27        4        0
 90.0% lib/retort/api.ex                              51       10        1
 42.9% lib/retort/case.ex                             45        7        4
 95.5% lib/retort/channel.ex                         104       22        1
 30.8% lib/retort/client.ex                          204       26       18
 78.5% lib/retort/client/generic.ex                  832      130       28
100.0% lib/retort/client/request.ex                   60        1        0
  0.0% lib/retort/client/state_machine.ex            109       10       10
 85.7% lib/retort/client/stream.ex                    86        7        1
100.0% lib/retort/connection.ex                      314       52        0
100.0% lib/retort/connection_case.ex                 100       29        0
 25.0% lib/retort/meta.ex                             51        8        6
100.0% lib/retort/queue.ex                            52        7        0
100.0% lib/retort/queue/case.ex                       28        4        0
100.0% lib/retort/request.ex                         100        2        0
 50.0% lib/retort/resources.ex                       337       50       25
 80.0% lib/retort/response.ex                        138       10        2
100.0% lib/retort/response/error.ex                  108        7        0
  0.0% lib/retort/sandbox.ex                          30        3        3
 70.0% lib/retort/server/generic.ex                  241       40       12
  0.0% lib/retort/server/generic/callback.ex          21        0        0
100.0% lib/retort/server/generic/logger.ex            44        5        0
 64.5% lib/retort/server/generic/resources.ex        218       31       11
 53.6% lib/retort/server/generic/rpc.ex              207       28       13
  0.0% lib/retort/server/pool.ex                      37        3        3
 80.0% test/support/retort/client/test_author.e       38        5        1
100.0% test/support/retort/factory.ex                 23        1        0
 88.9% test/support/retort/kill_once.ex               43        9        1
  0.0% test/support/retort/remote_test_authors.       28        4        4
  0.0% test/support/retort/repo.ex                    29        3        3
100.0% test/support/retort/server/test_author.e       29        2        0
 66.7% test/support/retort/test_author.ex             41        3        1
100.0% test/support/retort/test_author_view.ex        21        1        0
  0.0% test/support/retort/test_authors.ex            15        0        0
  0.0% test/support/retort/test_post.ex               16        1        1
[TOTAL]  71.9%
----------------