erlang module not in sticky dir?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

erlang module not in sticky dir?

Loïc Hoguin-2
A user got confused by pretty much this:

% erl
Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10]
[hipe] [kernel-poll:false]

Eshell V6.0  (abort with ^G)
1> l(erlang).
{module,erlang}
2> l(gen_server).
{error,sticky_directory}
3>
=ERROR REPORT==== 26-Apr-2014::20:56:37 ===
Can't load module that resides in sticky dir

For some reasons his erlang:apply/3 ended up not being a BIF anymore and
instead called erlang:apply/3 in a loop because the file contains:

apply(Mod, Name, Args) ->
     erlang:apply(Mod, Name, Args).

The file had been recompiled and reloaded automatically using the sync
application: https://github.com/rustyio/sync

Details are not important. I suggest however making the preloaded Erlang
modules be sticky by default to prevent awkward behavior such as this.

--
Lo?c Hoguin
http://ninenines.eu

Reply | Threaded
Open this post in threaded view
|

erlang module not in sticky dir?

Siri Hansen-3
Thanks for reporting! I have written a ticket for this.
Regards
/siri


2014-04-26 21:00 GMT+02:00 Lo?c Hoguin <essen>:

> A user got confused by pretty much this:
>
> % erl
> Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10]
> [hipe] [kernel-poll:false]
>
> Eshell V6.0  (abort with ^G)
> 1> l(erlang).
> {module,erlang}
> 2> l(gen_server).
> {error,sticky_directory}
> 3>
> =ERROR REPORT==== 26-Apr-2014::20:56:37 ===
> Can't load module that resides in sticky dir
>
> For some reasons his erlang:apply/3 ended up not being a BIF anymore and
> instead called erlang:apply/3 in a loop because the file contains:
>
> apply(Mod, Name, Args) ->
>     erlang:apply(Mod, Name, Args).
>
> The file had been recompiled and reloaded automatically using the sync
> application: https://github.com/rustyio/sync
>
> Details are not important. I suggest however making the preloaded Erlang
> modules be sticky by default to prevent awkward behavior such as this.
>
> --
> Lo?c Hoguin
> http://ninenines.eu
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs
> http://erlang.org/mailman/listinfo/erlang-bugs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140508/036cc08a/attachment.html>

Reply | Threaded
Open this post in threaded view
|

erlang module not in sticky dir?

Stavros Aronis-2
Somewhat related (posted earlier at
http://erlang.org/pipermail/erlang-bugs/2014-April/004300.html )

$ erl
Erlang/OTP 17 [erts-6.0] [source-07b8f44] [64-bit] [smp:8:8]
[async-threads:10] [hipe] [kernel-poll:false]

Eshell V6.0  (abort with ^G)
1> erlang:is_builtin(erlang,apply,3).
false

Regards,

Stavros


On Thu, May 8, 2014 at 10:58 AM, Siri Hansen <erlangsiri> wrote:

> Thanks for reporting! I have written a ticket for this.
> Regards
> /siri
>
>
> 2014-04-26 21:00 GMT+02:00 Lo?c Hoguin <essen>:
>
>> A user got confused by pretty much this:
>>
>> % erl
>> Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10]
>> [hipe] [kernel-poll:false]
>>
>> Eshell V6.0  (abort with ^G)
>> 1> l(erlang).
>> {module,erlang}
>> 2> l(gen_server).
>> {error,sticky_directory}
>> 3>
>> =ERROR REPORT==== 26-Apr-2014::20:56:37 ===
>> Can't load module that resides in sticky dir
>>
>> For some reasons his erlang:apply/3 ended up not being a BIF anymore and
>> instead called erlang:apply/3 in a loop because the file contains:
>>
>> apply(Mod, Name, Args) ->
>>     erlang:apply(Mod, Name, Args).
>>
>> The file had been recompiled and reloaded automatically using the sync
>> application: https://github.com/rustyio/sync
>>
>> Details are not important. I suggest however making the preloaded Erlang
>> modules be sticky by default to prevent awkward behavior such as this.
>>
>> --
>> Lo?c Hoguin
>> http://ninenines.eu
>> _______________________________________________
>> erlang-bugs mailing list
>> erlang-bugs
>> http://erlang.org/mailman/listinfo/erlang-bugs
>>
>
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs
> http://erlang.org/mailman/listinfo/erlang-bugs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140508/89ee753d/attachment.html>

