Giter VIP home page Giter VIP logo

Comments (21)

AndrewDryga avatar AndrewDryga commented on June 30, 2024 4

Any success?

from excoveralls.

parroty avatar parroty commented on June 30, 2024 1

I haven't been able to identify the error cause, but the offending line for my cases were around exception (ex. raise keyword).

replacing

raise %ArgumentError{message: "error"}

with

raise ArgumentError, message: "error"

resolved the error.

I've also pushed the example code in the following.

The same error occurs with mix test --cover without using excoveralls.

If someone has any insight around this, I appreciate any help. I'm looking around defexception and erlang code @dokie mentioned, but I don't have clear idea yet how to resolve it.

from excoveralls.

Ivor avatar Ivor commented on June 30, 2024 1

Hi. Does anyone have an idea of how to go about fixing this issue?

from excoveralls.

deadtrickster avatar deadtrickster commented on June 30, 2024 1

Hello there!

My error:


01:38:10.989 [error] Process #PID<0.400.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:1645: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1637: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1659: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1648: :erl_parse.modify_anno1/3

01:38:10.989 [error] Process #PID<0.399.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Prometheus.PlugPipelineInstrumenter, :__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

01:38:10.990 [error] Process #PID<0.401.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:1645: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1637: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1659: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1648: :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:1645: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1637: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1659: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1648: :erl_parse.modify_anno1/3
    cover.erl:583: :cover.call/1
    lib/excoveralls.ex:28: ExCoveralls.start/2
    (mix) lib/mix/tasks/test.ex:205: Mix.Tasks.Test.run/1
    (mix) lib/mix/task.ex:296: Mix.Task.run_task/3
    lib/mix/tasks.ex:53: Mix.Tasks.Coveralls.do_run/2
    (mix) lib/mix/task.ex:296: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2


01:38:10.991 [error] Process #PID<0.404.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:1645: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1637: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1659: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1648: :erl_parse.modify_anno1/3

01:38:10.991 [error] Process #PID<0.402.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Prometheus.PlugExporter, :__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

01:38:10.992 [error] Process #PID<0.403.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Prometheus.PlugInstrumenter, :__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

from excoveralls.

pgmcdonnell avatar pgmcdonnell commented on June 30, 2024

Bit of progress, although I'm not absolutely sure why this happened. The issue was caused by us having use HTTPoison.Base in one of our files which compiled down to .beam. The issue goes away if we substitute require for use but for our project we need to use HTTPoison, at least in dev and production.

Update: This seems to only occur when running on the back of Erlang/OTP 19. With Erlang/OTP 18 it seems to be working fine.

Have you seen any issues before on projects using HTTPoison? I think we are able to get past this now, but it would be good to get to the root cause.

Thanks again for your time on this really cool project!

from excoveralls.

dokie avatar dokie commented on June 30, 2024

We too are hitting this issue in only one of our umbrella projects that uses Maru
https://github.com/falood/maru
Maru uses Poison and not HTTPoison so perhaps it's not entirely related to that library. I will keep digging into it.

from excoveralls.

dokie avatar dokie commented on June 30, 2024

After digging into the Erlang v19 source code for stdlib:erl_anno and the function set

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.

we can see that something is passing args of (in Erlang syntax) Item = location, Line = -1 which gets passed to the function is_settable/2 which is defined as

is_settable(file, File) ->
    is_filename(File);
is_settable(generated, Boolean) when Boolean; not Boolean ->
    true;
is_settable(location, Line) when ?LLINE(Line) ->
    true;
is_settable(location, {Line, Column}) when ?LLINE(Line), ?LCOLUMN(Column) ->
    true;
is_settable(record, Boolean) when Boolean; not Boolean ->
    true;
is_settable(text, Text) ->
    is_string(Text);
is_settable(_, _) ->
    false.

which the function head that will be executed is the fall-through is_settable(_, _) due to the guard clause on Line which is the macro ?LLINE(Line) which is defined to be -define(LLINE(L), ?LN(L)). which in turn has definition of the macro LN as -define(LN(L), is_integer(L), L >= 0).

Thus all in all, whatever is generating the line number of -1 is causing this argument error.

Will continue my dig!

from excoveralls.

dokie avatar dokie commented on June 30, 2024

So now I have ran the following in iex

:cover.compile_beam_directory("/Users/mike/dev/InflowNet/_build/dev/lib/inflownet_api/ebin" |> String.to_char_list)

which is where the Erlang cover library is used to prepare itself and it generates the error we are seeing.

11:08:22.491 [error] Process #PID<0.635.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:1645: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1637: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1659: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1632: :erl_parse.modify_anno1/3

which is swiftly followed by the following exception

11:08:22.492 [error] Process #PID<0.636.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, InflowNet.API.Infrasense.Raw.Conductor, :handle_info, 2, 1, 55}, 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

So I'm not sure (but suspect) that the second exception is caused by the first one as far as I can see in the source code for cover.erl since the ETS table may get killed when the first process dies from the erl_anno exception as it's running a parallel map over a number of processes for each module.

from excoveralls.

dokie avatar dokie commented on June 30, 2024

This looks like the code that could be setting the -1 value in erl_anno.erl and note the comments!!

-ifdef(DEBUG).
from_term(Term) when is_list(Term) ->
    Term;
from_term(Line) when is_integer(Line), Line < 0 -> % Before OTP 19
    set_generated(true, new(-Line));
from_term(Term) ->
    [{location, Term}].
-else.
from_term(Line) when is_integer(Line), Line < 0 -> % Before OTP 19
    set_generated(true, new(-Line));
from_term(Term) ->
    Term.
-endif.

This was introduced into Erlang v19 code base at this commit
erlang/otp@d9daff6

however still not sure HOW the -1 get's there.

from excoveralls.

dokie avatar dokie commented on June 30, 2024

My offending module is the one that uses Maru via use Maru.Router and this module is a tiny macro around use Maru.Builder. That introduces a lot of Elixir macro code and the one I have narrowed it down to injects code into a compile-time module constant, thus

  defmacro rescue_from(:all, [as: error_var], [do: block]) do
    quote do
      @exceptions {:all, unquote(Macro.escape error_var), unquote(Macro.escape block)}
    end
  end

So this block must be causing cover to go wrong in it's beam file compilation. I replaced the use of the macro by the eventual Elixir code that it generated and worked around this issue
😃

from excoveralls.

parroty avatar parroty commented on June 30, 2024

Thanks for the analysis and sorry about being late to respond.

I've updated erlang to 19 and I'm seeing the same error in some of my programs (not all).

:cover.compile_beam_directory("/Users/mike/dev/InflowNet/_build/dev/lib/inflownet_api/ebin" |> String.to_char_list)

Seeing error with this, I'm wondering it's good to have concise sample program repo (and possibly asking at elixir dev members), but I haven't succeeded yet.

from excoveralls.

Ivor avatar Ivor commented on June 30, 2024

My test coverage worked fine before upgrading to Elixir 1.3.2 and Erlang/OTP 19

    13:23:51.609 [error] Process #PID<0.291.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_clause_table, {MyApp.TokenError, [{MyApp.TokenError, :__info__, 1, 1, 1}, {MyApp.TokenError, :__info__, 1, 2, 1}, {MyApp.TokenError, :__info__, 1, 3, 1}, {MyApp.TokenError, :__struct__, 0, 1, 1}, {MyApp.TokenError, :__struct__, 1, 1, 2}, {MyApp.TokenError, :exception, 1, 1, 1}, {MyApp.TokenError, :exception, 1, 2, 2}, {MyApp.TokenError, :message, 1, 1, 3}]})
    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

13:23:51.609 [error] Process #PID<0.286.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_clause_table, {MyApp.PageController, [{MyApp.PageController, :__info__, 1, 1, 1}, {MyApp.PageController, :__info__, 1, 2, 1}, {MyApp.PageController, :__info__, 1, 3, 1}, {MyApp.PageController, :action, 2, 1, 2}, {MyApp.PageController, :"action (overridable 2)", 2, 1, 2}, {MyApp.PageController, :call, 2, 1, 1}, {MyApp.PageController, :index, 2, 1, 3}, {MyApp.PageController, :init, 1, 1, 1}, {MyApp.PageController, :phoenix_controller_pipeline, 2, 1, 4}]})
    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

13:23:51.611 [error] Process #PID<0.288.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_clause_table, {MyApp.RegistrationView, [{MyApp.RegistrationView, :__info__, 1, 1, 1}, {MyApp.RegistrationView, :__info__, 1, 2, 1}, {MyApp.RegistrationView, :__info__, 1, 3, 1}, {MyApp.RegistrationView, :__phoenix_recompile__?, 0, 1, 1}, {MyApp.RegistrationView, :__resource__, 0, 1, 1}, {MyApp.RegistrationView, :__templates__, 0, 1, 1}, {MyApp.RegistrationView, :render, 1, 1, 1}, {MyApp.RegistrationView, :render, 2, 1, 1}, {MyApp.RegistrationView, :render, 2, 2, 1}, {MyApp.RegistrationView, :render, 2, 3, 1}, {MyApp.RegistrationView, :render, 2, 4, 1}, {MyApp.RegistrationView, :render_template, 2, 1, 1}, {MyApp.RegistrationView, :render_template, 2, 2, 1}, {MyApp.RegistrationView, :render_template, 2, 3, 1}, {MyApp.RegistrationView, :render_template, 2, 4, 1}, {MyApp.RegistrationView, :render_template, 2, 5, 1}, {MyApp.RegistrationView, :template_not_found, 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

