#50891 [Com]: Crash on mysql_connect

From: Date: Sun, 31 Jan 2010 16:25:56 +0000
Subject: #50891 [Com]: Crash on mysql_connect
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-147070@lists.php.net to get a copy of this message
 ID:               50891
 Comment by:       other dot pouya at gmail dot com
 Reported By:      other dot pouya at gmail dot com
 Status:           Feedback
 Bug Type:         MySQL related
 Operating System: win32 only - Win XP
 PHP Version:      5.2.12
 New Comment:

Thanks for you attention.
I checked the link you provide but there was nothing there. It was just
written "5.2 has no release" as well as other versions.


Previous Comments:
------------------------------------------------------------------------

[2010-01-31 14:33:40] jani@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/



------------------------------------------------------------------------

[2010-01-31 03:13:45] other dot pouya at gmail dot com

Description:
------------
Dear PHP team

I have apache 2.2.14 , php 5.2.12 and mysql 5.1 running on XP.
Php and apache are fine when I test phpinfo() or other php commands
which are not related to mysql. But when I try to connect to mysql, the
apache sever crashes and the following error pops up:

Apache HTTP Server has encountered a problem and needs to close.  We
are sorry for the inconvenience.

clicking for details I have this error signature:

szAppName : httpd.exe     szAppVer : 2.2.14.0     szModName :
php5ts.dll     
szModVer : 5.2.12.12     offset : 0000ac6a 

I ran the code step by step, and I realize the problem is related to
the line $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);

This is apache error.log after clicking "don't send" on the crashing
pop-up:

[Sun Jan 31 04:03:57 2010] [notice] Parent: child process exited with
status 3221225477 -- Restarting.
[Sun Jan 31 04:03:57 2010] [notice] Apache/2.2.14 (Win32) PHP/5.2.12
configured -- resuming normal operations
[Sun Jan 31 04:03:57 2010] [notice] Server built: Sep 28 2009 22:41:08
[Sun Jan 31 04:03:57 2010] [notice] Parent: Created child process 584
[Sun Jan 31 04:03:58 2010] [notice] Child 584: Child process is
running
[Sun Jan 31 04:03:58 2010] [notice] Child 584: Acquired the start
mutex.
[Sun Jan 31 04:03:58 2010] [notice] Child 584: Starting 64 worker
threads.
[Sun Jan 31 04:03:58 2010] [notice] Child 584: Starting thread to
listen on port 80. 


Reproduce code:
---------------
<?php
	session_start();

	require_once('config.php');
	
	$errmsg_arr = array();
	
	$errflag = false;
	
	//so far there was no problem. after this comment it crashes
	$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
	if(!$link) {
		die('Failed to connect to server: ' . mysql_error());
		
	}
.
.
.
?>

Expected result:
----------------
Connecting to mysql.

Actual result:
--------------
Apache HTTP Server has encountered a problem and needs to close.  We
are sorry for the inconvenience.


szAppName : httpd.exe     szAppVer : 2.2.14.0     szModName :
php5ts.dll     
szModVer : 5.2.12.12     offset : 0000ac6a 


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=50891&edit=1



Thread (6 messages)

« previous php.bugs (#147070) next »