php crashing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yannick Majoros

    #1

    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_FE TCHMODE_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
  • Andy Hassall

    #2
    Re: php crashing

    On Tue, 03 May 2005 21:06:58 +0200, Yannick Majoros <majoros@inma.u cl.ac.be>
    wrote:
    [color=blue]
    > 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_FE TCHMODE_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, ...) ?[/color]

    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 / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • Yannick Majoros

      #3
      Re: php crashing

      Andy Hassall wrote:
      [color=blue]
      > 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.
      >[/color]

      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

      Comment

      • Chung Leong

        #4
        Re: php crashing

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

        Comment

        • Yannick Majoros

          #5
          Re: php crashing

          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

          Comment

          Working...