These are my errors. Something I suspect is noteworthy, is that I get the same errors with coverex as I get with excoveralls so I suspect it might be related to the underlying erlang cover library?

from excoveralls.

Ivor avatar Ivor commented on June 30, 2024

Confirmed that this problem goes away if I use https://github.com/robisonsantos/evm and switch to OTP 18.3. Not a solution but possibly a clue.

from excoveralls.

nathany avatar nathany commented on June 30, 2024

Like @pgmcdonnell, #60 (comment), I'm seeing this issue in a project with use HTTPoison.Base.

elixir (1.3.3)
erlang (19.0.2_1)
macOS 10.12

from excoveralls.

nathany avatar nathany commented on June 30, 2024

I can't confirm or deny that Erlang 19.1 resolves the issue. Homebrew on macOS has me confused as to which version Erlang is being used after upgrading to Elixir 1.3.4.

from excoveralls.

Ivor avatar Ivor commented on June 30, 2024

@nathany I used https://github.com/robisonsantos/evm to be able to run various versions and set which one to use.

from excoveralls.

parroty avatar parroty commented on June 30, 2024

I'm sorry for not responsive. I'm revisiting this item, and based on the above information, my understanding for avoiding errors are,

  • Upgrading elixir to v.1.4.1
  • Updating raise not to use struct.
    • I'm not confident enough, but with in my case, the following change removed the error.
raise %ArgumentError{message: "error"}

with

raise ArgumentError, message: "error"

from excoveralls.

jadlr avatar jadlr commented on June 30, 2024

Hi, I'm also having this error. The offending file contains this:

Postgrex.Types.define(Support.PostgrexTypes, [Geo.PostGIS.Extension|Ecto.Adapters.Postgres.extensions], json: Poison)

elixir 1.4.1 / erlang 19.2 / arch linux 4.9.8-1-ARCH

The strange thing is that my coworker with the same code / erlang ver / elixir ver doesn't have the problem on a Mac.

the trace:

12:55:46.562 [error] Process #PID<0.363.0> raised an exception
** (CaseClauseError) no case clause matching: {:error, :beam_lib, {:invalid_chunk, 'folder/_build/test/lib/project_name/ebin/Elixir.Support.PostgresTypes.beam', 'Abst'}}
    cover.erl:1539: :cover.do_compile_beam1/3
    cover.erl:1478: :cover.do_compile_beam/3
    (stdlib) lists.erl:1239: :lists.map/2
    (stdlib) lists.erl:1239: :lists.map/2
    cover.erl:2732: anonymous fn/2 in :cover.pmap_spawn/4
** (exit) an exception was raised:
    ** (CaseClauseError) no case clause matching: {:error, :beam_lib, {:invalid_chunk, 'folder/_build/test/lib/project_name/ebin/Elixir.Support.PostgresTypes.beam', 'Abst'}}
        cover.erl:1539: :cover.do_compile_beam1/3
        cover.erl:1478: :cover.do_compile_beam/3
        (stdlib) lists.erl:1239: :lists.map/2
        (stdlib) lists.erl:1239: :lists.map/2
        cover.erl:2732: anonymous fn/2 in :cover.pmap_spawn/4
    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/project.ex:312: Mix.Project.in_project/4
    (elixir) lib/file.ex:1162: File.cd!/2
    (mix) lib/mix/task.ex:394: anonymous fn/4 in Mix.Task.recur/1
    (elixir) lib/enum.ex:1755: Enum."-reduce/3-lists^foldl/2-0-"/3

12:55:46.564 [error] Process #PID<0.370.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Support.Station, :__struct__, 1, 1, 7}, 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

12:55:46.565 [error] Process #PID<0.368.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Support.Query, :__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

12:55:46.565 [error] Process #PID<0.365.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Support.QueryResult.Itinerary, :__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

from excoveralls.

SkyWriter avatar SkyWriter commented on June 30, 2024

My grain of salt. Mac OS X 10.11.6, XCode 8.1 over here, doing brew upgrade elixir and getting to:

$ elixir --version
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Elixir 1.4.1

Eliminated the issue on my project.

from excoveralls.

KronicDeth avatar KronicDeth commented on June 30, 2024

Also happening in https://github.com/C-S-D/retort/commit/546959cc285ccc25a3e73c49820d8e47dbf9f92e.

Further deletions, I got the error to go away in https://github.com/C-S-D/retort/commit/9da8e863385e06ad94689f86a90031627fcf47f7, where I deleted Retort.ConnectionCase, which is an ExUnit.CaseTemplate

from excoveralls.

henryj avatar henryj commented on June 30, 2024

Happening on Mac 10.12.5,

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

Elixir 1.4.2

with use ExUnit.CaseTemplate

from excoveralls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.