Skip to content

Kernel.DialyzerTest: failure on setup_all callback, tests invalidated #5163

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

Closed
majioa opened this issue Aug 26, 2016 · 10 comments
Closed

Kernel.DialyzerTest: failure on setup_all callback, tests invalidated #5163

majioa opened this issue Aug 26, 2016 · 10 comments

Comments

@majioa
Copy link

majioa commented Aug 26, 2016

Environment

  • Elixir version (elixir -v):

Erlang/OTP 18 [erts-7.3.1] [source] [async-threads:10] [hipe] [kernel-poll:false]

Elixir 1.4.0-dev (63d9032)

and

Erlang/OTP 18 [erts-7.3.1] [source] [async-threads:10] [hipe] [kernel-poll:false]

Elixir 1.3.2

  • Operating system:

$ uname -a
Linux deroptyja.psi 3.8.9-std-def-alt1 #1 SMP Fri Apr 26 05:38:59 UTC 2013 i686 GNU/Linux
$ cat /etc/altlinux-release
Simply Linux 7.95.0 (Dory)

Current behavior

Include code samples, errors and stacktraces if appropriate.

$ make clean test

  1. Kernel.DialyzerTest: failure on setup_all callback, tests invalidated
    ** (throw) {:dialyzer_error, [67, 111, 117, 108, 100, 32, 110, 111, 116, 32, 103, 101, 116, 32, 97, 98, 115, 116, 114, 97, 99, 116, 32, 99, 111, 100, 101, 32, 102, 111, 114, 32, 102, 105, 108, 101, 58, 32, '/usr/lib/erlang/lib/erts-7.3.1/ebin/erl_prim_loader.beam', 32, 40, 112, 108, 101, 97, 115, 101, 32, 114, ...]}
    stacktrace:
    dialyzer_plt.erl:469: :dialyzer_plt.compute_md5_from_file/1
    dialyzer_plt.erl:458: :dialyzer_plt."-compute_md5_from_files/1-lc$^0/1-0-"/1
    dialyzer_plt.erl:458: :dialyzer_plt.compute_md5_from_files/1
    dialyzer_cl.erl:74: :dialyzer_cl.build_plt/1
    dialyzer.erl:167: :dialyzer.run/1
    test/elixir/kernel/dialyzer_test.exs:27: Kernel.DialyzerTest.ex_unit_setup_all_0/1
    test/elixir/kernel/dialyzer_test.exs:3: Kernel.DialyzerTest.__ex_unit
    /2

Finished in 171.8 seconds (128.2s on load, 43.6s on tests)
3215 tests, 1 failure, 5 invalid

Expected behavior

3215 tests, 0 failure, 5 invalid

@fishcakez
Copy link
Member

That error is not ideal. It's saying that dialyzer could not get the abstract code for :erl_prim_loader and should recompile with +debug_info. This is a module from the :erts application so part of OTP and you likely won't be recompiling this. This module may even have special handling/bootstrapping in OTP. It would usually include debug info in its beam file. How are you building OTP?

@majioa
Copy link
Author

majioa commented Aug 27, 2016

@fishcakez I've just installed it from package, but it really have no debuginfo embedded, it is placed into a standalone package.

@fishcakez
Copy link
Member

+debug_info is an erlc (erlang compiler CLI) parameter and stores extra information in each module's .beam file. Erlang/OTP is built with debug info by default so a package maintainer would have to disable this or remove it as aprt of the build process, which would be unusual.

We can investigate if this is the case by running the following in iex:

~c"erl_prim_loader.beam" |> :code.where_is_file() |> :beam_lib.chunks([:abstract_code])

@josevalim
Copy link
Member

@majioa ping.

@majioa
Copy link
Author

majioa commented Sep 7, 2016

@fishcakez will try

@josevalim
Copy link
Member

Ping. :)

@josevalim
Copy link
Member

Closing this for now. Please let us know if you have more information.

@muhang
Copy link

muhang commented Feb 2, 2017

Just ran into this when running make test on a freshly cloned repo, with a slightly different error.

Environment

  • Elixir version:

    $ elixir -v
    Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-   poll:false]
    Elixir 1.4.1
    
  • OS:

    $ uname -a
    Linux localhost.localdomain 4.9.6-1-ARCH #1 SMP PREEMPT Thu Jan 26 09:22:26 CET 2017 x86_64 GNU/Linux
    $ uname -r
    4.9.6-1-ARCH
    

Current Behaviour

$ make clean test
  1) Kernel.DialyzerTest: failure on setup_all callback, test invalidated
     ** (RuntimeError) dialyzer error: Could not get abstract code for file: /home/muhan/Dev/oss/elixir/bin/../lib/elixir/ebin
/Elixir.Kernel.beam (please recompile it with +debug_info)
     
     stacktrace:
       test/elixir/kernel/dialyzer_test.exs:115: Kernel.DialyzerTest.dialyzer_run/1
       test/elixir/kernel/dialyzer_test.exs:27: Kernel.DialyzerTest.__ex_unit_setup_all_0/1
       test/elixir/kernel/dialyzer_test.exs:3: Kernel.DialyzerTest.__ex_unit__/2
Finished in 12.8 seconds (8.6s on load, 4.1s on tests)
3459 tests, 1 failure, 7 invalid

Expected Behaviour

$ make clean test
3459 tests, 0 failure, 7 invalid

Notes

I ran

~c"Elixir.Kernel.beam" |> :code.where_is_file() |> :beam_lib.chunks([:abstract_code])

in iex as per the suggestion of @fishcakez to get some more info. The full output is below.

iex(1)> ~c"Elixir.Kernel.beam" |> :code.where_is_file() |> :beam_lib.chunks([:abstract_code])
{:error, :beam_lib,
 {:invalid_chunk, '/usr/lib/elixir/bin/../lib/elixir/ebin/Elixir.Kernel.beam',
  'Abst'}}

@josevalim
Copy link
Member

We have tracked this down and solved it on #5664.

@muhang
Copy link

muhang commented Feb 2, 2017

Oh, great! Sorry for the duplicate, I'll fiddle with my zlib versions and make sure I'm building on OTP >= 19.1, and if anything else gets weird I'll follow up there. Thanks!

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

No branches or pull requests

4 participants