Re: Erlang problems with big binaries

Mikael Pettersson <[email protected]>
Newsgroups gmane.comp.lang.erlang.bugs
Message-ID <[email protected]>
Nico Kruber writes:
 > I'd like to 'bor' (binary or) a big binary but the result is an empty list(?!)
 > Smaller binaries work as expected.
 > 
 > Steps to reproduce (at least on Erlang 17.4):
 > 
 > A=erlang:term_to_binary(lists:seq(1000000,2200000)).
 > B=erlang:term_to_binary(lists:seq(1000001,2200001)).
 > ASize=erlang:bit_size(A).
 > BSize=erlang:bit_size(B).
 > <<ANr:ASize>> = A.
 > <<BNr:BSize>> = B.
 > XNr = ANr bor BNr.
 > <<XNr:BSize>>.
 > 
 > 
 > Please note that printing the actual values of A or B is not a good idea ;)
 > and so would XNr but including it directly into a binary fails with the same 
 > error: "** exception error: bad argument"
 > <<(ANr bor BNr):BSize>>.

I can confirm the [] result, in both 17.4 and r15b03-1.

Running these steps in a debug-enabled otp 17.4 on x86_64 results in:

7> XNr = ANr bor BNr.
beam/erl_arith.c:1078:erts_bor() Assertion failed: ((arg1) != ((~((Uint) 0) << 6) | ((0x3 << 4) | ((0x2 << 2) | 0x3))))
               Abort

so the [] result is probably due to insufficient type checking.

I'll take a look, unless someone beats me to it.
_______________________________________________
erlang-bugs mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-bugs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.