php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56782 Changing ini value sqlite.assoc_case to 1 or 2 produces a bus error
Submitted: 2006-01-19 05:43 UTC Modified: 2009-02-25 14:51 UTC
From: php at diptyque dot net Assigned:
Status: Wont fix Package: SQLite (PECL)
PHP Version: 4.4.1 OS: FreeBSD 4.4
Private report: No CVE-ID: None
 [2006-01-19 05:43 UTC] php at diptyque dot net
Description:
------------
Changing the value of the ini setting sqlite.assoc_case to 
1 or 2 makes php crash.

Tested with PHP 4.4.2 w/ SQLite 1.0.3 -- libsqlite upgraded 
to version 2.8.17

Reproduce code:
---------------
<?php
if (is_file('test.db')) {
   unlink ('test.db');
}

ini_set('sqlite.assoc_case', 1); // or 2
$query = <<<END_OF_SQL
    CREATE TABLE authors (
        id INTEGER PRIMARY KEY,
        name VARCHAR(100),
        email VARCHAR(150)
    );
END_OF_SQL;

$db = sqlite_open('test.db');

sqlite_query($db, $query);

$query = 'PRAGMA table_info(authors)';

$result = sqlite_query($db, $query);
?>

Expected result:
----------------
Not a Segmentation fault anyway. I guess this is the same 
bug reported at http://bugs.php.net/bug.php?id=34884

Actual result:
--------------
gdb php php.core
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public 
License, and you are
welcome to change it and/or distribute copies of it under 
certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show 
warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...
Core was generated by `php'.
Program terminated with signal 10, Bus error.
Reading symbols from /usr/lib/libcrypt.so.2...done.
Reading symbols from 
/usr/local/lib/libc-client4.so.8...done.
Reading symbols from 
/usr/local/lib/mysql/libmysqlclient.so.12...done.
Reading symbols from /usr/lib/libpam.so.1...done.
Reading symbols from /usr/local/lib/libgd.so.2...done.
Reading symbols from 
/usr/local/lib/libfreetype.so.7...done.
Reading symbols from /usr/local/lib/libpng.so.5...done.
Reading symbols from /usr/lib/libz.so...done.
Reading symbols from /usr/local/lib/libjpeg.so.9...done.
Reading symbols from /usr/lib/libbz2.so.1...done.
Reading symbols from /usr/lib/libm.so.2...done.
Reading symbols from /usr/local/lib/libcurl.so.2...done.
Reading symbols from /usr/lib/libc.so.4...done.
Reading symbols from /usr/lib/libssl.so.2...done.
Reading symbols from /usr/lib/libcrypto.so.2...done.
Reading symbols from 
/usr/local/Zend/lib/ZendExtensionManager.so...done.
Reading symbols from 
/usr/local/www/lib/php/extensions/no-debug-non-zts-20020429
/sqlite.so...done.
Reading symbols from 
/usr/local/Zend/lib/Optimizer-2.5.10/php-4.4.x/ZendOptimize
r.so...done.
Reading symbols from /usr/libexec/ld-elf.so.1...done.
#0  php_sqlite_fetch (rres=0x843be4c) at 
/usr/local/src/SQLite-1.0.3/sqlite.c:63
63                      *s = toupper(*s);

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-19 06:15 UTC] php at diptyque dot net
Oops, my apologies 'cause this bug produces a signal 10 
(bus error) rather than a seg fault.
 [2006-01-20 10:08 UTC] php at diptyque dot net
Additional backtrace info:

(gdb) bt
#0  php_sqlite_fetch (rres=0x843be8c) at 
/usr/local/src/SQLite-1.0.3/sqlite.c:63
#1  0x287447bf in sqlite_query (db=0x843e20c, sql=0x843bacc 
"PRAGMA table_info(authors)", sql_len=26, mode=3, 
buffered=1, 
    return_value=0x843ad0c, rres=0x843be8c) at 
/usr/local/src/SQLite-1.0.3/sqlite.c:1033
#2  0x28744aa4 in zif_sqlite_query (ht=2, 
return_value=0x843ad0c, this_ptr=0x0, return_value_used=1)
    at /usr/local/src/SQLite-1.0.3/sqlite.c:1117
#3  0x287abac1 in zend_oe () from 
/usr/local/Zend/lib/Optimizer-2.5.10/php-4.4.x/ZendOptimize
r.so
#4  0x287a93a6 in zend_oe () from 
/usr/local/Zend/lib/Optimizer-2.5.10/php-4.4.x/ZendOptimize
r.so
#5  0x814f007 in php_execute_script 
(primary_file=0xbfbffac4) at 
/usr/local/src/php-4.4.2/main/main.c:1753
#6  0x818d591 in main (argc=3, argv=0xbfbffb2c) at 
/usr/local/src/php-4.4.2/sapi/cli/php_cli.c:830
#7  0x808469d in _start ()
 [2009-02-25 14:51 UTC] philip at roshambo dot org
This will [likely] never be fixed. This PECL extension is no longer maintained, and I doubt ever will be. Instead use the well maintained sqlite extension that comes with the PHP sources.

The sqlite pecl page has been updated to reflect this.

See also: http://php.net/pecl.phpize

If this bug still exists, report it at http://bugs.php.net/
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 22:01:27 2024 UTC