IElixir icon indicating copy to clipboard operation
IElixir copied to clipboard

simple process spawn() seemingly failing

Open stochastic-thread opened this issue 9 years ago • 7 comments

a = spawn(fn -> receive do :arthur -> IO.puts(:hey) end end)
send a, :arthur

Erlang version: 19 Elixir version: 1.3.2 Notebook version 4.2.3

When I try to execute the above two lines, the notebook server prints the following out in the logs

2016-11-25 18:28:49.694 [error] Process #PID<0.201.0> raised an exception
** (ErlangError) erlang error: :terminated
    (stdlib) :io.put_chars(#PID<0.200.0>, :unicode, ["hey", 10])

When I try locally in an iex session, it works fine. Any idea what's the issue here? Does it not know that the notebook is stdout or something (just a guess...) ? I am pretty sure I've been able to do this previously, last time I messed around with IElixir

stochastic-thread avatar Nov 25 '16 23:11 stochastic-thread

Hi @arthurcolle, can you test it one more time? I've fixed support for younger elixir/otp versions.

pprzetacznik avatar Jun 19 '17 22:06 pprzetacznik

@arthurcolle I'm abandon supporting of 1.3.2 version of elixir. Could you try this with the newer version and report the problems as another ticket if needed?

pprzetacznik avatar Jul 03 '18 09:07 pprzetacznik

thanks I'll check this out depressing this was two years ago feels like last week

stochastic-thread avatar Jul 04 '18 23:07 stochastic-thread

@arthurcolle same here. I see this problem still occurs. I'll take a look at this closer.

pprzetacznik avatar Jul 04 '18 23:07 pprzetacznik

@arthurcolle funny, it works fine when executed as two separated statements but not as one statement.

pprzetacznik avatar Jul 04 '18 23:07 pprzetacznik

@pprzetacznik interesting...i vaguely recall observing that behavior any insight into elixir limitations that would/could cause this?

stochastic-thread avatar Jul 10 '18 21:07 stochastic-thread

I am facing the same problem and I made it kind of work with :stderr

a = spawn(fn -> receive do :arthur -> IO.puts(:stderr, :hey) end end)
send a, :arthur

Maybe is something related with the :standard_io outside the notebook process??

rodolphofreire avatar Jul 27 '18 17:07 rodolphofreire