FS#52867 - [erlang] 19.2-1 beam_lib reports invalid_chunk "Abst"
Attached to Project:
Community Packages
Opened by Incomplete Ness (incomplete) - Monday, 06 February 2017, 09:08 GMT
Last edited by Alexander F. Rødseth (xyproto) - Monday, 06 March 2017, 21:13 GMT
Opened by Incomplete Ness (incomplete) - Monday, 06 February 2017, 09:08 GMT
Last edited by Alexander F. Rødseth (xyproto) - Monday, 06 March 2017, 21:13 GMT
|
Details
Description:
beam_lib:chunks("/usr/lib/erlang/lib/mnesia-4.13.4/ebin/mnesia.beam", [abstract_code]). would return: {error,beam_lib, {invalid_chunk,"/usr/lib/erlang/lib/mnesia-4.13.4/ebin/mnesia.beam", "Abst"}} while I was expecting an ok tuple, which looks like "{ok, {module(), [chunkdata()]}}". This makes dialyzer unusable, for it depends on abstract code. I don't think this is an upstream problem, because I haven't upgraded erlang in a long time, (I am using erlang 18.3.3-1, but the bug is reproducible in the latest 19.2-1 version), and I remember dialyzer working fine some times ago while I was using 18.3.3-1. Additional info: * package version(s) erlang 19.2-1 * config and/or log files etc. Steps to reproduce: 1) install erlang 19.2-1 with `pacman -S erlang` or download this version from archive.archlinux.org 2) type `erl` in bash to open an erlang shell 3) type `beam_lib:chunks("/usr/lib/erlang/lib/mnesia-4.13.4/ebin/mnesia.beam", [abstract_code]).` 4) the reported error message should appear in the shell |
This task depends upon
Also, if you create a simple .erl file, and compile with +debug_info, then call beam_lib:chunnks/2 on it, it works ok.
then on Arch, open an erlang shell, type:
binary_to_term(term_to_binary(B, [compressed])).
you would get an error, however, this works fine:
binary_to_term(term_to_binary(a_simple_atom, [compressed])).
If you do all the above procedures on an Ubuntu machine, everything works.
Downgraded zlib to 1.2.8-7, beam_lib:chunks works fine now.
Sitting here waiting for other packages to be broken.
However, I still get an error when running `beam_lib:chunks("/usr/lib/erlang/lib/mnesia-4.13.4/ebin/mnesia.beam", [abstract_code]).` in erl. However, I never got "Abst" as part of the error message when following the steps to reproduce the issue, I got this instead:
{error,beam_lib,
{file_error,"/usr/lib/erlang/lib/mnesia-4.13.4/ebin/mnesia.beam",
enoent}}
Does the updated package work for you?
`beam_lib:chunks(code:which(mnesia), [abstract_code]).`
It should be OK.
Please re-open if there should be further issues with this.
Thanks everyone for reproducible test cases, good suggestions and testing.