php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32614 Crash occured in function fread from module /usr/lib/libc.so.1
Submitted: 2005-04-07 00:45 UTC Modified: 2005-04-28 01:54 UTC
From: Oscar dot Castillo at jpl dot nasa dot gov Assigned: thetaphi (profile)
Status: Closed Package: iPlanet related
PHP Version: 5CVS-2005-04-07 (dev) OS: Solaris 9
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: Oscar dot Castillo at jpl dot nasa dot gov
New email:
PHP Version: OS:

 

 [2005-04-07 00:45 UTC] Oscar dot Castillo at jpl dot nasa dot gov
Description:
------------
As instructed by BUG#32491, I installed PHP 5.0.5 to fix my "File upload error" problem. Previously, the iPlanet 6.0 SP5 web server would simply produce a "File upload error" message. Now the web server crashes and the following message is output to the web server's error log file:

[06/Apr/2005:10:13:01] catastrophe (13578): Server crash detected (signal SIGSEGV)
[06/Apr/2005:10:13:01] info (13578): Crash occurred in NSAPI SAF php5_execute
[06/Apr/2005:10:13:01] info (13578): Crash occurred in function fread from module /usr/lib/libc.so.1
[06/Apr/2005:10:13:01] failure (13576): Child process admin thread is shutting down
[06/Apr/2005:10:13:02] info (19023): Installing a new configuration
[06/Apr/2005:10:13:02] info (19023): [LS ls1] https://128.149.147.181, port 443 ready to accept requests
[06/Apr/2005:10:13:02] info (19023): A new configuration was successfully installed



Reproduce code:
---------------
Please see the Reproduce code for BUG#32491

Expected result:
----------------
Successful file upload

Actual result:
--------------
[06/Apr/2005:10:13:01] catastrophe (13578): Server crash detected (signal SIGSEGV)
[06/Apr/2005:10:13:01] info (13578): Crash occurred in NSAPI SAF php5_execute
[06/Apr/2005:10:13:01] info (13578): Crash occurred in function fread from module /usr/lib/libc.so.1
[06/Apr/2005:10:13:01] failure (13576): Child process admin thread is shutting down
[06/Apr/2005:10:13:02] info (19023): Installing a new configuration
[06/Apr/2005:10:13:02] info (19023): [LS ls1] https://128.149.147.181, port 443 ready to accept requests
[06/Apr/2005:10:13:02] info (19023): A new configuration was successfully installed



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-07 08:20 UTC] thetaphi@php.net
Crahes it always when trying to access a PHP or only when it uploads a file? On my servers here it worked, but I have not latest cvs - only a patched 5.0.4 - and: [06/Apr/2005:10:13:01] info (13578): Crash occurred in function fread
from module /usr/lib/libc.so.1 - fread is not used anywhere in the changed code.

 [2005-04-07 18:16 UTC] Oscar dot Castillo at jpl dot nasa dot gov
I installed the latest CVS as of Tuesday 4/5/2005 which was php5-STABLE-200504052230. A php_info() function call shows the version as 5.0.5-dev.

When I recycle the web server daemon, PHP runs fine. Before I upgraded to this CVS it usually took about 4 hours to begin failing depending on the load on my production web server. It used to say "File upload error - unable to create a temporary file in Unknown on line 0" after the maximum number of file descriptors limit was reached which took about 4 - 24 hours after recycling the web server daemon. After I upgraded to PHP 5.0.5-dev, the PHP environment works fine for about 4 - 24 hours. The functioning time varies with the load on the web server and the web server crashes while when any PHP script is accessed once this "limit" is reached.
 [2005-04-07 18:27 UTC] Oscar dot Castillo at jpl dot nasa dot gov
I also forgot to mention that I am running PHP 5.0.5-dev on 2 other web servers that are used for testing and development of Java, PERL and PHP applications prior to being delivered to the production environment. All flavors of PHP have always worked in the test and development environments, but never in the production environment. The only difference between the 3 environments is that the production environment has a much heavier load than the test and development environments put together. The OS, OS patches, iPlanet version and PHP version are all exactly the same in all 3 web server environments. 

