php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13110 Bus Error or Segmentation Fault With apache 1.3.20 in solaris8
Submitted: 2001-09-03 11:29 UTC Modified: 2001-11-12 03:19 UTC
From: skarges at himalaya-corp dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.6 OS: Solaris8
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: skarges at himalaya-corp dot com
New email:
PHP Version: OS:

 

 [2001-09-03 11:29 UTC] skarges at himalaya-corp dot com
for ($rub=0; $rub<$nb_news; $rub++)
    {
    	
    	// dans le cas ou cette rubrique est selectionnee
     	if (isset($tab_attributs["id_liste_newletterthemes_".$themes[$rub]["id_themes"]]) and $tab_attributs["id_liste_newletterthemes_".$themes[$rub]["id_themes"]] != "")
    	    $check = "CHECKED";
     	else
    	    $check = "";

     	$liste_elem = GetListElements($tab_attributs["id_liste_newletterthemes_".$themes[$rub]["id_themes"]]);
     	debug(sizeof($liste_elem));
     	for ($i=0; $i<sizeof($liste_elem); $i++)
     	{
     		if ($i==0)
     			$elemrub = $liste_elem[$i]["value"];
     		else
     			$elemrub .= ",".$liste_elem[$i]["value"];
     	}

        $tmpl->set_var( array("ID_THEME"       => $themes[$rub]["id_themes"],
                              "NUM_RUB"        => $rub,
                              "LISTE_RUB"      => $elemrub,
                              "ACCROCHE_THEME" => afficherTexte($tab_attributs["accrochethemes_".$themes[$rub]["id_themes"]]),
                              "THEME_CHECKED"  => $check,
                              "THEME_NAME"     => afficherTexte($themes[$rub]["name"])) );
        $tmpl->parse("rubriques", "rub", true);
    }

if in this loop the number of element is $nb_news = 1.
here 20,1,138 before enter loop an Bus error or a segmentation fault is generate in Apache log under Solaris8


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-21 00:48 UTC] sniper@php.net
Please include a _short_ and _complete_ script that can just
be cut'n'pasted and which shows the problem.

 [2001-11-11 06:14 UTC] sander@php.net
No feedback. Closing.
 [2001-11-12 03:19 UTC] skarges at himalaya-corp dot com
<?
    include("$DOCUMENT_ROOT/lib/template.inc");
    include("$DOCUMENT_ROOT/lib/cst.inc");
    include("$DOCUMENT_ROOT/lib/profilingtoolkit.inc");
    include("$DOCUMENT_ROOT/lib/fonctions.inc");

    //********************************* Connexion ? la base de donn?es et requetes *********************************
    // creation de la connexion
    $conn = new DB_oracle;
    $conn->Init(BASE,USER,PASS);

    // selection de l'id_cat de la categories ACTUALITES
    // afin de retrouver le parent des rubriques qui se trouvent sous ACTUALITES
    $select = "select id_cat from CATEGORIES where name='".CATEGORIE_ACTU."'";
    $id_cat = $conn->QueryItem($select);

    if ($mode == 'edition' || $mode == 'copie')
    {
    	$select = "SELECT name, TO_CHAR(Objects.first_publish, 'DD/MM/RRRR') AS first_publish
        		   FROM objects
        		   WHERE id_obj = $id_obj";
    	$tab = $conn->QueryTab($select);

    	// recuperation de tous les attributs de l'article ? afficher
    	$tab_attributs = BuildTabAttributs($id_obj);
    	$id_newsletter = "?id_newsletter=$id_obj";
    }

    //********************************************* TEMPLATES *************************************************
    // creation du template
    $tmpl = new Template("$DOCUMENT_ROOT/Backoffice/templates", "keep");

    // definition des variables referencant les fichiers
    $tmpl->set_file(array("main" => "newsletterN1.tpl"));

    // definition du bloc des newsletter recuper?es
    $tmpl->set_block("main", "rub", "rubriques");

    // recuperation de la liste des themes
    $select = "SELECT id_themes, name FROM themes WHERE themes_cat = '".THEME_NEWSLETTER."'";
    $themes = $conn->QueryTab($select);
    $nb_news = $conn->rows;

    for ($rub=0; $rub<$nb_news; $rub++)
    {
    	
    	// dans le cas ou cette rubrique est selectionnee
     	if (isset($tab_attributs["id_liste_newletterthemes_".$themes[$rub]["id_themes"]]) and $tab_attributs["id_liste_newletterthemes_".$themes[$rub]["id_themes"]] != "")
    	    $check = "CHECKED";
     	else
    	    $check = "";

     	$liste_elem = GetListElements($tab_attributs["id_liste_newletterthemes_".$themes[$rub]["id_themes"]]);

     	for ($i=0; $i<sizeof($liste_elem); $i++)
     	{
     		if ($i==0)
     			$elemrub = $liste_elem[$i]["value"];
     		else
     			$elemrub .= ",".$liste_elem[$i]["value"];
     	}

        $tmpl->set_var( array("ID_THEME"       => $themes[$rub]["id_themes"],
                              "NUM_RUB"        => $rub,
                              "LISTE_RUB"      => $elemrub,
                              "ACCROCHE_THEME" => afficherTexte($tab_attributs["accrochethemes_".$themes[$rub]["id_themes"]]),
                              "THEME_CHECKED"  => $check,
                              "THEME_NAME"     => afficherTexte($themes[$rub]["name"])) );
        $tmpl->parse("rubriques", "rub", true);
    }

    if ($mode == 'edition')
    {
    	// on regarde si on doit afficher ou non le bandeau de pub
    	if (isset($tab_attributs["img_bandeau"]) and $tab_attributs["img_bandeau"] != "")
    	{
            $supp_img1 = "";
            $display_bandeau = "true";
        }
        else
            $display_bandeau = "false";
    }
    else
    {
        $display_bandeau = "false";
    }

    if ($tab[0]["first_publish"] != "")
    {
    	$parse_date = explode ("/", $tab[0]["first_publish"]);
    }

    // definition des valeurs par defaut
    $signature_mail = ($tab_attributs["signature_mail"] != "") ? $tab_attributs["signature_mail"] : "L'?quipe LocalMundi";

    // definition des images
    if ($status == EN_ATTENTE)
    {
        $bouton_nouvelle = "/img/b_nouvelle_off.gif";
        $bouton_attente = "/img/b_en_attent_on.gif";
        $bouton_archive = "/img/b_archivee_off.gif";
    }
    elseif ($status == ARCHIVE)
    {
        $bouton_nouvelle = "/img/b_nouvelle_off.gif";
        $bouton_attente = "/img/b_en_attent_off.gif";
        $bouton_archive = "/img/b_archivee_on.gif";
    }
    else
    {
        $bouton_nouvelle = "/img/b_nouvelle_on.gif";
        $bouton_attente = "/img/b_en_attent_off.gif";
        $bouton_archive = "/img/b_archivee_off.gif";
    }

    // affectation des autres variables
    $tmpl->set_var( array("FIRST_PUBLISH"	=> "".$tab[0]["first_publish"],
                		  "J_DATE"		    => "".$parse_date[0],
                		  "M_DATE"		    => "".$parse_date[1],
                		  "A_DATE"		    => "".$parse_date[2],
                		  "OBJET_MAIL"	    => "".afficherTexte($tab_attributs["objet_mail"], true),
                		  "URL_BANDEAU"	    => "".afficherTexte($tab_attributs["url_bandeau"]),
                		  "BANDEAU_PUB"	    => "".afficherTexte($tab_attributs["bandeau_pub"]),
                		  "TITRE"		    => "".afficherTexte($tab[0]["name"], true),
                		  "OLD_TITRE"	    => "".afficherTexte($tab[0]["name"], true),
                		  "EDITO"    	    => "".afficherTexte($tab_attributs["edito"], true),
                		  "NOUVEAUTE"	    => "".afficherTexte($tab_attributs["nouveaute"], true),
                		  "SIGNATURE_MAIL"  => afficherTexte($signature_mail, true),
                		  "IMG_NOUVELLE"    => $bouton_nouvelle,
                		  "IMG_ATTENTE"     => $bouton_attente,
                		  "IMG_ARCHIVE"     => $bouton_archive,
                		  "MODE"            => $mode,
                		  "NB_NEWS"		    => $nb_news,
                		  "DISPLAY_BANDEAU" => $display_bandeau,
                		  "SRC_BANNIERE"    => "/images/bannieres/".$tab_attributs["img_bandeau"],
                		  "ID_NEWSLETTER"   => $id_newsletter,
                		  "ID_OBJ"          => ($mode != "copie") ? $id_obj : ""));

    // construction du fichier
    $tmpl->parse("out", "main");

    // affichage du fichier
    $tmpl->p("out");

    // fermeture de la connexion
    $conn->Close();
?>

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 09:01:27 2025 UTC