Issue 3691 - slapd crashes on 64-bit platforms
Summary: slapd crashes on 64-bit platforms
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: build (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-28 22:34 UTC by Luke Howard
Modified: 2014-08-01 21:05 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Luke Howard 2005-04-28 22:34:37 UTC
Full_Name: Luke Howard
Version: 2.2.26
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (203.13.32.92)


slapd can crash on 64-bit platforms due to a stack overrun.

Patch below (is fixed in HEAD)

===================================================================
RCS file: /repo/OpenLDAP/pkg/ldap/include/ldap_pvt_thread.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- include/ldap_pvt_thread.h	2005/03/07 20:02:31	1.43
+++ include/ldap_pvt_thread.h	2005/04/15 04:18:18	1.44
@@ -1,5 +1,5 @@
 /* ldap_pvt_thread.h - ldap threads header file */
-/* $OpenLDAP: include/ldap_pvt_thread.h,v 1.43 2005/03/07 20:02:31 hyc Exp $
*/
+/* $OpenLDAP: include/ldap_pvt_thread.h,v 1.44 2005/04/15 04:18:18 hyc Exp $
*/
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  * 
  * Copyright 1998-2005 The OpenLDAP Foundation.
@@ -44,9 +44,13 @@
 #define LDAP_PVT_THREAD_CREATE_JOINABLE 0
 #define LDAP_PVT_THREAD_CREATE_DETACHED 1
 
+#define	LDAP_PVT_THREAD_SET_STACK_SIZE
 #ifndef LDAP_PVT_THREAD_STACK_SIZE
-	/* LARGE stack */
-#define LDAP_PVT_THREAD_STACK_SIZE	(4*1024*1024)
+	/* LARGE stack. Will be twice as large on 64 bit machine. */
+#define LDAP_PVT_THREAD_STACK_SIZE	( 1 * 1024 * 1024 * sizeof(void *) )
+/* May be explicitly defined to zero to disable it */
+#elif LDAP_PVT_THREAD_STACK_SIZE == 0
+#undef LDAP_PVT_THREAD_SET_STACK_SIZE
 #endif
 
 LDAP_F( int )
===================================================================
RCS file: /repo/OpenLDAP/pkg/ldap/libraries/libldap_r/thr_posix.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- libraries/libldap_r/thr_posix.c	2005/01/01 19:49:45	1.38
+++ libraries/libldap_r/thr_posix.c	2005/04/15 04:18:19	1.39
@@ -1,5 +1,5 @@
 /* thr_posix.c - wrapper around posix and posixish thread implementations.  */
-/* $OpenLDAP: libraries/libldap_r/thr_posix.c,v 1.38 2005/01/01 19:49:45 kurt
Exp $ */
+/* $OpenLDAP: libraries/libldap_r/thr_posix.c,v 1.39 2005/04/15 04:18:19 hyc
Exp $ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
  * Copyright 1998-2005 The OpenLDAP Foundation.
@@ -110,7 +110,7 @@
 	pthread_attr_create(&attr);
 #endif
 
-#if defined(LDAP_PVT_THREAD_STACK_SIZE) && LDAP_PVT_THREAD_STACK_SIZE > 0
+#ifdef LDAP_PVT_THREAD_SET_STACK_SIZE
 	/* this should be tunable */
 	pthread_attr_setstacksize( &attr, LDAP_PVT_THREAD_STACK_SIZE );
 #endif

Comment 1 Howard Chu 2005-04-29 23:16:09 UTC
changed notes
Comment 2 Howard Chu 2005-05-03 23:50:16 UTC
changed notes
changed state Open to Release
moved from Incoming to Build
Comment 3 Kurt Zeilenga 2005-06-13 17:02:38 UTC
changed notes
changed state Release to Closed
Comment 4 Howard Chu 2009-02-17 07:02:46 UTC
moved from Build to Archive.Build
Comment 5 OpenLDAP project 2014-08-01 21:05:11 UTC
already fixed in HEAD
fixed in RE22