What is the difference between runhaskell and compile?

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

What is the difference between runhaskell and compile?

Magicloud Magiclouds
Hi,
  I am writing a small program using LDAP hackage. A weird problem occured.
  When the code was run by runhaskell, things were fine, worked as expected.
  But when ghc compiled (no any args), and ran, I got this: LDAP
error: ldapSimpleBind: LDAPException LdapServerDown(-1): Can't contact
LDAP server.
  There is sure no problem with the server.
  So I am confused. I thought the two supposed to be the same.
--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Vincent Ambo
Can you paste your code somewhere? I'm using the LDAP package at work (for authenticating a Yesod app) and a quick test of the basic LDAP package in GHCi works for me:

λ> import LDAP
λ> ldap <- ldapInit "10.0.0.12" ldapPort
λ> ldapSimpleBind ldap "geva" "**********"
λ> let desiredAttr = LDAPAttrList ["name"]
λ> let searchDN = Just "OU=Redacted,DC=redacted,DC=com"
λ> let searchFilter = Just "sAMAccountName=geva"
λ> ldapSearch ldap searchDN LdapScopeSubtree searchFilter desiredAttr False
[LDAPEntry {ledn = "CN=Vincent Ambo,OU=Redacted,DC=redacted,DC=com", leattrs = [("name",["Vincent Ambo"])]}]

It also works in compiled applications and in source files run with runhaskell.

Our directory server runs Active Directory.

On May 24, 2012, at 11:36 AM, Magicloud Magiclouds wrote:

> Hi,
>  I am writing a small program using LDAP hackage. A weird problem occured.
>  When the code was run by runhaskell, things were fine, worked as expected.
>  But when ghc compiled (no any args), and ran, I got this: LDAP
> error: ldapSimpleBind: LDAPException LdapServerDown(-1): Can't contact
> LDAP server.
>  There is sure no problem with the server.
>  So I am confused. I thought the two supposed to be the same.
> --
> 竹密岂妨流水过
> 山高哪阻野云飞
>
> And for G+, please use magiclouds#gmail.com.
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Magicloud Magiclouds
Hi there,
  The code could not be simpler. Just ldapInit, ldapSimpleBind.
  I just found that the code works with ghci, too. So to sum up,
ghci/runhaskell works, ghc not.

On Thu, May 24, 2012 at 8:15 PM, Vincent Ambo <[hidden email]> wrote:

> Can you paste your code somewhere? I'm using the LDAP package at work (for authenticating a Yesod app) and a quick test of the basic LDAP package in GHCi works for me:
>
> λ> import LDAP
> λ> ldap <- ldapInit "10.0.0.12" ldapPort
> λ> ldapSimpleBind ldap "geva" "**********"
> λ> let desiredAttr = LDAPAttrList ["name"]
> λ> let searchDN = Just "OU=Redacted,DC=redacted,DC=com"
> λ> let searchFilter = Just "sAMAccountName=geva"
> λ> ldapSearch ldap searchDN LdapScopeSubtree searchFilter desiredAttr False
> [LDAPEntry {ledn = "CN=Vincent Ambo,OU=Redacted,DC=redacted,DC=com", leattrs = [("name",["Vincent Ambo"])]}]
>
> It also works in compiled applications and in source files run with runhaskell.
>
> Our directory server runs Active Directory.
>
> On May 24, 2012, at 11:36 AM, Magicloud Magiclouds wrote:
>
>> Hi,
>>  I am writing a small program using LDAP hackage. A weird problem occured.
>>  When the code was run by runhaskell, things were fine, worked as expected.
>>  But when ghc compiled (no any args), and ran, I got this: LDAP
>> error: ldapSimpleBind: LDAPException LdapServerDown(-1): Can't contact
>> LDAP server.
>>  There is sure no problem with the server.
>>  So I am confused. I thought the two supposed to be the same.
>> --
>> 竹密岂妨流水过
>> 山高哪阻野云飞
>>
>> And for G+, please use magiclouds#gmail.com.
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> [hidden email]
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Thomas DuBuisson
If it is simple then please paste it somewhere.  Perhaps stackoverflow
would be a better medium for this discussion.

-Thomas

On Thu, May 24, 2012 at 8:05 PM, Magicloud Magiclouds
<[hidden email]> wrote:

> Hi there,
>  The code could not be simpler. Just ldapInit, ldapSimpleBind.
>  I just found that the code works with ghci, too. So to sum up,
> ghci/runhaskell works, ghc not.
>
> On Thu, May 24, 2012 at 8:15 PM, Vincent Ambo <[hidden email]> wrote:
>> Can you paste your code somewhere? I'm using the LDAP package at work (for authenticating a Yesod app) and a quick test of the basic LDAP package in GHCi works for me:
>>
>> λ> import LDAP
>> λ> ldap <- ldapInit "10.0.0.12" ldapPort
>> λ> ldapSimpleBind ldap "geva" "**********"
>> λ> let desiredAttr = LDAPAttrList ["name"]
>> λ> let searchDN = Just "OU=Redacted,DC=redacted,DC=com"
>> λ> let searchFilter = Just "sAMAccountName=geva"
>> λ> ldapSearch ldap searchDN LdapScopeSubtree searchFilter desiredAttr False
>> [LDAPEntry {ledn = "CN=Vincent Ambo,OU=Redacted,DC=redacted,DC=com", leattrs = [("name",["Vincent Ambo"])]}]
>>
>> It also works in compiled applications and in source files run with runhaskell.
>>
>> Our directory server runs Active Directory.
>>
>> On May 24, 2012, at 11:36 AM, Magicloud Magiclouds wrote:
>>
>>> Hi,
>>>  I am writing a small program using LDAP hackage. A weird problem occured.
>>>  When the code was run by runhaskell, things were fine, worked as expected.
>>>  But when ghc compiled (no any args), and ran, I got this: LDAP
>>> error: ldapSimpleBind: LDAPException LdapServerDown(-1): Can't contact
>>> LDAP server.
>>>  There is sure no problem with the server.
>>>  So I am confused. I thought the two supposed to be the same.
>>> --
>>> 竹密岂妨流水过
>>> 山高哪阻野云飞
>>>
>>> And for G+, please use magiclouds#gmail.com.
>>>
>>> _______________________________________________
>>> Haskell-Cafe mailing list
>>> [hidden email]
>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>
>
>
> --
> 竹密岂妨流水过
> 山高哪阻野云飞
>
> And for G+, please use magiclouds#gmail.com.
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Brandon Allbery
In reply to this post by Magicloud Magiclouds
On Thu, May 24, 2012 at 11:05 PM, Magicloud Magiclouds <[hidden email]> wrote:
Hi there,
 The code could not be simpler. Just ldapInit, ldapSimpleBind.
 I just found that the code works with ghci, too. So to sum up,
ghci/runhaskell works, ghc not.

A possibility that occurs to me:  does it by any chance work with ghc -threaded?  Perhaps the issue relates to the different behavior of the threaded runtime (which is used automatically by ghci/runghc).
 
--
brandon s allbery                                      [hidden email]
wandering unix systems administrator (available)     (412) 475-9364 vm/sms


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Magicloud Magiclouds
Versions:
libldap2 2.4.28
LDAP 0.6.6
ghc 7.4.1

Code below:

import LDAP

main :: IO ()
main = do
  let domain = "vancloa.cn"
      bindDN = "CN=wangshida.admin,OU=admin_accounts,DC=vancloa,DC=cn"
      bindPW = "********"
      baseDN = Just "DC=vancloa,DC=cn"
      ldapFilter = Just ("(&(sAMAccountName=" ++ alias ++
")(&(objectClass=user)(!(ou=Recycle_Bin))))")
  ldap <- ldapInit domain ldapPort
  ldapSimpleBind ldap bindDN bindPW

And ghc -threaded does not help.

On Fri, May 25, 2012 at 11:20 AM, Brandon Allbery <[hidden email]> wrote:

> On Thu, May 24, 2012 at 11:05 PM, Magicloud Magiclouds
> <[hidden email]> wrote:
>>
>> Hi there,
>>  The code could not be simpler. Just ldapInit, ldapSimpleBind.
>>  I just found that the code works with ghci, too. So to sum up,
>> ghci/runhaskell works, ghc not.
>
>
> A possibility that occurs to me:  does it by any chance work with ghc
> -threaded?  Perhaps the issue relates to the different behavior of the
> threaded runtime (which is used automatically by ghci/runghc).
>
> --
> brandon s allbery                                      [hidden email]
> wandering unix systems administrator (available)     (412) 475-9364 vm/sms
>



--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Chris Dornan
In reply to this post by Brandon Allbery

I have been using LDAP with GHC without a problem – I get this error often but the problems have been with the configuration of the OpenLDAP client library or the OpenLDAP server.

 

We are all taking about LDAP-0.6.6? Which version of GHC are we talking about? (I don’t think I have tested this on GHC-7.4.1, and maybe the others haven’t either.)

 

Chris

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Brandon Allbery
Sent: 25 May 2012 04:21
To: Magicloud Magiclouds
Cc: Haskell-Cafe
Subject: Re: [Haskell-cafe] What is the difference between runhaskell and compile?

 

On Thu, May 24, 2012 at 11:05 PM, Magicloud Magiclouds <[hidden email]> wrote:

Hi there,
 The code could not be simpler. Just ldapInit, ldapSimpleBind.
 I just found that the code works with ghci, too. So to sum up,
ghci/runhaskell works, ghc not.

 

A possibility that occurs to me:  does it by any chance work with ghc -threaded?  Perhaps the issue relates to the different behavior of the threaded runtime (which is used automatically by ghci/runghc).

 

--
brandon s allbery                                      [hidden email]
wandering unix systems administrator (available)     (412) 475-9364 vm/sms


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Magicloud Magiclouds
Hi,
  Sorry for the delayed reply. I am using ghc 7.4.1 and LDAP 0.6.6.
  When you said "configuration of the OpenLDAP client library", may I
have more information? Since ldap-utils and other client (php, perl,
etc) do not have any problem. This might be the only clue to me.

On Fri, May 25, 2012 at 4:43 PM, Chris Dornan <[hidden email]> wrote:

> I have been using LDAP with GHC without a problem – I get this error often
> but the problems have been with the configuration of the OpenLDAP client
> library or the OpenLDAP server.
>
>
>
> We are all taking about LDAP-0.6.6? Which version of GHC are we talking
> about? (I don’t think I have tested this on GHC-7.4.1, and maybe the others
> haven’t either.)
>
>
>
> Chris
>
>
>
>
>
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Brandon Allbery
> Sent: 25 May 2012 04:21
> To: Magicloud Magiclouds
> Cc: Haskell-Cafe
> Subject: Re: [Haskell-cafe] What is the difference between runhaskell and
> compile?
>
>
>
> On Thu, May 24, 2012 at 11:05 PM, Magicloud Magiclouds
> <[hidden email]> wrote:
>
> Hi there,
>  The code could not be simpler. Just ldapInit, ldapSimpleBind.
>  I just found that the code works with ghci, too. So to sum up,
> ghci/runhaskell works, ghc not.
>
>
>
> A possibility that occurs to me:  does it by any chance work with ghc
> -threaded?  Perhaps the issue relates to the different behavior of the
> threaded runtime (which is used automatically by ghci/runghc).
>
>
>
> --
> brandon s allbery                                      [hidden email]
> wandering unix systems administrator (available)     (412) 475-9364 vm/sms



--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Chris Dornan
By configuration of the OpenLDAP client library I mean mostly so that SSL connections will work, but this is all system-level configuration.

That GHC establishes connections in interactive mode for you indicates that the problem is not with the LDAP systems, but that something peculiar is going wrong with your GHC installation.

Do you have only the one GHC installation on the system; is there any chance that ghc and ghci could be selecting different installations?

Is it easy for you to try connecting with GHC-7.0.4? It would be worth a try if you can -- it might be a 7.4.1 oddity but it looks as if it could be some kind of GHC mis-installation.

(If trying this with GHC-7.0.4 would be bothersome I would be interested to hear more; which O/S are you using?)

Chris

-----Original Message-----
From: Magicloud Magiclouds [mailto:[hidden email]]
Sent: 27 May 2012 10:12
To: Chris Dornan
Cc: Brandon Allbery; Haskell-Cafe
Subject: Re: [Haskell-cafe] What is the difference between runhaskell and compile?

Hi,
  Sorry for the delayed reply. I am using ghc 7.4.1 and LDAP 0.6.6.
  When you said "configuration of the OpenLDAP client library", may I have more information? Since ldap-utils and other client (php, perl,
etc) do not have any problem. This might be the only clue to me.

On Fri, May 25, 2012 at 4:43 PM, Chris Dornan <[hidden email]> wrote:

> I have been using LDAP with GHC without a problem – I get this error
> often but the problems have been with the configuration of the
> OpenLDAP client library or the OpenLDAP server.
>
>
>
> We are all taking about LDAP-0.6.6? Which version of GHC are we
> talking about? (I don’t think I have tested this on GHC-7.4.1, and
> maybe the others haven’t either.)
>
>
>
> Chris
>
>
>
>
>
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Brandon Allbery
> Sent: 25 May 2012 04:21
> To: Magicloud Magiclouds
> Cc: Haskell-Cafe
> Subject: Re: [Haskell-cafe] What is the difference between runhaskell
> and compile?
>
>
>
> On Thu, May 24, 2012 at 11:05 PM, Magicloud Magiclouds
> <[hidden email]> wrote:
>
> Hi there,
>  The code could not be simpler. Just ldapInit, ldapSimpleBind.
>  I just found that the code works with ghci, too. So to sum up,
> ghci/runhaskell works, ghc not.
>
>
>
> A possibility that occurs to me:  does it by any chance work with ghc
> -threaded?  Perhaps the issue relates to the different behavior of the
> threaded runtime (which is used automatically by ghci/runghc).
>
>
>
> --
> brandon s allbery                                      
> [hidden email] wandering unix systems administrator (available)    
> (412) 475-9364 vm/sms



--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

ozataman
In reply to this post by Magicloud Magiclouds
Maybe try with "ghc --make -O0". Afaik, ghci and runhaskell don't do any optimization, which could be the difference.



On May 27, 2012, at 5:12 PM, Magicloud Magiclouds <[hidden email]> wrote:

> Hi,
>  Sorry for the delayed reply. I am using ghc 7.4.1 and LDAP 0.6.6.
>  When you said "configuration of the OpenLDAP client library", may I
> have more information? Since ldap-utils and other client (php, perl,
> etc) do not have any problem. This might be the only clue to me.
>
> On Fri, May 25, 2012 at 4:43 PM, Chris Dornan <[hidden email]> wrote:
>> I have been using LDAP with GHC without a problem – I get this error often
>> but the problems have been with the configuration of the OpenLDAP client
>> library or the OpenLDAP server.
>>
>>
>>
>> We are all taking about LDAP-0.6.6? Which version of GHC are we talking
>> about? (I don’t think I have tested this on GHC-7.4.1, and maybe the others
>> haven’t either.)
>>
>>
>>
>> Chris
>>
>>
>>
>>
>>
>> From: [hidden email]
>> [mailto:[hidden email]] On Behalf Of Brandon Allbery
>> Sent: 25 May 2012 04:21
>> To: Magicloud Magiclouds
>> Cc: Haskell-Cafe
>> Subject: Re: [Haskell-cafe] What is the difference between runhaskell and
>> compile?
>>
>>
>>
>> On Thu, May 24, 2012 at 11:05 PM, Magicloud Magiclouds
>> <[hidden email]> wrote:
>>
>> Hi there,
>>  The code could not be simpler. Just ldapInit, ldapSimpleBind.
>>  I just found that the code works with ghci, too. So to sum up,
>> ghci/runhaskell works, ghc not.
>>
>>
>>
>> A possibility that occurs to me:  does it by any chance work with ghc
>> -threaded?  Perhaps the issue relates to the different behavior of the
>> threaded runtime (which is used automatically by ghci/runghc).
>>
>>
>>
>> --
>> brandon s allbery                                      [hidden email]
>> wandering unix systems administrator (available)     (412) 475-9364 vm/sms
>
>
>
> --
> 竹密岂妨流水过
> 山高哪阻野云飞
>
> And for G+, please use magiclouds#gmail.com.
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Magicloud Magiclouds
In reply to this post by Chris Dornan
Alright, with another box of different version of ghc and things. I
finally got the cause.
Or may I say as simple as Ozgun said, ghc 7.4.1 defaultly uses
optimization. ghc-7.4.1 -O0 works. ghc-7.2.2 also works.

Thank you all.

On Sun, May 27, 2012 at 7:07 PM, Chris Dornan <[hidden email]> wrote:

> By configuration of the OpenLDAP client library I mean mostly so that SSL connections will work, but this is all system-level configuration.
>
> That GHC establishes connections in interactive mode for you indicates that the problem is not with the LDAP systems, but that something peculiar is going wrong with your GHC installation.
>
> Do you have only the one GHC installation on the system; is there any chance that ghc and ghci could be selecting different installations?
>
> Is it easy for you to try connecting with GHC-7.0.4? It would be worth a try if you can -- it might be a 7.4.1 oddity but it looks as if it could be some kind of GHC mis-installation.
>
> (If trying this with GHC-7.0.4 would be bothersome I would be interested to hear more; which O/S are you using?)
>
> Chris
>
> -----Original Message-----
> From: Magicloud Magiclouds [mailto:[hidden email]]
> Sent: 27 May 2012 10:12
> To: Chris Dornan
> Cc: Brandon Allbery; Haskell-Cafe
> Subject: Re: [Haskell-cafe] What is the difference between runhaskell and compile?
>
> Hi,
>  Sorry for the delayed reply. I am using ghc 7.4.1 and LDAP 0.6.6.
>  When you said "configuration of the OpenLDAP client library", may I have more information? Since ldap-utils and other client (php, perl,
> etc) do not have any problem. This might be the only clue to me.
>
> On Fri, May 25, 2012 at 4:43 PM, Chris Dornan <[hidden email]> wrote:
>> I have been using LDAP with GHC without a problem – I get this error
>> often but the problems have been with the configuration of the
>> OpenLDAP client library or the OpenLDAP server.
>>
>>
>>
>> We are all taking about LDAP-0.6.6? Which version of GHC are we
>> talking about? (I don’t think I have tested this on GHC-7.4.1, and
>> maybe the others haven’t either.)
>>
>>
>>
>> Chris
>>
>>
>>
>>
>>
>> From: [hidden email]
>> [mailto:[hidden email]] On Behalf Of Brandon Allbery
>> Sent: 25 May 2012 04:21
>> To: Magicloud Magiclouds
>> Cc: Haskell-Cafe
>> Subject: Re: [Haskell-cafe] What is the difference between runhaskell
>> and compile?
>>
>>
>>
>> On Thu, May 24, 2012 at 11:05 PM, Magicloud Magiclouds
>> <[hidden email]> wrote:
>>
>> Hi there,
>>  The code could not be simpler. Just ldapInit, ldapSimpleBind.
>>  I just found that the code works with ghci, too. So to sum up,
>> ghci/runhaskell works, ghc not.
>>
>>
>>
>> A possibility that occurs to me:  does it by any chance work with ghc
>> -threaded?  Perhaps the issue relates to the different behavior of the
>> threaded runtime (which is used automatically by ghci/runghc).
>>
>>
>>
>> --
>> brandon s allbery
>> [hidden email] wandering unix systems administrator (available)
>> (412) 475-9364 vm/sms
>
>
>
> --
> 竹密岂妨流水过
> 山高哪阻野云飞
>
> And for G+, please use magiclouds#gmail.com.
>



--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Magicloud Magiclouds
Sorry for the wrong information. I made a mistake when did the test.
After more testing, I think it is a bug of ghc 7.4.1. Until now, I
cannot find a way to make ghc 7.4.1 compiled binary work.

On Mon, May 28, 2012 at 11:01 AM, Magicloud Magiclouds
<[hidden email]> wrote:

