eldap hangs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

eldap hangs

Technion

Hi,


I seem to have a replicable hang in the eldap module. Allow me to start with a working example. If it matters, the LDAP server is a Samba4 AD server. Before anyone asks, these are throw away passwords.


Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe]

Eshell V10.0  (abort with ^G)
1> ===> The rebar3 shell is a development tool; to deploy applications in production, consider using releases (http://www.rebar3.org/docs/releases)
===> Booted p3
===> Booted sasl

1> {ok, H} = eldap:open(["127.0.0.1"], [{port, 1636}, {ssl, true}, {timeout, 500}]).
{ok,<0.131.0>}
2> ok = eldap:simple_bind(H, "[hidden email]", "Kevin111").
ok

So we definitely have of using this. Now let's see what happens in a new session if we first get the username wrong, then try it correctly:

1> {ok, H} = eldap:open(["127.0.0.1"], [{port, 1636}, {ssl, true}, {timeout, 500}]).
{ok,<0.131.0>}
2>  ok = eldap:simple_bind(H, "Kevin", "Kevin111").
** exception error: no match of right hand side value {error,invalidCredentials}
3> ok = eldap:simple_bind(H, "[hidden email]", "Kevin111").
<indefinite hang>

Given I'm trying to build an interface where users can enter their own username, well it creates an easily hung session. The docs describe a timeout on open/2 but it obviously doesn't apply to everything. Given I"m not seeing any output at all I have no real idea where to debug this.


Any assistance appreciated.



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: eldap hangs

Dmitry Klionsky-2

The wrong password call raised an exception and the process behind H (<0.131.0> is dead.

And I think this is the reason of hang.


You can start your session with


> catch_exception(true).


This is catch exceptions and your H will survive the crash and should work.




On 06/29/2018 03:07 PM, Technion wrote:

Hi,


I seem to have a replicable hang in the eldap module. Allow me to start with a working example. If it matters, the LDAP server is a Samba4 AD server. Before anyone asks, these are throw away passwords.


Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe]

Eshell V10.0  (abort with ^G)
1> ===> The rebar3 shell is a development tool; to deploy applications in production, consider using releases (http://www.rebar3.org/docs/releases)
===> Booted p3
===> Booted sasl

1> {ok, H} = eldap:open(["127.0.0.1"], [{port, 1636}, {ssl, true}, {timeout, 500}]).
{ok,<0.131.0>}
2> ok = eldap:simple_bind(H, [hidden email], "Kevin111").
ok

So we definitely have of using this. Now let's see what happens in a new session if we first get the username wrong, then try it correctly:

1> {ok, H} = eldap:open(["127.0.0.1"], [{port, 1636}, {ssl, true}, {timeout, 500}]).
{ok,<0.131.0>}
2>  ok = eldap:simple_bind(H, "Kevin", "Kevin111").
** exception error: no match of right hand side value {error,invalidCredentials}
3> ok = eldap:simple_bind(H, [hidden email], "Kevin111").
<indefinite hang>

Given I'm trying to build an interface where users can enter their own username, well it creates an easily hung session. The docs describe a timeout on open/2 but it obviously doesn't apply to everything. Given I"m not seeing any output at all I have no real idea where to debug this.


Any assistance appreciated.




_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

-- 
BR,
Dmitry

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: eldap hangs

Technion

Hi Dmitry,


Thanks a heap, you are correct.


The process does disappear after the incorrect password.


10>  process_info(H).
undefined





From: [hidden email] <[hidden email]> on behalf of Dmitry Klionsky <[hidden email]>
Sent: Friday, 29 June 2018 10:14 PM
To: [hidden email]
Subject: Re: [erlang-questions] eldap hangs
 

The wrong password call raised an exception and the process behind H (<0.131.0> is dead.

And I think this is the reason of hang.


You can start your session with


> catch_exception(true).


This is catch exceptions and your H will survive the crash and should work.




On 06/29/2018 03:07 PM, Technion wrote:

Hi,


I seem to have a replicable hang in the eldap module. Allow me to start with a working example. If it matters, the LDAP server is a Samba4 AD server. Before anyone asks, these are throw away passwords.


Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe]

Eshell V10.0  (abort with ^G)
1> ===> The rebar3 shell is a development tool; to deploy applications in production, consider using releases (http://www.rebar3.org/docs/releases)
===> Booted p3
===> Booted sasl

1> {ok, H} = eldap:open(["127.0.0.1"], [{port, 1636}, {ssl, true}, {timeout, 500}]).
{ok,<0.131.0>}
2> ok = eldap:simple_bind(H, [hidden email], "Kevin111").
ok

So we definitely have of using this. Now let's see what happens in a new session if we first get the username wrong, then try it correctly:

1> {ok, H} = eldap:open(["127.0.0.1"], [{port, 1636}, {ssl, true}, {timeout, 500}]).
{ok,<0.131.0>}
2>  ok = eldap:simple_bind(H, "Kevin", "Kevin111").
** exception error: no match of right hand side value {error,invalidCredentials}
3> ok = eldap:simple_bind(H, [hidden email], "Kevin111").
<indefinite hang>

Given I'm trying to build an interface where users can enter their own username, well it creates an easily hung session. The docs describe a timeout on open/2 but it obviously doesn't apply to everything. Given I"m not seeing any output at all I have no real idea where to debug this.


Any assistance appreciated.




_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

-- 
BR,
Dmitry

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions