* Linking against libldap_r instead of libldap? @ 2013-06-28 1:42 Leonardo Chiquitto 2013-06-28 6:31 ` Ian Kent 0 siblings, 1 reply; 4+ messages in thread From: Leonardo Chiquitto @ 2013-06-28 1:42 UTC (permalink / raw) To: autofs Hi, I'm investigating one segmentation fault report (multiple occurrences) in automount where the OpenSSL context (using LDAP with TLS) is clearly corrupted. Reading OpenSSL documentation I found that the the library needs to be correctly initialized in order to run in a multi- threaded environment. I also found that *only* the reentrant build of the OpenLDAP libraries (libldap_r) initialize openssl for multi-threading. By default (since commit 04dfd15590a) automount is linked against libldap (non-reentrant), but I failed to find the reason behind the change. Could you help me understand why it shouldn't be linked against libldap_r? Thanks, Leonardo ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Linking against libldap_r instead of libldap? 2013-06-28 1:42 Linking against libldap_r instead of libldap? Leonardo Chiquitto @ 2013-06-28 6:31 ` Ian Kent 2013-06-28 7:26 ` Ian Kent 0 siblings, 1 reply; 4+ messages in thread From: Ian Kent @ 2013-06-28 6:31 UTC (permalink / raw) To: Leonardo Chiquitto; +Cc: autofs On Thu, 2013-06-27 at 22:42 -0300, Leonardo Chiquitto wrote: > Hi, > > I'm investigating one segmentation fault report (multiple occurrences) > in automount where the OpenSSL context (using LDAP with TLS) is > clearly corrupted. Reading OpenSSL documentation I found that the > the library needs to be correctly initialized in order to run in a multi- > threaded environment. I also found that *only* the reentrant build of > the OpenLDAP libraries (libldap_r) initialize openssl for multi-threading. > > By default (since commit 04dfd15590a) automount is linked against > libldap (non-reentrant), but I failed to find the reason behind the change. > Could you help me understand why it shouldn't be linked against > libldap_r? That was a long time ago, Jan 2008. Sorry, I don't remember why I committed that change. TBH I always thought the re-entrant version of the library should be used so there must have been a case to justify not using it, I just can't remember what it was. Not a good change log entry either ..... Ian ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Linking against libldap_r instead of libldap? 2013-06-28 6:31 ` Ian Kent @ 2013-06-28 7:26 ` Ian Kent 2013-07-26 17:39 ` Leonardo Chiquitto 0 siblings, 1 reply; 4+ messages in thread From: Ian Kent @ 2013-06-28 7:26 UTC (permalink / raw) To: Leonardo Chiquitto; +Cc: autofs On Fri, 2013-06-28 at 14:31 +0800, Ian Kent wrote: > On Thu, 2013-06-27 at 22:42 -0300, Leonardo Chiquitto wrote: > > Hi, > > > > I'm investigating one segmentation fault report (multiple occurrences) > > in automount where the OpenSSL context (using LDAP with TLS) is > > clearly corrupted. Reading OpenSSL documentation I found that the > > the library needs to be correctly initialized in order to run in a multi- > > threaded environment. I also found that *only* the reentrant build of > > the OpenLDAP libraries (libldap_r) initialize openssl for multi-threading. > > > > By default (since commit 04dfd15590a) automount is linked against > > libldap (non-reentrant), but I failed to find the reason behind the change. > > Could you help me understand why it shouldn't be linked against > > libldap_r? > > That was a long time ago, Jan 2008. > Sorry, I don't remember why I committed that change. > > TBH I always thought the re-entrant version of the library should be > used so there must have been a case to justify not using it, I just > can't remember what it was. > > Not a good change log entry either ..... I've found a reference to the post this originated from: http://www.mail-archive.com/autofs@linux.kernel.org/msg06499.html I'm guessing the claim actually is that -D_REENTRANT should deal with this although LDFLAGS contains -lpthread so perhaps this was actually a problem with Mandriva. In short: Hello list. Latest release (5.0.3) attempt to link against libldap_r, and fails on mandriva because of unresolved pthread symbols. However, according to ldap maintainer, libldap_r is supposed to be a private library. Hence autofs should use -lldap, not -lldap_r. Attached patch fix this. -- Guillaume Rousse Moyens Informatiques - INRIA Futurs ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Linking against libldap_r instead of libldap? 2013-06-28 7:26 ` Ian Kent @ 2013-07-26 17:39 ` Leonardo Chiquitto 0 siblings, 0 replies; 4+ messages in thread From: Leonardo Chiquitto @ 2013-07-26 17:39 UTC (permalink / raw) To: Ian Kent; +Cc: autofs On Fri, Jun 28, 2013 at 4:26 AM, Ian Kent <raven@themaw.net> wrote: > On Fri, 2013-06-28 at 14:31 +0800, Ian Kent wrote: >> On Thu, 2013-06-27 at 22:42 -0300, Leonardo Chiquitto wrote: >> > Hi, >> > >> > I'm investigating one segmentation fault report (multiple occurrences) >> > in automount where the OpenSSL context (using LDAP with TLS) is >> > clearly corrupted. Reading OpenSSL documentation I found that the >> > the library needs to be correctly initialized in order to run in a multi- >> > threaded environment. I also found that *only* the reentrant build of >> > the OpenLDAP libraries (libldap_r) initialize openssl for multi-threading. >> > >> > By default (since commit 04dfd15590a) automount is linked against >> > libldap (non-reentrant), but I failed to find the reason behind the change. >> > Could you help me understand why it shouldn't be linked against >> > libldap_r? >> >> That was a long time ago, Jan 2008. >> Sorry, I don't remember why I committed that change. >> >> TBH I always thought the re-entrant version of the library should be >> used so there must have been a case to justify not using it, I just >> can't remember what it was. >> >> Not a good change log entry either ..... > > I've found a reference to the post this originated from: > http://www.mail-archive.com/autofs@linux.kernel.org/msg06499.html > > I'm guessing the claim actually is that -D_REENTRANT should deal with > this although LDFLAGS contains -lpthread so perhaps this was actually a > problem with Mandriva. > > In short: > > Hello list. > Latest release (5.0.3) attempt to link against libldap_r, and fails on > mandriva because of unresolved pthread symbols. However, according to > ldap maintainer, libldap_r is supposed to be a private library. Hence > autofs should use -lldap, not -lldap_r. Attached patch fix this. Thanks for digging that info in the archives, Ian. I finally had more time to investigate the problem reported to us and it seems to be a valid one. I'm going to write a separate email with the complete report and proposed solution. Thanks, Leonardo ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-07-26 17:39 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2013-06-28 1:42 Linking against libldap_r instead of libldap? Leonardo Chiquitto 2013-06-28 6:31 ` Ian Kent 2013-06-28 7:26 ` Ian Kent 2013-07-26 17:39 ` Leonardo Chiquitto
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.