Erlang/OTP Forums

Author Message

<  Erlang bugs mailing list  ~  epipe error on port, uncatchable exception

Karalabe
Posted: Sun May 09, 2010 7:28 pm Reply with quote
User Joined: 03 Jul 2009 Posts: 11
Hi,

I've been trying to get some basic port operations going, but sometimes I
get a very peculiar error: epipe exception. The problem is that according to
the documentation this should never happen, yet it does, what's more ,
completely randomly. I can execute the same command and one time is
succeeds, another time it fails (let's say 1/10 failures). The even more
interesting part is, that I cannot catch the exception.

I've written a very basic module to reproduce the error, which just
executes "ls -al" 1000 times (see below), passing in a small input data
(this is the reason of the crash).

The exception below doesn't happen on all machines (I'm using openSuSE
11.2 x64, with Erlang R13B04 (also x64)). On an Ubuntu it ran just fine. Now
it may turn out that the OS is doing something strange causing the broken
pipes, BUT even so, I should be able to catch it.

Any feedback is appreciated,
Peter

portbug.erl:
----------
-module(portbug).
-compile(export_all).

crash_it() ->
try lists:foreach(fun(_) -> do_something_portlike() end,
lists:seq(1, 1000))
catch
Class:Exception -> io:format("Caught: ~p:~p", [Class,
Exception])
end.

do_something_portlike() ->
Command = "ls -al",
Port = open_port({spawn, Command}, [stream, use_stdio,
stderr_to_stdout, binary, eof]),
Port ! {self(), {command, <<"some random data">>}},
Port ! {self(), close}.
----------
(shell@laptop)232> portbug:crash_it().

exception exit: epipe**
----------


Post received from mailinglist
View user's profile Send private message
wuji
Posted: Mon Sep 17, 2012 6:55 am Reply with quote
User Joined: 10 Aug 2012 Posts: 654
Romney's "first day" timeframe.Now, repeal has re-emerged as a top top cheap replica *beep* top campaign issue for congressional Republicans, much like the 2010
elections that swept Rep John. Boehner into the speaker's chair."It chair."It [h2]cheap polo ralph lauren[/h2] chair."It becomes a huge issue going forward to the election
November," Rep. Steve King, R-Iowa, told ABC on the steps steps buy real jordans steps of the court immediately after the decision was announced.
Obama has had this around his neck for two and and authentic jordans and a half years. It will become an albatross around
neck of Barack Obama walking into November."Asked why it is is knockoff designer *beep* is necessary for the House to act again on repeal,
when there are not enough votes in the Senate to to [h4]imitation designer *beep*[/h4] to repeal it, Boehner also said the Supreme Court's ruling
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum