[erlang-bugs] strange exit values (race condition?) with erlang:halt/1 in otp/master

Nico Kruber nico.kruber@REDACTED
Thu Oct 31 11:36:10 CET 2013


Hi,
we have a small test to check whether crypto:start() is possible and test this 
via a shell script. For this we use erlang:halt/1 with an appropriate exit 
status.
Ever since the update b95da0a..a878a3a erlang exposes a strange behaviour - 
see the following trace:

----------
> erl -noinput -eval 'case catch crypto:start() of ok -> halt(0); _ -> halt(1) 
end.' ; echo $?
1

> erl -noinput -eval 'case catch crypto:start() of ok -> halt(0); X -> 
io:format("error: ~p", [X]), halt(1) end.' ; echo $?
0
----------

Starting erlang and executing the two commands in the erlang shell both yields 
to an exit status of 0:

----------
> erl ; echo $? 
Erlang R17A (erts-5.11) [source-3f961b3] [64-bit] [smp:8:8] [async-threads:10] 
[hipe] [kernel-poll:false]

Eshell V5.11  (abort with ^G)
1> case catch crypto:start() of ok -> halt(0); _ -> halt(1) end.
0

> erl ; echo $? 
Erlang R17A (erts-5.11) [source-3f961b3] [64-bit] [smp:8:8] [async-threads:10] 
[hipe] [kernel-poll:false]

Eshell V5.11  (abort with ^G)
1> case catch crypto:start() of ok -> halt(0); X -> io:format("error: ~p", 
[X]), halt(1) end.
0
----------


Nico
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20131031/e9268519/attachment.bin>


More information about the erlang-bugs mailing list