php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27371 php scipt crashes
Submitted: 2004-02-23 16:09 UTC Modified: 2004-03-08 07:11 UTC
From: wilhelm dot hagg at web dot de Assigned:
Status: No Feedback Package: Mail related
PHP Version: 4.3.4 OS: Linux, Kernel 2.4.25
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wilhelm dot hagg at web dot de
New email:
PHP Version: OS:

 

 [2004-02-23 16:09 UTC] wilhelm dot hagg at web dot de
Description:
------------
While sending emails with the mail() function in a loop, php  stops immediately (crashes ??). Unfortuately, this happens not every time, only some times. There is no message in the log files, it just stops.

Reproduce code:
---------------
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html> <head> <body>
<?php
$db_connection = mysql_pconnect("localhost","wwwrun","abc");
mysql_select_db("cdzirkel",$db_connection);

  $offer_text="CD's   (http://cd.cdzirkel.de)\n \n deaf dumb blind\n clawfinger\n \n live aus R?delheim\n R?delheim Hartreim Projekt\n \n 4 gewinnt\n Die fantastischen Vier\n \n soundtrack\n blade 2\n \n Betty\n Helmet\n \n ready an' willing\n whitesnake\n \n use your brain\n clawfinger\n \n wie Mutter und Tochter\n Badesalz\n \n Under the pink\n Tori Amos\n \n dark side of the moon\n Pink Floyd\n \n Talk On Corners\n The Corrs\n \n Nowhere...fast\n Fury in the slaughterhouse\n \n Jahmekya\n Ziggy Marley\n \n smash\n offspring\n \n Greatest hits\n Whitesnake\n \n Das ist nicht die ganze Wahrheit\n Die ?rzte\n \n Herzeleid\n Rammstein\n \n digimortal\n fear factory\n \n in concert with the London symphony orchestra\n deep purple\n \n time to move\n h-blockx\n \n america's least wanted\n ugly kid joe\n \n without you I'm nothing\n placebo\n \n Maxi's (http://maxi.cdzirkel.de) \n \n DVD's  (http://dvd.cdzirkel.de) \n \n daredevil\n \n \n blade2 ungek?rzt\n \n \n blade\n \n \n the cell (mit J.Lo)\n \n \n matrix 1\n \n \n im Bann des Psychopathen\n \n \n B?cher (http://buch.cdzirkel.de) \n \n Werner - Oder Was?\n Br?sel\n \n";                                                                                                                                               $uqid = mysqlquery("SELECT * FROM user");                                       while( $ures = mysql_fetch_array($uqid) ) {                                       $iid = $ures[id];                                                               $email = $ures[email];                                                          $name = $ures[name];                                                            $familyname = $ures[familyname];                                                                                                                                mail($email, "Neue Angebote bei CdZirkel", "Hallo $name $familyname ! \n\nBrandneu: Hier sind die neuesten Angebote bei CdZirkel.de. \n\n$offer_text \n\nDein CdZirkel Team \n\nHier kannst Du diesen Service abbestellen:\n  http://cdzirkel.de/index.php?Update=1&iid=$iid \n(Oder in Deinen Einstellungen unter Profil)","From: admin@CdZirkel.de");                                                                                                                                         echo "$email <br>";                                                           }                                                                               echo "DONE";                                                                  ?>                                                                              </body> </html>

Expected result:
----------------
Should send an email to each user in db-table user and print a line with the email address on the result http-page.

The code requires a mysqldatabase cdzirkel (passw. abc) that holds a table with all users:

CREATE TABLE user (
  id int(1) unsigned NOT NULL auto_increment,
  email varchar(100) NOT NULL default '',
  password varchar(100) default '',
  name varchar(100) default '',
  familyname varchar(100) default '',
  PRIMARY KEY  (id)
) TYPE=MyISAM;

Currently there are roughly 300 users in the database.

Actual result:
--------------
It stops (sometimes) in between.

I also checked the return code of the mail function. Whenever it returned the code was o.k. So i think it hangs or it crashes.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-23 16:41 UTC] sniper@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2004-03-08 07:11 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Dec 04 13:01:23 2020 UTC