[erlang-bugs] Dialyzer v2.2.0 crash

Kostis Sagonas kostis@REDACTED
Sun May 1 16:49:07 CEST 2011


Peer Stritzinger wrote:
> When running dialyzer like:
> 
>     $ dialyzer --src -c codec_can.erl
> 
> on the file codec_can.erl with the following contents (minimal code
> snippet that shows the error):
> 
>     -module(codec_can).
>     -compile(export_all).
> 
>     -record(can_pkt, {id, data, timestamp}).
> 
>     -spec recv(<<_:64,_:_*8>>,fun((_) -> any()),atom() | pid() |
> {atom(),_}) -> any().
>     recv(Packet, Recv_fun, Chan) ->
>         P = decode(Packet),
>         #can_pkt{id=Can_id, data=Can_data}=P,
>         Recv_fun(P).
> 
>     -spec decode(<<_:64,_:_*8>>) ->
> #can_pkt{id::<<_:11>>,data::binary(),timestamp::char()}.
>     decode(<<_:12, Len:4, Timestamp:16,
>              0:3, Id:11/bitstring, 0:18,
>              Data:Len/binary, _/binary>>) ->
>         #can_pkt{id=Id, data=Data, timestamp=Timestamp}.
> 
> I get the following error:
>    ...  SNIP

Thanks for your bug report!  It's indeed an error in the processing of 
binary types generated by typer which are then fed back to dialyzer.  I 
already have a patch ready that fixes this and will hopefully appear in 
OTP's dev branch pretty soon.

If the other crash you get is in a function with a spec containing a 
type of the form <<_:N,_:_*M>>, don't bother minimizing the test case 
and sending a report.  Otherwise, please do -- perhaps just to me.

Kostis



More information about the erlang-bugs mailing list