Fun with open_port

Gerd Flaig gerd@REDACTED
Sat Mar 20 17:51:35 CET 2004


the following module

   r() ->
       Port = open_port({spawn, "/bin/true"}, [{line, 200}, exit_status]),
   	X ->
       after 5000 ->

exposes interesting behaviour:

   % erl
   Erlang (BEAM) emulator version 5.3 [source] [hipe] [threads:0]
   Eshell V5.3  (abort with ^G)
   1> dreck:r().
   2> dreck:r().
   3> dreck:r().
   4> c(dreck).
   5> dreck:r().
   6> dreck:r().
   7> dreck:r().
   8> dreck:r().

Any ideas what might be causing this and how I can fix it? I've been
staring at the emulator source but have not yet understood how the
inner workings of open_port fit together. I've tested this on R9C
(Debian package version 1:9.2-5 and another test on the same package
version, but compiled locally. Same effect).

       Goodbyte, Gerd.
Gerd Flaig                     Technik                gerd@REDACTED
Bei Schlund + Partner AG       Brauerstraße 48      D-76135 Karlsruhe
 Physics is like sex: sure, it may give some practical results,
 but that's not why we do it. -- Richard Feynman

More information about the erlang-questions mailing list