pprzetacznik / IElixir

Jupyter's kernel for Elixir programming language
Apache License 2.0
357 stars 44 forks source link

simple process spawn() seemingly failing #25

Open stochastic-thread opened 7 years ago

stochastic-thread commented 7 years ago
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

pprzetacznik commented 7 years ago

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

pprzetacznik commented 6 years ago

@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?

stochastic-thread commented 6 years ago

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

pprzetacznik commented 6 years ago

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

pprzetacznik commented 6 years ago

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

stochastic-thread commented 6 years ago

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

rodolphofreire commented 6 years ago

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??