> Alright, with another box of different version of ghc and things. I
> finally got the cause.
> Or may I say as simple as Ozgun said, ghc 7.4.1 defaultly uses
> optimization. ghc-7.4.1 -O0 works. ghc-7.2.2 also works.
>
> Thank you all.
>
> On Sun, May 27, 2012 at 7:07 PM, Chris Dornan <[hidden email]> wrote:
>> By configuration of the OpenLDAP client library I mean mostly so that SSL connections will work, but this is all system-level configuration.
>>
>> That GHC establishes connections in interactive mode for you indicates that the problem is not with the LDAP systems, but that something peculiar is going wrong with your GHC installation.
>>
>> Do you have only the one GHC installation on the system; is there any chance that ghc and ghci could be selecting different installations?
>>
>> Is it easy for you to try connecting with GHC-7.0.4? It would be worth a try if you can -- it might be a 7.4.1 oddity but it looks as if it could be some kind of GHC mis-installation.
>>
>> (If trying this with GHC-7.0.4 would be bothersome I would be interested to hear more; which O/S are you using?)
>>
>> Chris
>>
>> -----Original Message-----
>> From: Magicloud Magiclouds [mailto:[hidden email]]
>> Sent: 27 May 2012 10:12
>> To: Chris Dornan
>> Cc: Brandon Allbery; Haskell-Cafe
>> Subject: Re: [Haskell-cafe] What is the difference between runhaskell and compile?
>>
>> Hi,
>>  Sorry for the delayed reply. I am using ghc 7.4.1 and LDAP 0.6.6.
>>  When you said "configuration of the OpenLDAP client library", may I have more information? Since ldap-utils and other client (php, perl,
>> etc) do not have any problem. This might be the only clue to me.
>>
>> On Fri, May 25, 2012 at 4:43 PM, Chris Dornan <[hidden email]> wrote:
>>> I have been using LDAP with GHC without a problem – I get this error
>>> often but the problems have been with the configuration of the
>>> OpenLDAP client library or the OpenLDAP server.
>>>
>>>
>>>
>>> We are all taking about LDAP-0.6.6? Which version of GHC are we
>>> talking about? (I don’t think I have tested this on GHC-7.4.1, and
>>> maybe the others haven’t either.)
>>>
>>>
>>>
>>> Chris
>>>
>>>
>>>
>>>
>>>
>>> From: [hidden email]
>>> [mailto:[hidden email]] On Behalf Of Brandon Allbery
>>> Sent: 25 May 2012 04:21
>>> To: Magicloud Magiclouds
>>> Cc: Haskell-Cafe
>>> Subject: Re: [Haskell-cafe] What is the difference between runhaskell
>>> and compile?
>>>
>>>
>>>
>>> On Thu, May 24, 2012 at 11:05 PM, Magicloud Magiclouds
>>> <[hidden email]> wrote:
>>>
>>> Hi there,
>>>  The code could not be simpler. Just ldapInit, ldapSimpleBind.
>>>  I just found that the code works with ghci, too. So to sum up,
>>> ghci/runhaskell works, ghc not.
>>>
>>>
>>>
>>> A possibility that occurs to me:  does it by any chance work with ghc
>>> -threaded?  Perhaps the issue relates to the different behavior of the
>>> threaded runtime (which is used automatically by ghci/runghc).
>>>
>>>
>>>
>>> --
>>> brandon s allbery
>>> [hidden email] wandering unix systems administrator (available)
>>> (412) 475-9364 vm/sms
>>
>>
>>
>> --
>> 竹密岂妨流水过
>> 山高哪阻野云飞
>>
>> And for G+, please use magiclouds#gmail.com.
>>
>
>
>
> --
> 竹密岂妨流水过
> 山高哪阻野云飞
>
> And for G+, please use magiclouds#gmail.com.



--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Chris Dornan

> Sorry for the wrong information. I made a mistake when did the test.
> After more testing, I think it is a bug of ghc 7.4.1. Until now, I cannot find a way to make ghc 7.4.1 compiled binary work.

It sounds like this should be looked at further. Somebody should verify try to repeat what you are seeing on 7.4.1. The release candidate for 7.4.2 should also be tried.

(I will see if I can get time to do it myself.)

Chris



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Chris Dornan
In reply to this post by Magicloud Magiclouds
> Sorry for the wrong information. I made a mistake when did the test.
> After more testing, I think it is a bug of ghc 7.4.1. Until now, I cannot find a way to make ghc 7.4.1 compiled binary work.

I have set up this test on 7.4.1 and I cannot recreate the problem -- compiling and running an equivalent program (the posted program with local domain, bindDN and bindPW definitions localised and all other let bindings removed) leads to a successful server connection when passed the right password but fails to connect with the wrong password.

This was the behaviour you were seeing yourself with 7.2.2 was it not? I can only recommend re-installing 7.4.1 and trying again.

Chris



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Magicloud Magiclouds
Interesting. I have this code tested in Debian unstable/stable, CentOS
6.1, all 64 bit, with two different version of libldap2.
At first, Debian-s were installed with 7.4.1, CentOS with 7.2.2. Only
in CentOS the code connected after compiled.
Then I removed 7.4.1 from Debian stable and installed 7.2.2. The code worked.
At last, I installed 7.4.1 in CentOS. The code did not work.

Could you send the .hi/.o to me, so maybe I could find out the
different? Also the exact original source.
Thank you.

On Mon, May 28, 2012 at 6:27 PM, Chris Dornan <[hidden email]> wrote:

