<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 03/21/2013 07:40 AM, Maxim Treskin wrote:
<blockquote
cite="mid:CA+Km4sde2PHYyaNqhbpRyBxFcPGr85JT9GSttCm2KZtFOAem5w@mail.gmail.com"
type="cite">
<div dir="ltr">
<div style="">Hello</div>
<div style=""><br>
</div>
<div style="">At Montenegro Erlang Hackaton ( <a
moz-do-not-send="true"
href="http://lanyrd.com/2013/herceg-novi-erlang-meetup/">http://lanyrd.com/2013/herceg-novi-erlang-meetup/</a>
, there were only two people, unfortunately ) we found
incorrect behaviour of Dialyzer.<br>
</div>
<div style=""><br>
</div>
<div style="">Our project erroneous had a duplicated modules
with the same name, but different content. When we check it
with dialyzer it show me something like that:</div>
<div style=""><br>
</div>
<div style="">
<div>Duplicate modules:
[["/var/tmp/myproj/apps/myproj/ebin/psc_operate.beam",</div>
<div>
"/var/tmp/myproj/deps/somedep/ebin/amp_common_utils.beam"]]</div>
<div><br>
</div>
<div style="">
Obviously it is not the same modules. So I had to search
this bug and find strange behaviour in dialyzer. Function
lists:zip/2 called with two list, where first is reversed
list of modules as atom, and second is list of filepaths for
modules. And this list not always contains correspond
elements. Module with name some_module1 can be has filename
like abc_module55.beam. This is the cause of error.</div>
<div style=""><br>
</div>
<div style="">This bug exists in R15B02 and R16.</div>
<div style=""><br>
</div>
<div style="">I wrote such patch to fix bug, but I don't know
whether this is solution or not, though it works fine.</div>
</div>
<div><br>
</div>
<div>---
/opt/r16a/lib/dialyzer-2.5.4/src/dialyzer_analysis_callgraph.erl
2013-01-31 12:55:53.210402846 +0700</div>
<div>+++ dialyzer_pa/dialyzer_analysis_callgraph.erl 2013-03-21
13:20:46.794991889 +0700</div>
<div>@@ -255,10 +255,18 @@</div>
<div> CServer2 =
dialyzer_codeserver:set_next_core_label(NextLabel, CServer),</div>
<div> case Failed =:= [] of</div>
<div> true -></div>
<div>- NewFiles = lists:zip(lists:reverse(Modules), Files),</div>
<div>+ %% Modules and Files have not the same order, so it
is meaningless to zip it</div>
<div>+ %% NewFiles = lists:zip(lists:reverse(Modules),
Files),</div>
<div>+</div>
<div> ModDict =</div>
<div>- lists:foldl(fun({Mod, F}, Dict) ->
dict:append(Mod, F, Dict) end,</div>
<div>- dict:new(), NewFiles),</div>
<div>+ lists:foldl(fun(F, Dict) -></div>
<div>+ ModFile =
lists:last(filename:split(F)),</div>
<div>+ Mod = filename:basename(ModFile,
".beam"),</div>
<div>+ dict:append(Mod, F, Dict) end,</div>
<div>+ dict:new(), Files),</div>
<div>+ %% ModDict =</div>
<div>+ %% lists:foldl(fun({Mod, F}, Dict) ->
dict:append(Mod, F, Dict) end,</div>
<div>+ %% dict:new(), NewFiles),</div>
<div> check_for_duplicate_modules(ModDict);</div>
<div> false -></div>
<div> Msg = io_lib:format("Could not scan the following
file(s): ~p",</div>
<div><br>
</div>
<div><br>
</div>
-- <br>
Max Treskin
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-bugs mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-bugs@erlang.org">erlang-bugs@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-bugs">http://erlang.org/mailman/listinfo/erlang-bugs</a>
</pre>
</blockquote>
Hello Maxim,<br>
Follow
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a href="https://github.com/erlang/otp/wiki/submitting-patches">https://github.com/erlang/otp/wiki/submitting-patches</a>
and your patch will be reviewed!<br>
<br>
<pre class="moz-signature" cols="72">--
BR Fredrik Gustafsson
Erlang OTP Team</pre>
</body>
</html>