Bug 43177

Summary: child pid xxxxx exit signal Segmentation fault
Product: Apache httpd-2 Reporter: Krishna Rawat <Krishna.Rawat>
Component: AllAssignee: Apache HTTPD Bugs Mailing List <bugs>
Severity: normal CC: abhishek.patil
Priority: P2 Keywords: MassUpdate
Version: 2.0-HEAD   
Target Milestone: ---   
Hardware: HP   
OS: Linux   

Description Krishna Rawat 2007-08-21 07:45:32 UTC
First of all thanks for the Great work.

We run more than 100 apache servers on one Linux server/machine. Each apache
instance has 50 child processes. And mainly we run SSL in most of these cases. I
think configuration like this might be the cause of the problem i am
experiencing.  And i don't think it has to do anything to do with OS or apache
version i use.  When i had around 60 Apache servers running it was all fine.
When i started adding more instances i started getting following error message
in the error log.

[Sat Aug 18 11:27:27 2007] [notice] Apache/2.0.49 (Unix) mod_ssl/2.0.49
OpenSSL/0.9.7d mod_jk2/2.0.5-dev configured -- resuming normal operations
[Sat Aug 18 11:28:29 2007] [error] shm.createSlot() create 0 returned NULL
[Sat Aug 18 11:28:29 2007] [error] workerEnv.init() create slot epStat.14236 failed
[Sat Aug 18 11:29:28 2007] [error] shm.createSlot() create 0 returned NULL
[Sat Aug 18 11:29:28 2007] [error] workerEnv.init() create slot epStat.1 failed
[Sat Aug 18 11:31:29 2007] [error] shm.createSlot() create 0 returned NULL
[Sat Aug 18 11:31:29 2007] [error] workerEnv.init() create slot epStat.14334 failed
[Sat Aug 18 11:33:28 2007] [error] shm.createSlot() create 0 returned NULL
[Sat Aug 18 11:33:28 2007] [error] workerEnv.init() create slot epStat.13934 failed
[Sat Aug 18 11:44:31 2007] [error] shm.createSlot() create 0 returned NULL
[Sat Aug 18 11:44:31 2007] [error] workerEnv.init() create slot epStat.16304 failed
[Sat Aug 18 11:49:31 2007] [error] shm.createSlot() create 0 returned NULL
[Sat Aug 18 11:49:31 2007] [error] workerEnv.init() create slot epStat.16558 failed
[Sat Aug 18 11:51:32 2007] [error] shm.createSlot() create 0 returned NULL
[Sat Aug 18 11:51:32 2007] [error] workerEnv.init() create slot epStat.16560 failed
[Sat Aug 18 11:52:32 2007] [error] shm.createSlot() create 0 returned NULL
[Sat Aug 18 11:52:32 2007] [error] workerEnv.init() create slot epStat.16565 failed
[Sat Aug 18 12:11:36 2007] [error] shm.createSlot() create 0 returned NULL

In spite of the above error messages Apache runs fine for few hours and then it
gives following messages in the error.log

[Sun Aug 19 23:56:30 2007] [notice] child pid 16491 exit signal Segmentation
fault (11)
[Sun Aug 19 23:56:59 2007] [notice] child pid 16879 exit signal Segmentation
fault (11)
[Sun Aug 19 23:57:29 2007] [notice] child pid 16770 exit signal Segmentation
fault (11)
[Sun Aug 19 23:58:00 2007] [notice] child pid 16910 exit signal Segmentation
fault (11)
[Sun Aug 19 23:58:30 2007] [notice] child pid 16942 exit signal Segmentation
fault (11)
[Sun Aug 19 23:59:31 2007] [notice] child pid 16993 exit signal Segmentation
fault (11)

Apache server process still runs but now it refuses to serve any page it just
displays blank page. Starting apache fixes this problem for another few hours. 

We found the workaround of this problem.
1) By moving logs directory to logs.old and creating the logs directory. Usually
this fixes the problem. 

Think same Shared memory Key is assigned to more than one apache instance
running on the server.  Believe ftok is used to generate Shared memory Key and
its having collision as i have lots of apaches running on one machine. To prove
this theory further we  hacked ftok function to return a key from a file.

 Desc:    This is an LD_PRELOAD hack that overrides the ftok()
 *          library function. This ftok reads an ftokdb file
 *          (defined here or by the FTOKDB environment variable)
 *          to determine which shm key to return rather than
 *          using the file's inode information.

This hack seems to work fine so far. Ideally i want Apache to use more
randomness than ftok provides so one can run more apache instances on one machine.

Hope this makes sense. Let me know if you need any further information.

thanks in advance
Comment 1 William A. Rowe Jr. 2018-11-07 21:09:45 UTC
Please help us to refine our list of open and current defects; this is a mass update of old and inactive Bugzilla reports which reflect user error, already resolved defects, and still-existing defects in httpd.

As repeatedly announced, the Apache HTTP Server Project has discontinued all development and patch review of the 2.2.x series of releases. The final release 2.2.34 was published in July 2017, and no further evaluation of bug reports or security risks will be considered or published for 2.2.x releases. All reports older than 2.4.x have been updated to status RESOLVED/LATER; no further action is expected unless the report still applies to a current version of httpd.

If your report represented a question or confusion about how to use an httpd feature, an unexpected server behavior, problems building or installing httpd, or working with an external component (a third party module, browser etc.) we ask you to start by bringing your question to the User Support and Discussion mailing list, see [https://httpd.apache.org/lists.html#http-users] for details. Include a link to this Bugzilla report for completeness with your question.

If your report was clearly a defect in httpd or a feature request, we ask that you retest using a modern httpd release (2.4.33 or later) released in the past year. If it can be reproduced, please reopen this bug and change the Version field above to the httpd version you have reconfirmed with.

Your help in identifying defects or enhancements still applicable to the current httpd server software release is greatly appreciated.