file:position/2 hangs up whole enode

Alex Morarash tuxofil@REDACTED
Thu Jan 27 16:02:37 CET 2011


Hi all!

Just another way to completely hang up a whole erlang node:
open compressed file for read and move file position after
actual size of uncompressed data.

Stable reproduce in at least from R12B5 till R14B1.

Here is the example.


----CUT HERE-----------------------------------------

$ echo "All your bases are belong to us" | gzip > test.gz
$ ls -l test.gz
-rw-r--r-- 1 boa boa 52 Jan 27 16:43 test.gz
$ erl
Erlang R14B01 (erts-5.8.2) [source] [64-bit] [smp:4:4] [rq:4]
[async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.8.2  (abort with ^G)
1> {ok, H} = file:open("test.gz", [read, compressed]).
{ok,<0.34.0>}
2> file:position(H, 10).
{ok,10}
3> file:position(H, 40).
....HANGING....Even Ctrl+G doesn`t work.

----CUT HERE-----------------------------------------


Regards,
Alex Morarash,
e-mail: tuxofil at gmail.com


More information about the erlang-questions mailing list