471,616 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,616 software developers and data experts.

php crashing

Hello,

PHP is crashing (segfault) due to some bug. See
http://bugs.php.net/bug.php?id=32929 for details, but here is the code
in which it occurs:

while ($res=$result->fetchRow(DB_FETCHMODE_ASSOC))
{
// TODO: make iconv optional
foreach ($res as $key=>$val)
$res[$key]=iconv("ISO-8859-1","UTF-8",$val);
////// CRASHING ON FOLLOWING LINE AFTER 5 ITERATIONS (DATA DEPENDANT)
$wikireq[$id][]=$res;
}

Tried on two different servers and with various compile options/php
versions (recent), it is still there.

Oops, and this code really needs to go to "production", I don't know
what to do :-(

Does someone see something in it (workaround, ...) ?

Thank you,

Yannick Majoros
Jul 17 '05 #1
4 1733
On Tue, 03 May 2005 21:06:58 +0200, Yannick Majoros <ma*****@inma.ucl.ac.be>
wrote:
PHP is crashing (segfault) due to some bug. See
http://bugs.php.net/bug.php?id=32929 for details, but here is the code
in which it occurs:

while ($res=$result->fetchRow(DB_FETCHMODE_ASSOC))
{
// TODO: make iconv optional
foreach ($res as $key=>$val)
$res[$key]=iconv("ISO-8859-1","UTF-8",$val);
////// CRASHING ON FOLLOWING LINE AFTER 5 ITERATIONS (DATA DEPENDANT)
$wikireq[$id][]=$res;
}

Tried on two different servers and with various compile options/php
versions (recent), it is still there.

Oops, and this code really needs to go to "production", I don't know
what to do :-(

Does someone see something in it (workaround, ...) ?


As you'll probably be asked in the bug report, post a complete but minimal
runnable example. You said it's data dependent, but didn't provide data. The
code won't run as-is.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
Andy Hassall wrote:
As you'll probably be asked in the bug report, post a complete but minimal
runnable example. You said it's data dependent, but didn't provide data. The
code won't run as-is.


You are right, but it is very difficult to provide. The fact is that I
wrote some plugins for a wiki-based portal, and that some pages break. I
know they break on the code I provided, but it probably won't break
without the portal ("tikiwiki"), plugins, etc. being loaded.

I think my next step will be to fill big arrays with random data and
see if I can make php crash this way, so I'll have reproducible code.

Regards,

Yannick Majoros
Jul 17 '05 #3
What if you use array_push() instead of the the $a[] = syntax?

Jul 17 '05 #4
Ok, it seems that the bug was somewhere else, in the portal I use
(tikiwiki).

It's true that it didn't crash if I put a return just before the
assignment, and that it did otherwise, but the crash was really
somewhere else, due to "infinite" recursion (limited to 64 by php). I
corrected the bug in tikiwiki.

Thanks to all people who checked this, and sorry for the inconvenience.

Regards,

Yannick Majoros
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Henry Hank | last post: by
14 posts views Thread by Java and Swing | last post: by
7 posts views Thread by Jeffrey Barrett | last post: by
reply views Thread by Grant | last post: by
8 posts views Thread by code break | last post: by
5 posts views Thread by news.cyberlink.ch | last post: by
2 posts views Thread by =?Utf-8?B?QW5uZXh4eHh4eHg=?= | last post: by
1 post views Thread by XIAOLAOHU | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.