Emile Joubert | 19 Jul 2012 12:43
Favicon

Non-ASCII $HOME crashed distributed Erlang on OS X

Hi,

I'm unable to start a distributed Erlang node on OS X when the $HOME
directory contains non-ASCII characters. Is there some aspect of my
environment that I need to change or is this a bug in Erlang (I'm using
R15B)? Here is a transcript that demonstrates:

uname -v
Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010;
root:xnu-1504.7.4~1/RELEASE_I386

locale
LANG="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_CTYPE="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_ALL=

echo $HOME
/tmp/́À

erl -sname foo
{error_logger,{{2012,7,19},{11,33,22}},"Failed to create cookie file",[]}
{error_logger,{{2012,7,19},{11,33,22}},crash_report,[[{initial_call,{auth,init,['Argument__1']}},{pid,<0.18.0>},{registered_name,[]},{error_info,{exit,{"Failed
to create cookie
file",[{auth,init_cookie,0,[{file,"auth.erl"},{line,285}]},{auth,init,1,[{file,"auth.erl"},{line,139}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,297}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,321}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}},{ancestors,[net_sup,kernel_sup,<0.9.0>]},{messages,[]},{links,[<0.16.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,610},{stack_size,24},{reductions,548}],[]]}
{error_logger,{{2012,7,19},{11,33,22}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{"Failed
(Continue reading)

Emile Joubert | 19 Jul 2012 14:51
Favicon

Re: Non-ASCII $HOME crashed distributed Erlang on OS X

On 19/07/12 11:43, Emile Joubert wrote:
> environment that I need to change or is this a bug in Erlang (I'm using
> R15B)? Here is a transcript that demonstrates:

I've tried with R15B01 as well and get the same error.
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs

Diego Llarrull | 19 Jul 2012 15:58
Gravatar

Cover compiling of .beam files inside .ez archives, is it possible?

Good day to everyone,

I'm building a riak-core based application which relies con rebar + gnu make to generate deployment nodes (i.e: an embedded erts plus all source code and dependencies). Each app is stored in an .ez file inside the "lib" folder. No unzipping of the files in a special directory occurs in runtime because the code server is able to load .beam files from archives (tough experimentally, as stated in http://www.erlang.org/doc/man/code.html).

The cover server, instead, can't access such files, which makes it impossible to perform cover analysis in runtime (something we require because the modules to analyse rely on servers which are spawned on demand). My question would be the following:

1) Is it possible to cover compile the binaries at compile-time (i.e., before generating the node releases) ?
2) Is there any way to access the .ez files without unzipping them, so as to pass a reference to that file to cover:compile_beam() ?

(Note to rebar users: rebar eunit doesn't do the job for me, because it performs offline, static, coverage analysis).

Any help would be greatly appreciated.

Thanks in advance

Diego Llarrull
--
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Diego Llarrull | 19 Jul 2012 16:21
Gravatar

Re: Cover compiling of .beam files inside .ez archives, is it possible?

I'm very sorry, that mail was intended to erlang-questions, not 
erlang-bugs.

My apologies

El jue 19 jul 2012 10:58:12 ART, Diego Llarrull escribió:
> Good day to everyone,
>
> I'm building a riak-core based application which relies con rebar +
> gnu make to generate deployment nodes (i.e: an embedded erts plus all
> source code and dependencies). Each app is stored in an .ez file
> inside the "lib" folder. No unzipping of the files in a special
> directory occurs in runtime because the code server is able to load
> .beam files from archives (tough experimentally, as stated in
> http://www.erlang.org/doc/man/code.html).
>
> The cover server, instead, can't access such files, which makes it
> impossible to perform cover analysis in runtime (something we require
> because the modules to analyse rely on servers which are spawned on
> demand). My question would be the following:
>
> 1) Is it possible to cover compile the binaries at compile-time (i.e.,
> before generating the node releases) ?
> 2) Is there any way to access the .ez files without unzipping them, so
> as to pass a reference to that file to cover:compile_beam() ?
>
> (Note to rebar users: rebar eunit doesn't do the job for me, because
> it performs offline, static, coverage analysis).
>
> Any help would be greatly appreciated.
>
> Thanks in advance
>
> Diego Llarrull
> --
>
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs <at> erlang.org
> http://erlang.org/mailman/listinfo/erlang-bugs

--
<http://www.tecso.coop/><http://www.tecso.coop/>

	

*Lic. Diego Miguel Llarrull*LinkedIn
<http://ar.linkedin.com/pub/diego-llarrull/24/364/200>
diego.llarrull <at> tecso.coop <mailto:diego.llarrull <at> tecso.coop>
Tel: +54 341 527 4470 / +54 341 528 0080 / 0020
Sarmiento 784 Piso 1 - (CP 2000)
Rosario - Provincia de Santa Fe - Argentina

_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
pan | 19 Jul 2012 15:56
Favicon
Gravatar

Re: Non-ASCII $HOME crashed distributed Erlang on OS X

Hi!

On Thu, 19 Jul 2012, Emile Joubert wrote:

> Hi,
>
> I'm unable to start a distributed Erlang node on OS X when the $HOME
> directory contains non-ASCII characters. Is there some aspect of my
> environment that I need to change or is this a bug in Erlang (I'm using
> R15B)? Here is a transcript that demonstrates:
>
> uname -v
> Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010;
> root:xnu-1504.7.4~1/RELEASE_I386
>
> locale
> LANG="en_GB.UTF-8"
> LC_COLLATE="en_GB.UTF-8"
> LC_CTYPE="en_GB.UTF-8"
> LC_MESSAGES="en_GB.UTF-8"
> LC_MONETARY="en_GB.UTF-8"
> LC_NUMERIC="en_GB.UTF-8"
> LC_TIME="en_GB.UTF-8"
> LC_ALL=
>
> echo $HOME
> /tmp/ÿÿAÿÿ
>
> erl -sname foo
> {error_logger,{{2012,7,19},{11,33,22}},"Failed to create cookie file",[]}
> {error_logger,{{2012,7,19},{11,33,22}},crash_report,[[{initial_call,{auth,init,['Argument__1']}},{pid,<0.18.0>},{registered_name,[]},{error_info,{exit,{"Failed
> to create cookie
> file",[{auth,init_cookie,0,[{file,"auth.erl"},{line,285}]},{auth,init,1,[{file,"auth.erl"},{line,139}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,297}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,321}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}},{ancestors,[net_sup,kernel_sup,<0.9.0>]},{messages,[]},{links,[<0.16.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,610},{stack_size,24},{reductions,548}],[]]}
> {error_logger,{{2012,7,19},{11,33,22}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{"Failed
> to create cookie
> file",[{auth,init_cookie,0,[{file,"auth.erl"},{line,285}]},{auth,init,1,[{file,"auth.erl"},{line,139}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,297}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}},{offender,[{pid,undefined},{name,auth},{mfargs,{auth,start_link,[]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
> {error_logger,{{2012,7,19},{11,33,22}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,shutdown},{offender,[{pid,undefined},{name,net_sup},{mfargs,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]}
> {error_logger,{{2012,7,19},{11,33,22}},std_info,[{application,kernel},{exited,{shutdown,{kernel,start,[normal,[]]}}},{type,permanent}]}
> {"Kernel pid
> terminated",application_controller,"{application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}}"}

Yes, that's a reproducable bug allright. The environment  variable is in 
UTF8 and a *list* with UTF8 characters is passed to the file operation 
instead of a binary (or a list of unicode codepoints, which would also 
have worked)

Could you try the following source patch on kernel/auth.erl:
-----------------8><-----------------------------
*** auth.erl.old        2012-07-18 20:11:07.000000000 +0200
--- auth.erl    2012-07-19 15:52:57.000000000 +0200
***************
*** 298,304 ****
   read_cookie() ->
       case init:get_argument(home) of
         {ok, [[Home]]} ->
!           read_cookie(filename:join(Home, ".erlang.cookie"));
         _ ->
             {error, "No home for cookie file"}
       end.
--- 298,304 ----
   read_cookie() ->
       case init:get_argument(home) of
         {ok, [[Home]]} ->
!           read_cookie(filename:join(list_to_binary(Home), ".erlang.cookie"));
         _ ->
             {error, "No home for cookie file"}
       end.
-----------------8><-----------------------------
- and report back if that fixes your problem?

Cheers,
/Patrik

>
>
> -Emile
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs <at> erlang.org
> http://erlang.org/mailman/listinfo/erlang-bugs
>
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs
Emile Joubert | 19 Jul 2012 17:35
Favicon

Re: Non-ASCII $HOME crashed distributed Erlang on OS X

Hi,

On 19/07/12 14:56, pan <at> erlang.org wrote:
> Could you try the following source patch on kernel/auth.erl:
> -----------------8><-----------------------------

[...]

> -----------------8><-----------------------------
> - and report back if that fixes your problem?

Yes that does work for me, thanks! The cookie file gets created in the
folder containing non-ASCII characters and distributed Erlang starts up.

-Emile

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

pan | 20 Jul 2012 11:31
Favicon
Gravatar

Re: Non-ASCII $HOME crashed distributed Erlang on OS X

Hi!

On Thu, 19 Jul 2012, Emile Joubert wrote:

> Hi,
>
> On 19/07/12 14:56, pan <at> erlang.org wrote:
>> Could you try the following source patch on kernel/auth.erl:
>> -----------------8><-----------------------------
>
> [...]
>
>> -----------------8><-----------------------------
>> - and report back if that fixes your problem?
>
> Yes that does work for me, thanks! The cookie file gets created in the
> folder containing non-ASCII characters and distributed Erlang starts up.
Great!

I'll run it through the test suites then - if all goes well it will be 
included in the next service release.

Thanks for the bug report and fast feedback!
>
>
> -Emile
>
Cheers,
/Patrik
_______________________________________________
erlang-bugs mailing list
erlang-bugs <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-bugs


Gmane