[erlang-questions] Exit status of C-port

Jonas Falkevik <>
Fri Aug 24 22:08:04 CEST 2012


The exception you see might be that you received a exit signal from the port.
Try setting the process flag "trap_exit" to true, then you will exit signal as a message to process linked to the port.

/Jonas

On Aug 23, 2012, at 17:02 , Olivier Girondel wrote:

> Dear all,
> 
> I have a C executable which is run with open_port (spawn_executable,
> streaming binary
> and getting exit_status)
> 
> If/when the C code crashes, I (most of the time) correctly get an exit message
> (eg: {exit_status, 134}), which is exactly what I want.
> 
> Sometimes though, I get an "exception exit" with the reason "epipe", which means
> the port really crashed in a nasty way; but this exception is not catchable.
> 
> Apart from doing this another way (-yes, I really do want to
> spawn()/run a program that might crash-),
> what are the options ?
> 
> Thanks,
> 
> -- 
> Olivier
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list