Issue 8201 - Enhancement: thread stack overrun detection
Summary: Enhancement: thread stack overrun detection
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- enhancement
Target Milestone: 2.5.0
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-16 17:58 UTC by Howard Chu
Modified: 2020-10-14 21:06 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 Howard Chu 2015-07-16 17:58:10 UTC
Full_Name: Howard Chu
Version: HEAD
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (78.155.231.135)
Submitted by: hyc


Have been looking at some puzzling SEGVs where none of the addresses in the core
dump backtrace appear to be invalid. Suspecting a thread stack overrun.

Normally pthreads allocates a 1-page guard at the end of the requested thread
stack. (This is a page of memory mprotect'd to deny any access, so spilling into
it should cause a SEGV.) It's possible for some overruns to skip over this guard
page, e.g. if they occur in a function that has a local variable larger than 1
page in size.

Adding a feature to set the guard region size to be equal to the original thread
stack size. (E.g., 8MB on 64 bit builds.) This should help catch the more
elusive overrun cases. The feature will be enabled by setting the LDAPSTACKGUARD
environment variable (to anything, the value is ignored).
Comment 1 OpenLDAP project 2015-07-16 18:02:18 UTC
in master
Comment 2 Howard Chu 2015-07-16 18:02:18 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Enhancements