>> Sorry for the wrong information. I made a mistake when did the test.
>> After more testing, I think it is a bug of ghc 7.4.1. Until now, I cannot find a way to make ghc 7.4.1 compiled binary work.
>
> I have set up this test on 7.4.1 and I cannot recreate the problem -- compiling and running an equivalent program (the posted program with local domain, bindDN and bindPW definitions localised and all other let bindings removed) leads to a successful server connection when passed the right password but fails to connect with the wrong password.
>
> This was the behaviour you were seeing yourself with 7.2.2 was it not? I can only recommend re-installing 7.4.1 and trying again.
>
> Chris
>
>



--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Chris Dornan
On 29 May 2012 02:21, Magicloud Magiclouds
<[hidden email]> wrote:

> Interesting. I have this code tested in Debian unstable/stable, CentOS
> 6.1, all 64 bit, with two different version of libldap2.
> At first, Debian-s were installed with 7.4.1, CentOS with 7.2.2. Only
> in CentOS the code connected after compiled.
> Then I removed 7.4.1 from Debian stable and installed 7.2.2. The code worked.
> At last, I installed 7.4.1 in CentOS. The code did not work.
>
> Could you send the .hi/.o to me, so maybe I could find out the
> different? Also the exact original source.
> Thank you.

Interesting indeed! I am guessing that you are using the GHC-7.4.1
bindist from haskell.org.

I will try and find some time to marshal the source code and
intermediate files (am on the road --
will need to collect it from base, make it generic etc.).

You might also like to try the http://justhub.org ghc-7.4.1-hub on
your CentOS-6.1 node. It is a
separate build from the haskell.org bindist and comes with it's own
in-board gcc (4.6.1) and binutils (2.21)
used for the build. It should work for you.

(You could also try ghc-7.4.2-RC1-hub.)

Chris

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Chris Dornan
In reply to this post by Magicloud Magiclouds
I will send the header and object files off list.

Here is the test program I am using:

import LDAP

main :: IO ()
main =
     do putStrLn "domain>"
        domain <- getLine
        putStrLn "bindDN>"
        bindDN <- getLine
        putStrLn "bindPW>"
        bindPW <- getLine
        putStrLn "conecting..."
        ldap <- ldapInit domain ldapPort
        ldapSimpleBind ldap bindDN bindPW
        putStrLn "done"

Chris

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Magicloud Magiclouds
In reply to this post by Chris Dornan
A little information.
I did not notice the gcc/binutils versions. But in CentOS, the ghc
7.2.2/7.4.1 were all compiled myself with all default configurations.

On Tue, May 29, 2012 at 10:54 PM, Chris Dornan <[hidden email]> wrote:

> On 29 May 2012 02:21, Magicloud Magiclouds
> <[hidden email]> wrote:
>> Interesting. I have this code tested in Debian unstable/stable, CentOS
>> 6.1, all 64 bit, with two different version of libldap2.
>> At first, Debian-s were installed with 7.4.1, CentOS with 7.2.2. Only
>> in CentOS the code connected after compiled.
>> Then I removed 7.4.1 from Debian stable and installed 7.2.2. The code worked.
>> At last, I installed 7.4.1 in CentOS. The code did not work.
>>
>> Could you send the .hi/.o to me, so maybe I could find out the
>> different? Also the exact original source.
>> Thank you.
>
> Interesting indeed! I am guessing that you are using the GHC-7.4.1
> bindist from haskell.org.
>
> I will try and find some time to marshal the source code and
> intermediate files (am on the road --
> will need to collect it from base, make it generic etc.).
>
> You might also like to try the http://justhub.org ghc-7.4.1-hub on
> your CentOS-6.1 node. It is a
> separate build from the haskell.org bindist and comes with it's own
> in-board gcc (4.6.1) and binutils (2.21)
> used for the build. It should work for you.
>
> (You could also try ghc-7.4.2-RC1-hub.)
>
> Chris



--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Magicloud Magiclouds
OK. Finally this problem totally prevents my project from working.
By some guy's suggestion, I did a packet capturing, which really
showed a difference.
The rwdc file is for a ldap that at our IDC, which did not work with
compiled binary. The rodc file is for a ldap that at local, which
worked all the time. Each file contains two parts of records, at 3.*
sec and 6/7.* sec. The 3.* part is for runhaskell way. The 6/7.* part
is for compiled binary way.
The big difference here is: the failed one sent unbindRequest before
got bindResponse success.
Just a clue, I have no idea what is going on....

On Fri, Jun 1, 2012 at 5:17 PM, Chris Dornan <[hidden email]> wrote:

