php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44068 Using a MaxDB_query inside a while from another query crash Apache
Submitted: 2008-02-07 09:49 UTC Modified: 2008-02-14 22:53 UTC
From: nda at acoservices dot be Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 5.2.5 OS: Windows XP SP2
Private report: No CVE-ID: None
 [2008-02-07 09:49 UTC] nda at acoservices dot be
Description:
------------
Using a MaxDB_query inside a while from another Max_DB query makes Apache (version 2.2.6) to crash.

PHP.INI
maxdb extention unable, dll version 5.2.5.5.
[maxdb]
maxdb.default_host=aco-portable
maxdb.default_db=IDTECH
maxdb.default_user=IDTECH
maxdb.default_pw=*****

Reproduce code:
---------------
<?php 

$today=date("Y-m-d")." 00:00:00.000000";

$link=maxdb_connect() or die("Connection failed : ".maxdb_connect_error());
$query_users= "Select * from ptage_infotel where d_contrat<='$today' and d_contrat_fin>='$today' order by name";
$result_users= maxdb_query($link,$query_users) or die("Request failed : ".maxdb_error($link));

while ($users=maxdb_fetch_array($result_users)){
echo $users[1].'<br>';
$id_user=$users[0];
if(isset($users[3])){
$query_user= "Select * from ptage_infotel where d_contrat<='$today' and d_contrat_fin>='$today' and badge='$id_user' order by day DESC, time ASC";
$result_user= maxdb_query($link,$query_user) or die("Request failed : ".maxdb_error($link));
while ($user=maxdb_fetch_array($result_user)){
echo $users[3].'<br>';
}}}
?>

Expected result:
----------------
Print name and time for each users.

Actual result:
--------------
Apache crash with error log : "Error in my_thread_global_end(): 252 threads didn't exit"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-14 22:53 UTC] jani@php.net
If you had bothered doing the search using 'my_thread_global_end' as query you would have found couple of dozen reports (closed/bogused) and also the solutions..
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 07:01:32 2024 UTC