By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,027 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

php crashing

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
What if you use array_push() instead of the the $a[] = syntax?

Jul 17 '05 #4

P: n/a
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.