Reply | Threaded
Open this post in threaded view
|

erlang module not in sticky dir?

Loïc Hoguin-2
There's also this which is just odd.

essen (20) % erl
Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10]
[hipe] [kernel-poll:false]

Eshell V6.0  (abort with ^G)
1> erlang:function_exported(erlang, apply, 3).
true
2> erlang:function_exported(erlang, is_map, 1).
false
3> erlang:function_exported(erlang, is_list, 1).
false

On 05/08/2014 11:59 AM, Stavros Aronis wrote:

> Somewhat related (posted earlier at
> http://erlang.org/pipermail/erlang-bugs/2014-April/004300.html )
>
> $ erl
> Erlang/OTP 17 [erts-6.0] [source-07b8f44] [64-bit] [smp:8:8]
> [async-threads:10] [hipe] [kernel-poll:false]
>
> Eshell V6.0  (abort with ^G)
> 1> erlang:is_builtin(erlang,apply,3).
> false
>
> Regards,
>
> Stavros
>
>
> On Thu, May 8, 2014 at 10:58 AM, Siri Hansen <erlangsiri
> <mailto:erlangsiri>> wrote:
>
>     Thanks for reporting! I have written a ticket for this.
>     Regards
>     /siri
>
>
>     2014-04-26 21:00 GMT+02:00 Lo?c Hoguin <essen
>     <mailto:essen>>:
>
>         A user got confused by pretty much this:
>
>         % erl
>         Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4]
>         [async-threads:10] [hipe] [kernel-poll:false]
>
>         Eshell V6.0  (abort with ^G)
>         1> l(erlang).
>         {module,erlang}
>         2> l(gen_server).
>         {error,sticky_directory}
>         3>
>         =ERROR REPORT==== 26-Apr-2014::20:56:37 ===
>         Can't load module that resides in sticky dir
>
>         For some reasons his erlang:apply/3 ended up not being a BIF
>         anymore and instead called erlang:apply/3 in a loop because the
>         file contains:
>
>         apply(Mod, Name, Args) ->
>              erlang:apply(Mod, Name, Args).
>
>         The file had been recompiled and reloaded automatically using
>         the sync application: https://github.com/rustyio/__sync
>         <https://github.com/rustyio/sync>
>
>         Details are not important. I suggest however making the
>         preloaded Erlang modules be sticky by default to prevent awkward
>         behavior such as this.
>
>         --
>         Lo?c Hoguin
>         http://ninenines.eu
>         _________________________________________________
>         erlang-bugs mailing list
>         erlang-bugs <mailto:erlang-bugs>
>         http://erlang.org/mailman/__listinfo/erlang-bugs
>         <http://erlang.org/mailman/listinfo/erlang-bugs>
>
>
>
>     _______________________________________________
>     erlang-bugs mailing list
>     erlang-bugs <mailto:erlang-bugs>
>     http://erlang.org/mailman/listinfo/erlang-bugs
>
>

--
Lo?c Hoguin
http://ninenines.eu

Reply | Threaded
Open this post in threaded view
|

erlang module not in sticky dir?

Björn Gustavsson-3
In reply to this post by Loïc Hoguin-2
On Sat, Apr 26, 2014 at 9:00 PM, Lo?c Hoguin <essen> wrote:

> Details are not important. I suggest however making the preloaded Erlang
> modules be sticky by default to prevent awkward behavior such as this.

Agreed, I except that I don't think it will should ever be allowed
to unstick a pre-loaded module.

We will fix this in the next maintenance release.

/Bjorn

--
Bj?rn Gustavsson, Erlang/OTP, Ericsson AB

