segfault help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi list,

I'm getting a segfault when I run (what I assume) is a very simple
script. I'm not sure if it's a php bug or a bug in the library I'm
using (MDB2) with PHP 5.2.5 via the cli. Everything seems to go fine
until it's time for the script to end. That's when it receives the seg
fault.

I have the following backtrace.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1209059648 (LWP 2815)]
_zend_mm_free_int (heap=0x9d0d1b8, p=Variable "p" is not available.
) at /root/php-5.2.5/Zend/zend_alloc.c:807
807                             ZEND_MM_CHECK_TREE(mm_block);
(gdb) bt
#0  _zend_mm_free_int (heap=0x9d0d1b8, p=Variable "p" is not available.
) at /root/php-5.2.5/Zend/zend_alloc.c:807
#1  0x08313a85 in zend_hash_destroy (ht=0xb78812d4) at
/root/php-5.2.5/Zend/zend_hash.c:531
#2  0x0831f6dd in zend_object_std_dtor (object=0xb788cd00) at
/root/php-5.2.5/Zend/zend_objects.c:45
#3  0x0831f900 in zend_objects_free_object_storage (object=0xb788cd00)
at /root/php-5.2.5/Zend/zend_objects.c:122
#4  0x0832224c in zend_objects_store_free_object_storage
(objects=0x86174c8) at /root/php-5.2.5/Zend/zend_objects_API.c:89
#5  0x082fdf27 in shutdown_executor () at
/root/php-5.2.5/Zend/zend_execute_API.c:299
#6  0x0830a71c in zend_deactivate () at /root/php-5.2.5/Zend/zend.c:860
#7  0x082d2a4a in php_request_shutdown (dummy=0x0) at
/root/php-5.2.5/main/main.c:1485
#8  0x0838c16f in main (argc=2, argv=0xbff74d24) at
/root/php-5.2.5/sapi/cli/php_cli.c:1321
(gdb) quit
The program is running.  Exit anyway? (y or n) y


And it's occurring when I run this script



<?php

require 'lib/appDB.php';

$db = appDB::getInstance();
$count = 0;
while ($count < 10000) {
       $id = rand(30000,100000);
       $query = "insert into plugins (id) values ('$id')";
       $result = $db->exec($query);

       echo $count."\n";

       $count++;
}

exit;

?>


appDB is my own wrapper around this code



                       $options = array(
                               'debug_expanded_output' => true,
                               'quote_identifier' => true,
                       );

                       $db = MDB2::singleton("sqlite:///myfile", $options);

                       $db->setFetchMode(MDB2_FETCHMODE_ASSOC);
                       $db->setOption('persistent', false);


As shown above, I'm using sqlite. The database file and the folder
that the file is in are both writable by the user that I'm running the
script as.
Any help would be appreciated.

Thanks,
Tim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux