|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-01-27 17:00 UTC] nlopess@php.net
Description:
------------
I've found a couple of sqlite weird problems (php 5.1).
verified with both linux and windows.
Reproduce code:
---------------
<?
$error = '';
$idx = new SQLiteDatabase('ini_changelog.sqlite', 0666, $error);
$tags = array_map('rtrim', array_merge(file('version4.tags'), file('version5.tags')));
print_r($tags);
?>
prints a warning (and array empty). removing the $error declaration outputs a notice, but works.
---------------
#2
<?
$error = '';
$idx = new SQLiteDatabase('ini_changelog.sqlite', 0666, $error);
$tags = array_map('rtrim', array_merge(file('version4.tags'), file('version5.tags')));
print_r($tags);
$sql = 'CREATE TABLE changelog (
name VARCHAR(200) PRIMARY KEY,';
foreach($tags as $tag) {
$sql .= " $tag TINYINT,";
}
$idx->query($sql);
Actual result:
--------------
1st example:
Warning: array_map(): The first argument, '~??o', should be either NULL or a valid callback in /transfer/test.php on line 6
(notice the garbidge in the name of the function)
--------------------------------
2nd example:
Program received signal SIGSEGV, Segmentation fault.
0x403bb848 in pthread_mutex_lock () from /lib/libpthread.so.0
(gdb) bt
#0 0x403bb848 in pthread_mutex_lock () from /lib/libpthread.so.0
#1 0x40462925 in free () from /lib/libc.so.6
#2 0x081d4222 in shutdown_memory_manager (silent=0, full_shutdown=0)
at /cvs/php-src/Zend/zend_alloc.c:582
#3 0x081b3a01 in php_request_shutdown (dummy=0x0)
at /cvs/php-src/main/main.c:1225
#4 0x0824b1af in main (argc=2, argv=0xbffff9b4)
at /cvs/php-src/sapi/cli/php_cli.c:1047
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 19:00:02 2025 UTC |
Well, I've already posted 2 examples with backtraces above. I've run the ini-update.php script (available in the above URL) and I got this: #0 0x4046dd67 in mallopt () from /lib/libc.so.6 #1 0x4046db5e in mallopt () from /lib/libc.so.6 #2 0x4046c908 in free () from /lib/libc.so.6 #3 0x081ea0e7 in shutdown_memory_manager (silent=0, full_shutdown=0) at /cvs/php-src/Zend/zend_alloc.c:511 #4 0x081c9821 in php_request_shutdown (dummy=0x0) at /cvs/php-src/main/main.c:1228 #5 0x082633df in main (argc=2, argv=0xbffff944) at /cvs/php-src/sapi/cli/php_cli.c:1057