Heinz Nikolaus Gies | 1 Mar 11:03 2015
Picon

enif_make_double returns invalid term for 'nan'

When enif_make_double gets a nan value passed as the double argument it returns a invalid term, this term can neither be printed (via the fmt*) functions nor can it be deserialized by binary_to_term when serializing it the following binary is generated:

6> io:format("~p~n", [term_to_binary(V)]).
<<131,99,110,97,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>

V is the double returned by enif_make_double


---
Cheers,
Heinz Nikolaus Gies



_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Loïc Hoguin | 26 Feb 18:31 2015
Picon

ssl_basic_SUITE:defaults intermittent test failure

Hello,

I had the following happen today with ssl_basic_SUITE:defaults test. 
This is completely unrelated to the changes I am working on AFAIK.

*** User 2015-02-26 17:56:34.477 ***
TLS/SSL version [{3,0}]

*** CT Error Notification 2015-02-26 17:56:34.478 ***
ssl_basic_SUITE:defaults failed on line 2542
Reason: {badmatch,true}

Full error description and stacktrace

=== Ended at 2015-02-26 17:56:34
=== location [{ssl_basic_SUITE,defaults,2542},
               {test_server,ts_tc,1415},
               {test_server,run_test_case_eval1,1028},
               {test_server,run_test_case_eval,976}]
=== reason = no match of right hand side value true
   in function  ssl_basic_SUITE:defaults/1 (ssl_basic_SUITE.erl, line 2542)
   in call from test_server:ts_tc/3 (test_server.erl, line 1415)
   in call from test_server:run_test_case_eval1/6 (test_server.erl, line 
1028)
   in call from test_server:run_test_case_eval/9 (test_server.erl, line 976)

--

-- 
Loïc Hoguin
http://ninenines.eu
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Loïc Hoguin | 21 Feb 14:42 2015
Picon

SSL suite test failure

Had the following failure while running the SSL test suite:

- - - - - - - - - - - - - - - - - - - - - - - - - -
ssl_to_openssl_SUITE:basic_erlang_server_openssl_client failed on line 258
Reason: {test_case_failed,{{expected,{<0.14692.0>,ok}},
                    {got,
                     {<0.14692.0>,
                      {badrpc,
                       {'EXIT',
                        {function_clause,
                         [{ssl,connection_info,
                           [{error,{tls_alert,"handshake failure"}}],
                           [{file,"ssl.erl"},{line,293}]},
                          {ssl_to_openssl_SUITE,erlang_ssl_receive,2,
                           [{file,"ssl_to_openssl_SUITE.erl"},{line,1247}]},
                          {rpc,local_call,3,[{file,"rpc.erl"},{line,329}]},
                          {ssl_test_lib,do_run_server,3,
                           [{file,"ssl_test_lib.erl"},{line,92}]}]}}}}}}}
- - - - - - - - - - - - - - - - - - - - - - - - - -

Only had the failure the first time, it worked on subsequent tries, so I 
am not sure what triggered it.

--

-- 
Loïc Hoguin
http://ninenines.eu
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Rich Neswold | 18 Feb 21:55 2015
Picon

Crash when using -on_load() directive.

Hello,

I'm trying to use the -on_load() directive on NetBSD/amd64, but I'm having problems. Even this simple test file (test.erl) fails:

-module(test).
-on_load(load_my_nifs/0).

load_my_nifs() ->
    io:format("Loaded module.~n"),
    ok.

Try to compile as byte-code and then native:

$ erl
Erlang/OTP 17 (erts-6.3) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V6.3  (abort with ^G)
1> c(test).
Loaded module.
{ok,test}
2> c(test, [native]).
<HiPE (v 3.11.2)> EXITED with reason {'trans_fun/2',on_load} <at> hipe_beam_to_icode:1174

=ERROR REPORT==== 18-Feb-2015::13:42:46 ===
Error in process <0.37.0> with exit value: {{badmatch,{'EXIT',{{hipe_beam_to_icode,1174,{'trans_fun/2',on_load}},[{hipe_beam_to_icode,trans_fun,2,[]},{hipe_beam_to_icode,trans_fun,2,[]},{hipe_beam_to_icode,trans_mfa_code,5,[]},{hipe_beam_to_icode,trans_beam_function_chunk...

test.erl: internal error in native_compile;
crash reason: {badmatch,{'EXIT',{{hipe_beam_to_icode,1174,{'trans_fun/2',on_load}},
                  [{hipe_beam_to_icode,trans_fun,2,[]},
                   {hipe_beam_to_icode,trans_fun,2,[]},
                   {hipe_beam_to_icode,trans_mfa_code,5,[]},
                   {hipe_beam_to_icode,trans_beam_function_chunk,2,[]},
                   {hipe_beam_to_icode,'-module/2-lc$^1/1-1-',2,[]},
                   {hipe,get_beam_icode,4,[]},
                   {hipe,'-run_compiler_1/3-fun-0-',4,[]},
                   {hipe_icode_callgraph,get_called_modules,1,[]}]}}}

 in function  hipe:get_beam_icode/4
 in call from hipe:'-run_compiler_1/3-fun-0-'/4
 in call from hipe_icode_callgraph:get_called_modules/1
error
3>

This also happens on an R16B03-1 installation. The documentation doesn't mention the directive is limited to byte-code compiles. But even if it was, the native compiler should print an error instead of crashing.

Are other platforms having this problem?

--
Rich
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Ulf Norell | 19 Feb 10:35 2015

Internal consitency check failure

Messing around with my random program generator again I got the following message:

1> c(bug).

bug: function f/0+18:

  Internal consistency check failed - please report this bug.

  Instruction: {gc_bif,'+',{f,0},1,[{x,0},{atom,hockey}],{x,0}}

  Error:       unknown_catch_try_state:


Here's the (somewhat contrived) program

-module(bug).
-compile(export_all).
f() ->
  receive _ -> (b = fun() -> ok end)
    + hockey, +x after 0 -> ok end, try (a = fun() -> ok end) + hockey, +
    y catch _ -> ok end.

There are a number of intriguing things here

- Breaking the 'hockey' line anywhere gets rid of the bug(!!).
- The two 'hockey' atoms need to be the same (but not necessarily sports related).
- I tried reasonably hard to make the program smaller, but failed.

I get the same error on all distributions I tried (R14 up to R17.4.1). Master didn't build for me.

/ Ulf
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Klas Johansson | 17 Feb 20:23 2015
Picon

`undefined parse transform' parse transforms which call non-existing modules

Hi,

I noticed that a warning has been added to the compiler which says `undefined parse transform' instead of throwing a (potentially large) parse tree in the face of the user.  Nice!  This is the commit:

dba5396 compile: Give a friendler error message if a parse transform cannot be found

I discovered that is has an unfortunate side-effect:

If an existing parse transform calls a non-existing module, the check will misinterpret this and print the `undefined parse transform' error.

Tested with compiler-5.0.3 on Erlang/OTP 17.4.

Example parse transform:

-module(x).

-compile(export_all).

parse_transform(_Forms, _Opts) ->
    non:existing().


Cheers,
Klas
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
James Fish | 15 Feb 17:36 2015

Dialyzer crashes when checking a PLT (via Erlang API) returns warnings

Hi,

Dialyzer crashes when checking a plt (before running the main analysis type) if a warning is found when using dialyzer:run/1.

Please find an archive attached with a minimal example and run the escript plt_check (with OTP >= 17.0 as no_unknown is used to hide unrelated output).

In OTP 17.4 it will crash with the following output:

Error: {case_clause,{ok,2}}
Stacktrace: [{dialyzer,run,1,[{file,"dialyzer.erl"},{line,167}]},
             {plt_check__escript__1424__17011__604940,run,1,
                 [{file,"./plt_check"},{line,21}]},
             {escript,run,2,[{file,"escript.erl"},{line,752}]},
             {escript,start,1,[{file,"escript.erl"},{line,276}]},
             {init,start_it,1,[]},
             {init,start_em,1,[]}]

The expected output is:

plt_check.erl:6: Call to missing or unexported function erlang:'not_exported!'/0

On a related note, it would appear that using plt_check checks the plt twice. Hopefully this can be resolved at the same time.

Regards,

James
Attachment (plt_check.tar.gz): application/x-gzip, 980 bytes
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Ingela Anderton Andin | 11 Feb 09:44 2015
Picon

Fwd: Re: ssh known_hosts


-------- Forwarded Message --------
Subject: Re: [erlang-bugs] ssh known_hosts
Date: Mon, 9 Feb 2015 09:05:26 +0100
From: Ingela Anderton Andin <Ingela.Anderton.Andin <at> ericsson.com>
To: Tony Rogvall <tony <at> rogvall.se>

Hi!

On 02/08/2015 02:32 PM, Tony Rogvall wrote:
> Hi!
>
> I just noticed that Erlang ssh does not recognize the (newish) format:
>
> [<address>]:<port>  <ssh-key>
>
> nor the hashed format:
>
> |1|<salt>|<hash> <ssh-key>
>
> The first is convenient to understand when you have Erlang clients
> that connect to ssh servers on ports other than 22,
> which is kind of normal for Erlang ssh daemons.
>
> The hashed format just up the security a bit.
>
> Accept a PL ?
>

Yes pullrequest please :) Note that it might be in the module pubkey_ssh
in public_key that would be the place to add it.

Regards Ingela Erlang/OTP team - Ericsson AB

_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs

Tony Rogvall | 8 Feb 14:32 2015
Picon

ssh known_hosts

Hi!

I just noticed that Erlang ssh does not recognize the (newish) format:

[<address>]:<port>  <ssh-key>

nor the hashed format:

|1|<salt>|<hash> <ssh-key>

The first is convenient to understand when you have Erlang clients
that connect to ssh servers on ports other than 22,
which is kind of normal for Erlang ssh daemons.

The hashed format just up the security a bit.

Accept a PL ?

BR

/Tony

_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Aleksander Nycz | 3 Feb 10:16 2015
Picon

xmerl - how to clean xsd_state rec

Hello,

Function xmerl_xsd:process_schema returns {ok, State} where State is
the global state of the validator. It is representated by the 
#xsd_state{} record.
Record xsd_state contains field 'table' that is ets tid.

I must change Schema and call function  xmerl_xsd:process_schema once 
again to obtain new global state.

And I'm wondering how to clean old state (eg. delete old ets) ...

Regards
Aleksander Nycz

--

-- 
Aleksander Nycz
Telco_021 BSS R&D
Comarch SA
Phone:  +48 17 785 59 09
Mobile: +48 691 464 275
website: www.comarch.pl

Attachment (smime.p7s): application/pkcs7-signature, 6647 bytes
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Andy Till | 1 Feb 12:19 2015
Picon

eprof does not print results on short lived procs

Hi

When I spawn a process to run eprof, no results get printed.  For 
example if this is run from the shell:

Self = self().
eprof:start().
Eprof_fn = fun() ->
     eprof:start_profiling([Self]),
     timer:sleep(2000),
     eprof:stop_profiling(),
     eprof:analyze(total)
end.
Eprof_fn().
spawn(Eprof_fn).

I would expect this to print out the results twice but only the profile 
run from the shell process prints out.  Running this in a different 
orders does not help.

This also affects RPC.  I had a module containing a function similar to 
that above which would not print results to a file when called from a 
remote node.

Cheers

Andy
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs


Gmane