> No problem -- I have attached the executable too.
>
> Chris
>
> -----Original Message-----
> From: Magicloud Magiclouds [mailto:[hidden email]]
> Sent: 01 June 2012 02:01
> To: Chris Dornan
> Subject: Re: [Haskell-cafe] What is the difference between runhaskell and compile?
>
> I see.
> Although I am using a UTF-8 environment, but all string I was using were ASCIIs.
> If it is not too much trouble, may I have your LDAP compiled library files? I think since the Main.o is identical, maybe the libraries are different.
>
> On Thu, May 31, 2012 at 2:09 PM, Chris Dornan <[hidden email]> wrote:
>> I wouldn't pay too much attention to the fact that the hash tags are
>> different -- they are very unlikely to be the same across two
>> installations. (For example, my GHC installations are relocated under
>> /usr/hs, immediately changing the contents of all of the .conf files
>> and therefore the hashes.)
>>
>> The object files are more interesting, and they are identical!
>>
>> At the moment I can only explain what we are seeing by assuming that some change has affected the GHC 7.4.1 runtime system -- but only for compiled programs.
>>
>> Are you using non-ASCII characters in your LDAP passwords? I am thinking that maybe the compiled 7.4.1 could be using a different LOCALE from everything else, leading in some way to the passwords being encoded differently en route to the LDAP server. I don't know whether this could actually happen, but it is the kind of mechanism that seem most likely to be causing the problem.
>>
>> Did you try to running the variants that read address, account and passwords from standard input? Did it show the same perverse behaviour?
>>
>> Chris
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Magicloud Magiclouds [mailto:[hidden email]]
>> Sent: 31 May 2012 02:47
>> To: Chris Dornan
>> Subject: Re: [Haskell-cafe] What is the difference between runhaskell and compile?
>>
>> Hi,
>>  I have compared the files. The .o-es are exactly the same. The .hi-s are different.
>>  The interface hash, flag hash, and "import  -/ LDAP-0.6.6:LDAP.Constants xxxxx(hash)" are different.
>>  I do not know why only this module (LDAP.Constants) has a different hash. I am not quite familiar with ghc compiling process. May I know your conclusion?
>>
>> On Wed, May 30, 2012 at 3:50 PM, Chris Dornan <[hidden email]> wrote:
>>> Did you carry out a standard (optimised) build to get ghc-7.4.1?
>>>
>>> Are you going to try the justhub rpms or compare the object/header files I sent.
>>>
>>> Chris
>>>
>>> -----Original Message-----
>>> From: Magicloud Magiclouds [mailto:[hidden email]]
>>> Sent: 30 May 2012 04:07
>>> To: Chris Dornan
>>> Cc: Haskell-Cafe
>>> Subject: Re: [Haskell-cafe] What is the difference between runhaskell and compile?
>>>
>>> A little information.
>>> I did not notice the gcc/binutils versions. But in CentOS, the ghc
>>> 7.2.2/7.4.1 were all compiled myself with all default configurations.
>>>
>>> On Tue, May 29, 2012 at 10:54 PM, Chris Dornan <[hidden email]> wrote:
>>>> On 29 May 2012 02:21, Magicloud Magiclouds
>>>> <[hidden email]> wrote:
>>>>> Interesting. I have this code tested in Debian unstable/stable,
>>>>> CentOS 6.1, all 64 bit, with two different version of libldap2.
>>>>> At first, Debian-s were installed with 7.4.1, CentOS with 7.2.2.
>>>>> Only in CentOS the code connected after compiled.
>>>>> Then I removed 7.4.1 from Debian stable and installed 7.2.2. The code worked.
>>>>> At last, I installed 7.4.1 in CentOS. The code did not work.
>>>>>
>>>>> Could you send the .hi/.o to me, so maybe I could find out the
>>>>> different? Also the exact original source.
>>>>> Thank you.
>>>>
>>>> Interesting indeed! I am guessing that you are using the GHC-7.4.1
>>>> bindist from haskell.org.
>>>>
>>>> I will try and find some time to marshal the source code and
>>>> intermediate files (am on the road -- will need to collect it from
>>>> base, make it generic etc.).
>>>>
>>>> You might also like to try the http://justhub.org ghc-7.4.1-hub on
>>>> your CentOS-6.1 node. It is a separate build from the haskell.org
>>>> bindist and comes with it's own in-board gcc (4.6.1) and binutils
>>>> (2.21) used for the build. It should work for you.
>>>>
>>>> (You could also try ghc-7.4.2-RC1-hub.)
>>>>
>>>> Chris
>>>
>>>
>>>
>>> --
>>> 竹密岂妨流水过
>>> 山高哪阻野云飞
>>>
>>> And for G+, please use magiclouds#gmail.com.
>>>
>>
>>
>>
>> --
>> 竹密岂妨流水过
>> 山高哪阻野云飞
>>
>> And for G+, please use magiclouds#gmail.com.
>>
>
>
>
> --
> 竹密岂妨流水过
> 山高哪阻野云飞
>
> And for G+, please use magiclouds#gmail.com.



--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between runhaskell and compile?

Magicloud Magiclouds
Sorry for the attachments. They are wireshark files.

On Thu, Jul 12, 2012 at 9:35 AM, Magicloud Magiclouds
<[hidden email]> wrote:

> OK. Finally this problem totally prevents my project from working.
> By some guy's suggestion, I did a packet capturing, which really
> showed a difference.
> The rwdc file is for a ldap that at our IDC, which did not work with
> compiled binary. The rodc file is for a ldap that at local, which
> worked all the time. Each file contains two parts of records, at 3.*
> sec and 6/7.* sec. The 3.* part is for runhaskell way. The 6/7.* part
> is for compiled binary way.
> The big difference here is: the failed one sent unbindRequest before
> got bindResponse success.
> Just a clue, I have no idea what is going on....
>
> On Fri, Jun 1, 2012 at 5:17 PM, Chris Dornan <[hidden email]> wrote:
>> No problem -- I have attached the executable too.
>>
>> Chris
>>
>> -----Original Message-----
>> From: Magicloud Magiclouds [mailto:[hidden email]]
>> Sent: 01 June 2012 02:01
>> To: Chris Dornan
>> Subject: Re: [Haskell-cafe] What is the difference between runhaskell and compile?
>>
>> I see.
>> Although I am using a UTF-8 environment, but all string I was using were ASCIIs.
>> If it is not too much trouble, may I have your LDAP compiled library files? I think since the Main.o is identical, maybe the libraries are different.
>>
>> On Thu, May 31, 2012 at 2:09 PM, Chris Dornan <[hidden email]> wrote:
>>> I wouldn't pay too much attention to the fact that the hash tags are
>>> different -- they are very unlikely to be the same across two
>>> installations. (For example, my GHC installations are relocated under
>>> /usr/hs, immediately changing the contents of all of the .conf files
>>> and therefore the hashes.)
>>>
>>> The object files are more interesting, and they are identical!
>>>
>>> At the moment I can only explain what we are seeing by assuming that some change has affected the GHC 7.4.1 runtime system -- but only for compiled programs.
>>>
>>> Are you using non-ASCII characters in your LDAP passwords? I am thinking that maybe the compiled 7.4.1 could be using a different LOCALE from everything else, leading in some way to the passwords being encoded differently en route to the LDAP server. I don't know whether this could actually happen, but it is the kind of mechanism that seem most likely to be causing the problem.
>>>
>>> Did you try to running the variants that read address, account and passwords from standard input? Did it show the same perverse behaviour?
>>>
>>> Chris
>>>
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Magicloud Magiclouds [mailto:[hidden email]]
>>> Sent: 31 May 2012 02:47
>>> To: Chris Dornan
>>> Subject: Re: [Haskell-cafe] What is the difference between runhaskell and compile?
>>>
>>> Hi,
>>>  I have compared the files. The .o-es are exactly the same. The .hi-s are different.
>>>  The interface hash, flag hash, and "import  -/ LDAP-0.6.6:LDAP.Constants xxxxx(hash)" are different.
>>>  I do not know why only this module (LDAP.Constants) has a different hash. I am not quite familiar with ghc compiling process. May I know your conclusion?
>>>
>>> On Wed, May 30, 2012 at 3:50 PM, Chris Dornan <[hidden email]> wrote:
>>>> Did you carry out a standard (optimised) build to get ghc-7.4.1?
>>>>
>>>> Are you going to try the justhub rpms or compare the object/header files I sent.
>>>>
>>>> Chris
>>>>
>>>> -----Original Message-----
>>>> From: Magicloud Magiclouds [mailto:[hidden email]]
>>>> Sent: 30 May 2012 04:07
>>>> To: Chris Dornan
>>>> Cc: Haskell-Cafe
>>>> Subject: Re: [Haskell-cafe] What is the difference between runhaskell and compile?
>>>>
>>>> A little information.
>>>> I did not notice the gcc/binutils versions. But in CentOS, the ghc
>>>> 7.2.2/7.4.1 were all compiled myself with all default configurations.
>>>>
>>>> On Tue, May 29, 2012 at 10:54 PM, Chris Dornan <[hidden email]> wrote:
>>>>> On 29 May 2012 02:21, Magicloud Magiclouds
>>>>> <[hidden email]> wrote:
>>>>>> Interesting. I have this code tested in Debian unstable/stable,
>>>>>> CentOS 6.1, all 64 bit, with two different version of libldap2.
>>>>>> At first, Debian-s were installed with 7.4.1, CentOS with 7.2.2.
>>>>>> Only in CentOS the code connected after compiled.
>>>>>> Then I removed 7.4.1 from Debian stable and installed 7.2.2. The code worked.
>>>>>> At last, I installed 7.4.1 in CentOS. The code did not work.
>>>>>>
>>>>>> Could you send the .hi/.o to me, so maybe I could find out the
>>>>>> different? Also the exact original source.
>>>>>> Thank you.
>>>>>
>>>>> Interesting indeed! I am guessing that you are using the GHC-7.4.1
>>>>> bindist from haskell.org.
>>>>>
>>>>> I will try and find some time to marshal the source code and
>>>>> intermediate files (am on the road -- will need to collect it from
>>>>> base, make it generic etc.).
>>>>>
>>>>> You might also like to try the http://justhub.org ghc-7.4.1-hub on
>>>>> your CentOS-6.1 node. It is a separate build from the haskell.org
>>>>> bindist and comes with it's own in-board gcc (4.6.1) and binutils
>>>>> (2.21) used for the build. It should work for you.
>>>>>
>>>>> (You could also try ghc-7.4.2-RC1-hub.)
>>>>>
>>>>> Chris
>>>>
>>>>
>>>>
>>>> --
>>>> 竹密岂妨流水过
>>>> 山高哪阻野云飞
>>>>
>>>> And for G+, please use magiclouds#gmail.com.
>>>>
>>>
>>>
>>>
>>> --
>>> 竹密岂妨流水过
>>> 山高哪阻野云飞
>>>
>>> And for G+, please use magiclouds#gmail.com.
>>>
>>
>>
>>
>> --
>> 竹密岂妨流水过
>> 山高哪阻野云飞
>>
>> And for G+, please use magiclouds#gmail.com.
>
>
>
> --
> 竹密岂妨流水过
> 山高哪阻野云飞
>
> And for G+, please use magiclouds#gmail.com.


--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
12