Reply | Threaded
Open this post in threaded view
|

erlang module not in sticky dir?

Björn Gustavsson-3
In reply to this post by Loïc Hoguin-2
On Thu, May 8, 2014 at 2:01 PM, Lo?c Hoguin <essen> wrote:

> There's also this which is just odd.
>
> essen (20) % erl
>
> Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10]
> [hipe] [kernel-poll:false]
>
> Eshell V6.0  (abort with ^G)
> 1> erlang:function_exported(erlang, apply, 3).
> true
> 2> erlang:function_exported(erlang, is_map, 1).
> false
> 3> erlang:function_exported(erlang, is_list, 1).
> false
>

Yes, I agree. It's weird, especially since is_map/1
and is_list/1 are exported and have definitions in the
erlang module.

But since the documentation explicitly says that
erlang:function_exported/3 does not return true
for BIFs, and since it has behaved this way since
ancient times, we don't want to fix it in a minor
release. So we will fix it in 18.0.

/Bjorn

--
Bj?rn Gustavsson, Erlang/OTP, Ericsson AB

Reply | Threaded
Open this post in threaded view
|

erlang module not in sticky dir?

Björn Gustavsson-3
In reply to this post by Stavros Aronis-2
On Thu, May 8, 2014 at 11:59 AM, Stavros Aronis <aronisstav> wrote:

> Somewhat related (posted earlier at
> http://erlang.org/pipermail/erlang-bugs/2014-April/004300.html )
>
> $ erl
> Erlang/OTP 17 [erts-6.0] [source-07b8f44] [64-bit] [smp:8:8]
> [async-threads:10] [hipe] [kernel-poll:false]
>
> Eshell V6.0  (abort with ^G)
> 1> erlang:is_builtin(erlang,apply,3).
> false
>

I am not sure what to do about this one.
It is not really a BIF. It is defined in the
erlang module like this:

apply(Mod, Name, Args) ->
    erlang:apply(Mod, Name, Args).

That may seem a little bit strange, but it
works because the loader replaces the call
to erlang:apply/3 with an instruction.

Perhaps we should call it a built-in. After
all, it is implemented in C, but not in the same
way as (for example) is_list/1.

Any suggestions?

/Bjorn

--
Bj?rn Gustavsson, Erlang/OTP, Ericsson AB

Reply | Threaded
Open this post in threaded view
|

erlang module not in sticky dir?

Anthony Ramine-2
Hello Bj?rn,

I don?t like things being exported and being builtin not being advertised as such.

In the same vein, the pseudo-module erts_debug gets on my nerve too. I understand it?s an internal thing, but I don?t like lies.

Regards,

--
Anthony Ramine

Le 12 mai 2014 ? 12:41, Bj?rn Gustavsson <bjorn> a ?crit :

> On Thu, May 8, 2014 at 11:59 AM, Stavros Aronis <aronisstav> wrote:
>> Somewhat related (posted earlier at
>> http://erlang.org/pipermail/erlang-bugs/2014-April/004300.html )
>>
>> $ erl
>> Erlang/OTP 17 [erts-6.0] [source-07b8f44] [64-bit] [smp:8:8]
>> [async-threads:10] [hipe] [kernel-poll:false]
>>
>> Eshell V6.0  (abort with ^G)
>> 1> erlang:is_builtin(erlang,apply,3).
>> false
>>
>
> I am not sure what to do about this one.
> It is not really a BIF. It is defined in the
> erlang module like this:
>
> apply(Mod, Name, Args) ->
>    erlang:apply(Mod, Name, Args).
>
> That may seem a little bit strange, but it
> works because the loader replaces the call
> to erlang:apply/3 with an instruction.
>
> Perhaps we should call it a built-in. After
> all, it is implemented in C, but not in the same
> way as (for example) is_list/1.
>
> Any suggestions?
>
> /Bjorn
>
> --
> Bj?rn Gustavsson, Erlang/OTP, Ericsson AB
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs
> http://erlang.org/mailman/listinfo/erlang-bugs