The fact that you cannot produce the crash in your environment can be related to the light load on your test set up. As mentioned in my last bug report (#32491), I have Java enabled (Very memory intensive) on the web server and our production environment mostly uses JSP and Java servlets.
 [2005-04-08 09:37 UTC] thetaphi@php.net
I found the reason for the bug. The problem is not the file upload here that works now. The problem is now the same stdio related bug which leads to the segmentation fault. I fixed the CVS now not to crash the webserver in this error condition (missing an errorchecking at fdopen() which works on all platform without errors, on solaris fails when the filedescriptor>255). But the problem should still be there but you should get a message in your PHP script. Looking into your code I exspect the "execute" functions to fail because they need to cast a stream from posix to stdio.

Please test the new CVS and tell me when the further handling of your uploaded file fails.
 [2005-04-08 09:48 UTC] thetaphi@php.net
Info about the solaris "bug": http://docs.sun.com/app/docs/doc/816-5168/6mbb3hr5q?a=view (see under "USAGE")
In 64bit solaris it would work, but SunONE is a 32 bit server.
 [2005-04-08 17:30 UTC] thetaphi@php.net
Something other: can you load the "core" file the crashing server produces into dbx or gdb and send me the output?
 [2005-04-09 01:48 UTC] Oscar dot Castillo at jpl dot nasa dot gov
By default, iPlanet is not configured to core dump. Some special flags must be enabled to allow core dumping. I do not know the specific syntax to enable core dumping and I must then open a trouble ticket with Sun.

I am attempting your suggestion from bug report #32491 to enable PHP as a CGI/Fastcgi via your cgibytex CGI enabler. As of the last 7 hours, PHP is working perfectly. I shall keep you posted.
 [2005-04-10 22:32 UTC] thetaphi@php.net
Yes, CGI works perfect because crashes of PHP does not affect PHP and the FD limit is not applicable, too. For higher load webservers CGI could be a performance issue.
For servers that only have a few PHP scripts it should be enough. A solution with the same performance like NSAPI would be using Zend's FastCGI enabler - but its not open source as I know.

My servers produced with SunONE 6.0 a coredump when I debugged the revised NSAPI module two years ago, but with 6.1 I do not know. The only problem is to find the core dump because it is not in the directory the server binaries are. They are in the CWD of the process (usually in the base dir of the running instance).

I am still trying to eliminate all Sun stdio problems. The next would be replacing popen() by posix functions in the exec/system functions.

One tip by Wez Furlong: Instead of exec/system use the group of functions around proc_open(). They use POSIX io.
 [2005-04-12 01:51 UTC] Oscar dot Castillo at jpl dot nasa dot gov
As of today, PHP as a CGI is still working perfectly, although our servers are not used heavily over the weekend. I will continue to monitor the server for another couple of days. Please keep the bug report open for another couple of days.

I initially tried using the Zend FastCGI enabler, but could not complete the install since it was not tested for SunOne web server's older than 6.1. Your cgibytex installation instructions were quite simple and worked well for my iPlanet 6.0 instance. The web server is not heavily used for PHP so I do not expect performance to be an issue.

I've done this in the past, I just don't remember the syntax. My web server has crashed a number of times since loading PHP 5.0.5 as an API and has not produced a core dump file yet. There is specific syntax that must be included in the iPlanet web server's start up script to "tell" the web server to core dump.
 [2005-04-13 23:34 UTC] Oscar dot Castillo at jpl dot nasa dot gov
As of Wednesday, 4/13/2005, the CGI configuration of PHP is still working fine. I'd like to request that the bug report be kept open for a few more days to allow for a heavy load of PHP users to continue using CGI configuration.
 [2005-04-28 01:54 UTC] Oscar dot Castillo at jpl dot nasa dot gov
As of Wednesday 4/27/2005 the PHP environment is working fine. Thanks for all your help!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 07:01:28 2024 UTC