Bug #53626 [Com]: SQLite3 - Segmentation Fault on shutdown

2012-04-23 Thread bugman at mailinator dot com
Edit report at https://bugs.php.net/bug.php?id=53626&edit=1

 ID: 53626
 Comment by: bugman at mailinator dot com
 Reported by:bion at drewcrawfordapps dot com
 Summary:SQLite3 - Segmentation Fault on shutdown
 Status: Verified
 Type:   Bug
 Package:Reproducible crash
 Operating System:   Mac OS X 10.7.1
 PHP Version:5.3.8
 Block user comment: N
 Private report: N

 New Comment:

I was having the same problem.  Apparently it is due to the sqlite3 extension 
being threaded, but php not being compiled with the pthread library.  I was 
able 
to fix it in FreeBSD by recompiling php with the following option:

LINKTHRLink thread lib (for threaded extensions)


Previous Comments:

[2011-12-02 12:12:08] sb at litepc dot com

Additional Info:  reducing extensions.ini to only sqlite3.so (no other modules 
loaded) also gave the Segmentation fault when executing /usr/local/bin/php-cgi 
-v


[2011-12-02 08:33:23] sb at litepc dot com

I get a segfault whenever php-cgi exits even without using sqlite functions.

FreeBSD.  Latest Ports as of 1/12/2011

php5-5.3.8
php5-pdo_sqlite-5.3.8
php5-sqlite-5.3.8
php5-sqlite3-5.3.8
sqlite3-3.7.9


# /usr/local/bin/php-cgi -v
PHP 5.3.8 with Suhosin-Patch (cgi-fcgi) (built: Dec  1 2011 22:33:51)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
Segmentation fault
#

Editing extensions.ini to comment out sqlite3.so *and* pdo_sqlite.so  
eliminates the Segmentation fault error.

With respect to: "This is due the destructor order."

I have tried many permutations of ordering in extensions.ini but found no case 
where enabling sqlite3.so or pdo_sqlite.so worked in any position.

Can not recompile with debug yet as this is a production machine... but will 
attempt to reproduce in test scenario and update.


[2011-09-23 04:55:13] bion at drewcrawfordapps dot com

This bug is still reproducible, and in fact has regressed, since I no longer 
get a 
helpful console error message, but a generic crash report. What are the chances 
of 
getting this fixed?


[2011-06-05 20:28:48] fel...@php.net

This is due the destructor order.


[2011-03-08 20:15:05] bionoren at letu dot edu

It's more helpful. I get the following messages in the Apache error log:
test/index.php(14) : Warning - SQLite3::query() [sqlite3.query]: table test already exists
test/index.php(3) : Catchable fatal error - Argument 1 passed to 
test::__construct() must be an array, boolean given, called in test/index.php 
on line 9 and defined
[Tue Mar 08 13:11:41 2011] [notice] child pid 26396 exit signal Segmentation 
fault (11)

Here's the stack trace:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x
0x0001015d0831 in zend_llist_del_element (l=0x10071c0f0, 
element=0x10208c258, compare=0x10109f549 ) at 
/Users/bion/Downloads/php5.3-201103081730/Zend/zend_llist.c:97
97  next = current->next;




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=53626


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=53626&edit=1


Bug #48785 [Com]: PHP -i segfaults with sqlite.so enabled

2012-04-23 Thread bugman at mailinator dot com
Edit report at https://bugs.php.net/bug.php?id=48785&edit=1

 ID: 48785
 Comment by: bugman at mailinator dot com
 Reported by:gerwin at digitalus dot nl
 Summary:PHP -i segfaults with sqlite.so enabled
 Status: No Feedback
 Type:   Bug
 Package:PDO related
 Operating System:   RHEL 5
 PHP Version:5.3.0
 Block user comment: N
 Private report: N

 New Comment:

