Seg fault in PHP 5.0.3

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rutger Claes

    #1

    Seg fault in PHP 5.0.3

    Hello,

    The following code causes a segmentation fault in PHP 5.0.3 debian package
    from dotdeb.org

    public static function allreadyInDatab ase( $location ) {
    $sql = "SELECT COUNT(*) FROM prefix_search WHERE location = :1";
    $db = DB_Mysql_Single ton::getInstanc e();
    $stm = $db->prepare( $sql );
    $res = $stm->execute( $location );
    return ( $res->getOne() == 1 );
    }

    log output:
    /var/log/apache/error.log:
    [Tue Dec 28 09:54:26 2004] [notice] child pid 6895 exit signal Segmentation
    fault (11)

    I have located the error, it should be the last line. I can do an echo
    $res->getOne() and it will print 0. I can do $num = $res->getOne(); and it
    will work.
    Even this will work:

    ....
    if( $res->getOne() == 1 ) {
    die( "yes" );
    } else {
    die( "no" );
    }

    will print "no". But if I change it to

    ....
    if( $res->getOne() == 1 ) {
    return true;
    } else {
    return false;
    }

    it breaks. I've checked the location where the function is called.

    It doesn't change a thing if I use the function in any way:
    $bool = search_SearchSi nk::allreadyInD atabase( $location );

    search_SearchSi nk::allreadyInD atabase( $location );

    return search_SearchSi nk::allreadyInD atabase( $location );

    if( search_SearchSi nk::allreadyInD atabase( $location ) ) {
    ...

    It allways breaks... Is there any way to find the exact error, Get more log
    info. Is this a known bug? Should I report it? If so, do I send all my
    code?

    Thanks in advance,
    Rutger Claes
    --
    Rutger Claes rgc@rgc.tld
    Replace tld with top level domain of belgium to contact me pgp:0x3B7D6BD6
    The reason computer chips are so small is computers don't eat much.

Working...