RE: [PHP4BETA] Reproducible problem on latest snapshot
| From: | Peter Kocks | Date: | Tue, 08 Feb 2000 04:31:40 +0000 |
| Subject: | RE: [PHP4BETA] Reproducible problem on latest snapshot | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-9929@lists.php.net to get a copy of this message | ||
Yes indeedy....
I'll confirm by mentioning a bug I reported about 2 weeks ago. I believe
the problem with the script below is the ereg() calls. In my case (snapshot
at Jan 25, 2000) any call to split(), causes either a seg fault or a memory
allocation error in php(). However, only when php is run in apache. When
run as a cgi script (i.e. /usr/local/bin/php) I had no problems whatsoever.
(I'm running on Solaris 2.7)
Rasmus suggested compiling php with the --with-system-regex flag (?). I
have not had time to try this. Instead, I solved my problem by using PCRE,
which is what I wanted to use all along.
--pk
> -----Original Message-----
> From: Jay Linux [mailto:jl543@hotmail.com]
> Sent: Monday, February 07, 2000 7:39 PM
> To: php4beta@lists.php.net
> Cc: andrei@ispi.net
> Subject: [PHP4BETA] Reproducible problem on latest snapshot
>
>
> Hi all:
>
> Another few hours, finally I am able to isolate my
> problem to the small script attached.
>
> On beta3 (with redhat + apache), I see a "hello";
> With php4-200002042045, I get nothing.
>
> It no longer depends on whether the "variable_orders" have 'S'.
> (My actual app still break only when variable_orders have 'S',
> even after I removed 'B'.)
>
> Because I get NOTHING when this error occurs (in a large
> app with session, cookie, GET/POST and lots of includes),
> it was very difficult to track down.
>
> Anyone could give me a hint on how could I have done better?
> What's your favorite debug mechanism for php4?
>
> Thanks for your attention.
>
> \Jay
>
> test script : test.php
>
>
> Hello!
> <?php
>
> get_pageInfo("this");
>
> function get_pageInfo($siteTemplate) {
> $b["a1"]["displayName"] = "Title";
> $b["a2"]["displayName"] = "Name";
> $b["a3"]["displayName"] = "Author";
> $b["a4"]["displayName"] = "Summary";
> $b["a5"]["displayName"] = "displayed";
> $b["a6"]["displayName"] = "Link Menu";
> $a["item"] = $b;
> unset ($b);
>
> $b["a1"]["displayName"] = "Title";
> $b["a3"]["displayName"] = "Name";
> $b["a4"]["displayName"] = "Slogan";
> $b["a5"]["displayName"] = "Description";
> $b["a6"]["displayName"] = "Link Menu";
> $a["textFile"] = $b;
> unset ($b);
>
> $b["a1"]["displayName"] = "Title";
> $b["a2"]["displayName"] = "Name";
> $b["a3"]["displayName"] = "Slogan";
> $b["a4"]["displayName"] = "Description";
> $b["a5"]["displayName"] = "Link Menu";
> $a["text"] = $b;
> unset ($b);
>
> while (list($page, $element) = each($a)) {
> while (list($key, $value) = each($element)) {
> if(ereg("TABLE1",$key)) $element["type"] = "a111";
> #### THE SCRIPT WORKS IF ONE OF THE TWO FOLLOWING LINES
> # ARE COMMENTED OUT
> else if (ereg ("TABLE2", $key)) $element["type"] = "b122";
> else if (ereg ("TABLE", $key)) $element["type"] = "a123";
> #############
> }
> $c[$page] = $element;
> unset ($element);
> }
> return $c;
> }
>
> ?>
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
>
> --
> PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net
> For additional commands, e-mail: php4beta-help@lists.php.net
> To contact the list administrators, e-mail: php4beta-admin@lists.php.net
>
>