[PHP] segfault help
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 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
Re: [PHP] segfault help
On Fri, Jun 27, 2008 at 10:14 AM, Daniel Brown <[EMAIL PROTECTED]> wrote: > On Fri, Jun 27, 2008 at 10:30 AM, Tim Rupp <[EMAIL PROTECTED]> wrote: >> 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. > [snip!] > >Tim, > >In 5.2.6, line 807 is in zend_mm_remove_from_free_list(), but it's > still memory-related, since it's zend_alloc.c that appears to be > causing the crash. > > What does your ./configure line look like? > > -- > > Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just > $59.99/mo. with no contract! > Dedicated servers, VPS, and hosting from $2.50/mo. > Here's my configure line ./configure --enable-force-cgi-redirect --enable-debug --disable-rpath --enable-inline-optimization --with-bz2 --with-db4=/usr --with-curl --with-gd --enable-gd-native-ttf --without-gdbm --with-gettext --with-ncurses --with-gmp --with-iconv --with-openssl --with-regex=system --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-wddx --with-kerberos --with-ldap=shared --with-mysql=shared --enable-mbstring=all --with-apxs2=/usr/sbin/apxs --with-pgsql=shared --with-mysqli --with-freetype-dir=/usr/include/freetype2 --with-mcrypt --enable-soap --enable-sigchild --enable-pcntl it was compiled on a RHEL 4.2 machine. I compiled 5.2.6 to see if that would fix it, but no change. Thanks, -Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] segfault help
On Fri, Jun 27, 2008 at 11:03 AM, Daniel Brown <[EMAIL PROTECTED]> wrote: > On Fri, Jun 27, 2008 at 11:57 AM, Tim Rupp <[EMAIL PROTECTED]> wrote: >> >> ./configure --enable-force-cgi-redirect --enable-debug >> --disable-rpath --enable-inline-optimization --with-bz2 >> --with-db4=/usr --with-curl --with-gd --enable-gd-native-ttf >> --without-gdbm --with-gettext --with-ncurses --with-gmp --with-iconv >> --with-openssl --with-regex=system --with-zlib --with-layout=GNU >> --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes >> --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm >> --enable-wddx --with-kerberos --with-ldap=shared --with-mysql=shared >> --enable-mbstring=all --with-apxs2=/usr/sbin/apxs --with-pgsql=shared >> --with-mysqli --with-freetype-dir=/usr/include/freetype2 --with-mcrypt >> --enable-soap --enable-sigchild --enable-pcntl >> >> it was compiled on a RHEL 4.2 machine. I compiled 5.2.6 to see if that >> would fix it, but no change. > >This is just a way outside guess, but try recompiling (either > version) with the same ./configure, but removing > '--enable-inline-optimization'. > > -- > > Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just > $59.99/mo. with no contract! > Dedicated servers, VPS, and hosting from $2.50/mo. > Well, no luck with the removal of inline, but I'll leave it removed since it appears to be an artifact from way back when (we tend to keep dragging this config file with us through the generations). Now, here's something weird, maybe someone can explain this. When compiled with --enable-debug, I don't see the "Segmentation fault" message on the cli. When I compile with --disable-debug, I see the error message. gdb too reports no error when debug is enabled. -Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] pdo compilation question
Hi list, I hope this is the right area to ask, I'm trying to compile PDO support in 5.2.6 and am following the instructions here http://us2.php.net/manual/en/pdo.installation.php My compile line is the following ./configure --enable-force-cgi-redirect \ --disable-rpath \ --with-bz2 \ --with-db4=/usr \ --with-curl \ --with-gd \ --enable-gd-native-ttf \ --without-gdbm \ --with-gettext \ --with-ncurses \ --with-gmp \ --with-iconv \ --with-openssl \ --with-regex=system \ --with-zlib \ --with-layout=GNU \ --enable-bcmath \ --enable-exif \ --enable-ftp \ --enable-magic-quotes \ --enable-sockets \ --enable-sysvsem \ --enable-sysvshm \ --enable-wddx \ --with-kerberos \ --with-ldap=shared \ --with-mysql=shared \ --enable-mbstring=all \ --with-apxs2=/usr/sbin/apxs \ --with-pgsql=shared \ --with-mysqli \ --with-freetype-dir=/usr/include/freetype2 \ --with-mcrypt \ --enable-soap \ --enable-pcntl \ --enable-pdo=shared \ --with-sqlite=shared \ --with-pdo-sqlite=shared \ --with-pdo-mysql=shared \ --with-pdo-pgsql=shared \ --with-pdo-oci=shared This config line I'm working with has been a growing one, so there may be some things here that may or may not be needed. Anyway, Upon compiling the above, I get the following error when I do a php -m Warning: PHP Startup: Invalid library (maybe not a PHP library) 'pdo.so' in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613/pdo_mysql.so' - /usr/local/lib/php/20060613/pdo_mysql.so: undefined symbol: php_pdo_get_dbh_ce in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613/pdo_pgsql.so' - /usr/local/lib/php/20060613/pdo_pgsql.so: undefined symbol: php_pdo_register_driver in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613/pdo_sqlite.so' - /usr/local/lib/php/20060613/pdo_sqlite.so: undefined symbol: php_pdo_register_driver in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613/sqlite.so' - /usr/local/lib/php/20060613/sqlite.so: undefined symbol: php_pdo_register_driver in Unknown on line 0 I've included the extensions in my php.ini file, but I'm completely lost on where to go from here because the error is less than helpful. The order that I've included them is extension=pdo.so extension=pdo_mysql.so extension=pdo_pgsql.so extension=pdo_sqlite.so extension=sqlite.so and they do exist, as shown here -rwxr-xr-x 1 root root 364012 May 14 2007 apc.so -rwxr-xr-x 1 root root 102531 Aug 18 14:25 ldap.so -rwxr-xr-x 1 root root 120644 Aug 18 14:25 mysql.so -rwxr-xr-x 1 root root 270860 Nov 13 2006 oci8.so -rwxr-xr-x 1 root root 125246 Aug 18 14:25 pdo_mysql.so -rwxr-xr-x 1 root root 100772 Aug 18 14:25 pdo_oci.so -rwxr-xr-x 1 root root 111246 Aug 18 14:25 pdo_pgsql.so -rwxr-xr-x 1 root root 270276 Aug 18 14:25 pdo.so -rwxr-xr-x 1 root root 1370516 Aug 18 14:25 pdo_sqlite.so -rwxr-xr-x 1 root root 235943 Aug 18 14:25 pgsql.so -rwxr-xr-x 1 root root 1010437 Aug 18 14:25 sqlite.so -rwxr-xr-x 1 root root 598407 Jan 29 2008 xdebug.so I'm using RHEL 4, and have installed the sqlite-devel, but I think php is choosing to use the sqlite that comes with it I'm hoping someone on the list can point me in the right direction. Thanks in advance, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pear File_Archive examples or _good_ documentation?
The authors site is unreachable so I cant check it for examples, but last I remember he didnt have very good examples to begin with. Does anyone, who's used this package have decent examples that showcase how to use it and use it well? In particular I'm looking for info on how to extract archives that meet the criteria below. - one folder with multiple items (including other folders) in it - multiple items(files or folders) at first level of the archive Reading the inline docs for the Pear class is less than useful for me because there's no concrete examples I can work off of...unless I'm blind and am completely missing something. Help anyone? Thanks, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php