#47881 adminutil crashes during debug session
Closed: wontfix None Opened 7 years ago by mreynolds.

Encountered a crash when debugging adminutil, which appears to be caused by an uninitialized pointer. I can not reproduce it anymore, the fix is quite simple and it shouldn't hurt to add it:

diff --git a/lib/libadminutil/admutil.c b/lib/libadminutil/admutil.c
index 839ab2d..1ab0151 100644
--- a/lib/libadminutil/admutil.c
+++ b/lib/libadminutil/admutil.c
@@ -1210,7 +1210,7 @@ admldapBuildInfoOnly(char* configRoot, int *errorcode)
   char           buf[MAX_LEN],
                  *name= NULL, *password=NULL;
   int            status;
-  LDAPURLDesc    *ldapInfo;
+  LDAPURLDesc    *ldapInfo = NULL;

   *errorcode = ADMUTIL_OP_OK;

To ssh://git.fedorahosted.org/git/389/adminutil.git
9b3cfce..069de33 master -> master

commit 069de33671fd49732c9baeb7fb0007eb7518d97e
Author: Mark Reynolds mreynolds@redhat.com
Date: Wed Aug 27 10:25:30 2014 -0400

I was able to reproduce the crash, here is the stack: {{{ Program received signal SIGSEGV, Segmentation fault. 0x00007f2a9bddd607 in admutil_ldap_url_parse (url=<optimized out>, ludpp=ludpp@entry=0x7fff4b995758, require_dn=require_dn@entry=0, secure=secure@entry=0x7f2aa24966b8) at lib/libadminutil/admutil.c:2185 2185 *secure = (*ludpp)->lud_scheme && !strcmp((*ludpp)->lud_scheme, "ldaps"); (gdb) where #0 0x00007f2a9bddd607 in admutil_ldap_url_parse (url=<optimized out>, ludpp=ludpp@entry=0x7fff4b995758, require_dn=require_dn@entry=0, secure=secure@entry=0x7f2aa24966b8) at lib/libadminutil/admutil.c:2185 #1 0x00007f2a9bddd8ee in admldapBuildInfoOnly (configRoot=0x7f2aa2468c48 "/etc/dirsrv/admin-serv", errorcode=errorcode@entry=0x7fff4b995a88) at lib/libadminutil/admutil.c:1261 #2 0x00007f2a9bdde214 in admldapBuildInfoCbk (configRoot=<optimized out>, cbk=0x7f2a9bddd2a0 <cachedPwdCbk>, errorcode=0x7fff4b995a88) at lib/libadminutil/admutil.c:1344 #3 0x00007f2a9c42f706 in do_admserv_post_config (p=0x7f2aa23f6158, plog=0x7f2aa2423378, ptemp=0x7f2aa2425388, base_server=0x7f2aa2421f28) at ../admin/mod_admserv/mod_admserv.c:2411 #4 0x00007f2a9c42fe72 in mod_admserv_post_config (p=0x7f2aa23f6158, plog=0x7f2aa2423378, ptemp=0x7f2aa2425388, base_server=0x7f2aa2421f28) at ../admin/mod_admserv/mod_admserv.c:2544 #5 0x00007f2aa1cc8529 in ap_run_post_config (pconf=0x7f2aa23f6158, plog=0x7f2aa2423378, ptemp=0x7f2aa2425388, s=0x7f2aa2421f28) at config.c:103 #6 0x00007f2aa1ca7748 in main (argc=5, argv=0x7fff4b996568) at main.c:696 }}}

This could definitely be related to mixing mozldap and openldap in the same binary. The LDAPURLDesc size and layout is different for mozldap and openldap, and mixing the two will cause strange crashes.

Metadata Update from @mreynolds:
- Issue assigned to mreynolds
- Issue set to the milestone: 389-admin,console 1.1.36

4 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/1212

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

a year ago

Login to comment on this ticket.

Metadata