I was having the same problem.  Apparently it is due to the sqlite3 extension 
being threaded, but php not being compiled with the pthread library.  I was 
able 
to fix it in FreeBSD by recompiling php with the following option:

LINKTHRLink thread lib (for threaded extensions)


Previous Comments:

[2010-04-15 14:53:47] dr dot hubertschmid at gmail dot com

I have pretty similiar behaviour in 5.3.2 too. I get segfault if a db_file from 
PDO command exists (new PDO("sqlite:db_file");). php -i (-m too) also shows 
segfault:

# php -i
...
pdo_sqlite

PDO Driver for SQLite 3.x => enabled
Segmentation fault



Here is the backtrace:
root@c300:/home/dev# gdb php
GNU gdb 6.8
...
This GDB was configured as "i486-slackware-linux"...
(gdb) run -i
Starting program: /usr/bin/php -i
[Thread debugging using libthread_db enabled]
Error while reading shared library symbols:
Cannot find new threads: generic error
Cannot find new threads: generic error
(gdb) bt
#0  0xb8006351 in _dl_debug_state () from /lib/ld-linux.so.2
#1  0xb8009f0b in dl_open_worker () from /lib/ld-linux.so.2
#2  0xb8005596 in _dl_catch_error () from /lib/ld-linux.so.2
#3  0xb800973e in _dl_open () from /lib/ld-linux.so.2
#4  0xb7dd6bec in dlopen_doit () from /lib/libdl.so.2
#5  0xb8005596 in _dl_catch_error () from /lib/ld-linux.so.2
#6  0xb7dd700c in _dlerror_run () from /lib/libdl.so.2
#7  0xb7dd6b1c in dlopen@@GLIBC_2.1 () from /lib/libdl.so.2
#8  0x081d01e6 in php_load_extension (filename=0xb7c35eb4 "curl.so", type=1, 
start_now=0) at /home/dev/php-5.3.2/ext/standard/dl.c:147
#9  0x082609fc in php_load_php_extension_cb (arg=0x864af88) at 
/home/dev/php-5.3.2/main/php_ini.c:349
#10 0x082c3ed2 in zend_llist_apply (l=0x863ecbc, func=0x82609cd 
) at /home/dev/php-5.3.2/Zend/zend_llist.c:193
#11 0x0826195f in php_ini_register_extensions () at 
/home/dev/php-5.3.2/main/php_ini.c:722
#12 0x082598d6 in php_module_startup (sf=0x862cb20, additional_modules=0x0, 
num_additional_modules=0) at /home/dev/php-5.3.2/main/main.c:2021
#13 0x083a550f in php_cli_startup (sapi_module=0x862cb20) at 
/home/dev/php-5.3.2/sapi/cli/php_cli.c:401
#14 0x083a62f8 in main (argc=2, argv=0xbf87c6d4) at 
/home/dev/php-5.3.2/sapi/cli/php_cli.c:775


[2009-08-12 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".


[2009-08-04 11:37:14] j...@php.net

But does THIS bug still exist?


[2009-07-13 07:37:41] gerwin at digitalus dot nl

# ./configure --disable-all  --enable-pdo=shared --with-sqlite=shared
--with-pdo-sqlite=shared --enable-debug (as you said)

Results in:
configure: error:
You've configured extension pdo_sqlite, which depends on extension sqlite3,
but you've either not enabled sqlite3, or have disabled it.

#./configure --disable-all  --enable-pdo=shared --with-pdo-sqlite=shared 
--enable-debug  --without-sqlite --with-sqlite3

Does work with configure and building but still hitting:
http://bugs.php.net/bug.php?id=48614


[2009-07-10 18:29:32] j...@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

And if that didn't fix the issue, try exactly this configure line:

# ./configure --disable-all  --enable-pdo=shared --with-sqlite=shared
--with-pdo-sqlite=shared --enable-debug

And make sure the modules you build are the actual modules loaded!




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=48785


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=48785&edit=1