php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74946 Adding BOOLEAN field to table crashes php on select
Submitted: 2017-07-18 20:13 UTC Modified: 2021-03-31 11:39 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: rudi dot feijo at multidadosti dot com dot br Assigned:
Status: Suspended Package: InterBase related
PHP Version: 7.1.7 OS: win2012 R2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rudi dot feijo at multidadosti dot com dot br
New email:
PHP Version: OS:

 

 [2017-07-18 20:13 UTC] rudi dot feijo at multidadosti dot com dot br
Description:
------------
Adding a BOOLEAN field to a table, then trying any SELECT from that table crashes the server

Test script:
---------------
<?php
/* sql for db :

CREATE DATABASE 'c:\test.fdb'
USER 'SYSDBA' PASSWORD 'masterkey'
PAGE_SIZE 16384
DEFAULT CHARACTER SET WIN1252 COLLATION WIN1252;

CREATE TABLE ASD (
    AA         INTEGER
);

ALTER TABLE ASD ADD NEW_FIELD BOOLEAN; 

*/

$c = ibase_connect('localhost:C:\\test.fdb','SYSDBA','masterkey');

$q = ibase_query('select * from asd');
$r = ibase_fetch_assoc($q);
echo ibase_errmsg();
echo array_keys($r)[0];

Actual result:
--------------
php crash (error 500)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-18 20:16 UTC] rudi dot feijo at multidadosti dot com dot br
Firebird version 3.0.2 64bit windows
PHP version is also 64bit

Crash happens on any environment, command line php or webserver
 [2017-07-18 20:18 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2017-07-18 20:18 UTC] requinix@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2017-07-18 21:04 UTC] rudi dot feijo at multidadosti dot com dot br
-Status: Feedback +Status: Open
 [2017-07-18 21:04 UTC] rudi dot feijo at multidadosti dot com dot br
backtrace 

Loading control script C:\Program Files\DebugDiag\scripts\CrashRule_Process_php-cgi.exe.vbs
DumpPath set to C:\Program Files\DebugDiag\Logs\Crash rule for all instances of php-cgi.exe
[7/18/2017 5:46:08 PM]
  Process created. BaseModule - C:\webserver\php-7.1.7\php-cgi.exe. BaseThread - System ID: 10572
  C:\WINDOWS\SYSTEM32\ntdll.dll loaded at 0xf8730000
  Thread created. New thread - System ID: 12360
  C:\WINDOWS\system32\KERNEL32.DLL loaded at 0xf5e60000
  C:\Program Files (x86)\AVG\Antivirus\x64\aswhooka.dll loaded at 0xd2c10000
  C:\WINDOWS\system32\KERNELBASE.dll loaded at 0xf5920000
  C:\webserver\php-7.1.7\php7.dll loaded at 0xb6670000
  C:\WINDOWS\system32\WS2_32.dll loaded at 0xf8330000
  C:\WINDOWS\system32\ADVAPI32.dll loaded at 0xf7f50000
  C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll loaded at 0xde390000
  C:\WINDOWS\SYSTEM32\api-ms-win-crt-stdio-l1-1-0.dll loaded at 0xeb4d0000
  C:\WINDOWS\SYSTEM32\api-ms-win-crt-heap-l1-1-0.dll loaded at 0xeaf90000
  C:\WINDOWS\SYSTEM32\api-ms-win-crt-string-l1-1-0.dll loaded at 0xde5d0000
  C:\WINDOWS\SYSTEM32\api-ms-win-crt-runtime-l1-1-0.dll loaded at 0xde380000
  C:\WINDOWS\SYSTEM32\api-ms-win-crt-convert-l1-1-0.dll loaded at 0xde370000
  C:\WINDOWS\SYSTEM32\api-ms-win-crt-environment-l1-1-0.dll loaded at 0xde2d0000
  C:\WINDOWS\SYSTEM32\api-ms-win-crt-filesystem-l1-1-0.dll loaded at 0xdca90000
  C:\WINDOWS\SYSTEM32\api-ms-win-crt-math-l1-1-0.dll loaded at 0xdb810000
  C:\WINDOWS\SYSTEM32\api-ms-win-crt-locale-l1-1-0.dll loaded at 0xd8bf0000
  C:\WINDOWS\system32\ole32.dll loaded at 0xf7b10000
  C:\WINDOWS\system32\USER32.dll loaded at 0xf62a0000
  C:\WINDOWS\SYSTEM32\DNSAPI.dll loaded at 0xf4ed0000
  C:\WINDOWS\system32\PSAPI.DLL loaded at 0xf6290000
  C:\WINDOWS\SYSTEM32\api-ms-win-crt-time-l1-1-0.dll loaded at 0xd5d60000
  C:\WINDOWS\SYSTEM32\api-ms-win-crt-utility-l1-1-0.dll loaded at 0xd5570000
  C:\WINDOWS\system32\NSI.dll loaded at 0xf8320000
  C:\WINDOWS\system32\RPCRT4.dll loaded at 0xf84e0000
  C:\WINDOWS\system32\msvcrt.dll loaded at 0xf5db0000
  C:\WINDOWS\SYSTEM32\sechost.dll loaded at 0xf6010000
  C:\WINDOWS\SYSTEM32\combase.dll loaded at 0xf6070000
  C:\WINDOWS\system32\GDI32.dll loaded at 0xf8390000
  C:\WINDOWS\system32\SspiCli.dll loaded at 0xf5a40000
  C:\WINDOWS\SYSTEM32\ucrtbase.DLL loaded at 0xd40b0000
  C:\Program Files\Diebold\Warsaw\wslbscr64.dll loaded at 0xb86c0000
  C:\WINDOWS\SYSTEM32\ntmarta.dll loaded at 0xf0740000
  C:\Program Files\Diebold\Warsaw\wslbscrwh64.dll loaded at 0xb8470000
  c:\webserver\php-7.1.7\ext\php_opcache.dll loaded at 0xcf5c0000
  c:\webserver\php-7.1.7\ext\php_com_dotnet.dll loaded at 0xd37a0000
  C:\WINDOWS\system32\OLEAUT32.dll loaded at 0x6d550000
  c:\webserver\php-7.1.7\ext\php_bz2.dll loaded at 0xcf490000
  c:\webserver\php-7.1.7\ext\php_curl.dll loaded at 0xc4e70000
  C:\webserver\php-7.1.7\libssh2.dll loaded at 0x80000000
  C:\webserver\php-7.1.7\nghttp2.dll loaded at 0xcf450000
  C:\webserver\php-7.1.7\LIBEAY32.dll loaded at 0xb6430000
  C:\webserver\php-7.1.7\SSLEAY32.dll loaded at 0xc0b20000
  C:\WINDOWS\system32\WLDAP32.dll loaded at 0xf5fa0000
  C:\WINDOWS\system32\Normaliz.dll loaded at 0xf8250000
  C:\WINDOWS\system32\CRYPT32.dll loaded at 0x71a00000
  C:\WINDOWS\SYSTEM32\api-ms-win-crt-conio-l1-1-0.dll loaded at 0xd4fd0000
  C:\WINDOWS\system32\MSASN1.dll loaded at 0xf5900000
  c:\webserver\php-7.1.7\ext\php_fileinfo.dll loaded at 0xb6120000
  c:\webserver\php-7.1.7\ext\php_gd2.dll loaded at 0xb5f90000
  c:\webserver\php-7.1.7\ext\php_intl.dll loaded at 0xb8640000
  C:\webserver\php-7.1.7\icuuc57.dll loaded at 0x72690000
  C:\webserver\php-7.1.7\icuin57.dll loaded at 0x72490000
  C:\webserver\php-7.1.7\icuio57.dll loaded at 0x72470000
  C:\WINDOWS\SYSTEM32\MSVCP140.dll loaded at 0xb8580000
  C:\webserver\php-7.1.7\icudt57.dll loaded at 0x708f0000
  C:\WINDOWS\SYSTEM32\api-ms-win-crt-multibyte-l1-1-0.dll loaded at 0xd3d60000
  c:\webserver\php-7.1.7\ext\php_imap.dll loaded at 0xb5ea0000
  C:\WINDOWS\SYSTEM32\WINMM.dll loaded at 0xeca60000
  C:\WINDOWS\SYSTEM32\Secur32.dll loaded at 0xe0ad0000
  C:\WINDOWS\SYSTEM32\WINMMBASE.dll loaded at 0xeca30000
  C:\WINDOWS\SYSTEM32\cfgmgr32.dll loaded at 0xf5cb0000
  C:\WINDOWS\SYSTEM32\DEVOBJ.dll loaded at 0xf4670000
  c:\webserver\php-7.1.7\ext\php_interbase.dll loaded at 0xcf430000
  C:\WINDOWS\SYSTEM32\fbclient.dll loaded at 0xb5ce0000
  C:\WINDOWS\system32\SHELL32.dll loaded at 0x71c20000
  C:\WINDOWS\SYSTEM32\MSVCR100.dll loaded at 0x77a70000
  C:\WINDOWS\SYSTEM32\MPR.dll loaded at 0xeb3a0000
  C:\WINDOWS\system32\SHLWAPI.dll loaded at 0x73150000
  c:\webserver\php-7.1.7\ext\php_ldap.dll loaded at 0xc0ae0000
  C:\webserver\php-7.1.7\libsasl.dll loaded at 0xc4e00000
  c:\webserver\php-7.1.7\ext\php_mbstring.dll loaded at 0xb5b80000
  c:\webserver\php-7.1.7\ext\php_exif.dll loaded at 0xc4720000
  c:\webserver\php-7.1.7\ext\php_mysqli.dll loaded at 0xc0790000
  c:\webserver\php-7.1.7\ext\php_openssl.dll loaded at 0xc0590000
  c:\webserver\php-7.1.7\ext\php_pdo_mysql.dll loaded at 0xd3740000
  c:\webserver\php-7.1.7\ext\php_soap.dll loaded at 0xb8530000
  c:\webserver\php-7.1.7\ext\php_sockets.dll loaded at 0xc0ac0000
  C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL loaded at 0xeee60000
  C:\WINDOWS\SYSTEM32\WINNSI.DLL loaded at 0xeee30000
  C:\WINDOWS\system32\mswsock.dll loaded at 0xf50d0000
  Thread created. New thread - System ID: 364
  Initializing control script
  Clearing any existing breakpoints
  
  Current Breakpoint List(BL)
  Thread exited. Exiting thread - System ID: 364. Exit code - 0x00000000
[7/18/2017 5:46:13 PM]
  C:\WINDOWS\SYSTEM32\SHCORE.dll loaded at 0xf3df0000
  C:\WINDOWS\SYSTEM32\profapi.dll loaded at 0xf5850000
  Exception 0XE06D7363 on thread 10572. DetailID = 1
  Thread created. New thread - System ID: 568
  C:\WINDOWS\SYSTEM32\CRYPTSP.dll loaded at 0xf5150000
  C:\WINDOWS\system32\rsaenh.dll loaded at 0xf4ce0000
  C:\WINDOWS\SYSTEM32\bcrypt.dll loaded at 0xf53a0000
  C:\WINDOWS\SYSTEM32\CRYPTBASE.dll loaded at 0xf5720000
  C:\WINDOWS\SYSTEM32\bcryptPrimitives.dll loaded at 0xf56b0000
  C:\WINDOWS\system32\napinsp.dll loaded at 0xeaeb0000
  C:\WINDOWS\system32\pnrpnsp.dll loaded at 0xeae60000
  C:\WINDOWS\system32\NLAapi.dll loaded at 0xf0480000
  C:\WINDOWS\System32\winrnr.dll loaded at 0xeaa00000
  C:\WINDOWS\system32\wshbth.dll loaded at 0xea9e0000
  C:\Program Files\Bonjour\mdnsNSP.dll loaded at 0x76000000
  C:\Windows\System32\rasadhlp.dll loaded at 0xe48e0000
  C:\WINDOWS\System32\fwpuclnt.dll loaded at 0xee9a0000
  C:\WINDOWS\SYSTEM32\kernel.appcore.dll loaded at 0xf46c0000
  Thread exited. Exiting thread - System ID: 568. Exit code - 0x00000001
  Thread exited. Exiting thread - System ID: 12360. Exit code - 0x00000001
  Process exited. Exit code - 0x00000001

***********************
*  EXCEPTION DETAILS  *
***********************

DetailID = 1
	Count:    1
	Exception #:  0XE06D7363
	Stack:        
		KERNELBASE!RaiseException+0x6c
		MSVCR100!CxxThrowException+0x81
		fbclient!fb_shutdown+0xce4f
		fbclient!fb_shutdown+0x861c
		fbclient!fb_shutdown+0x2b726
		fbclient!fb_shutdown+0x2ee26
		fbclient!fb_shutdown+0xb707
		fbclient!fb_shutdown+0xb86d
		fbclient!fb_shutdown+0xb8e0
		fbclient!fb_shutdown+0x32d66
		fbclient!isc_start_transaction+0x1125
		fbclient!isc_start_transaction+0x1e5e
		fbclient!isc_attach_database+0x3ab
		php_interbase!_php_ibase_connect+0x5d9 [c:\php-sdk\php71\vc14\x64\php-7.1.7\ext\interbase\interbase.c @ 982]
		php7!execute_ex+0x157 [c:\php-sdk\php71\vc14\x64\php-7.1.7\zend\zend_vm_execute.h @ 432]
		php7!zend_execute+0x159 [c:\php-sdk\php71\vc14\x64\php-7.1.7\zend\zend_vm_execute.h @ 475]
		php7!zend_execute_scripts+0x119 [c:\php-sdk\php71\vc14\x64\php-7.1.7\zend\zend.c @ 1477]
		php7!php_execute_script+0x424 [c:\php-sdk\php71\vc14\x64\php-7.1.7\main\main.c @ 2537]
		php_cgi!main+0x1727 [c:\php-sdk\php71\vc14\x64\php-7.1.7\sapi\cgi\cgi_main.c @ 2654]
		php_cgi!__scrt_common_main_seh+0x11d [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 253]
		KERNEL32!BaseThreadInitThunk+0x22
		ntdll!RtlUserThreadStart+0x34





***********************
*  EXCEPTION SUMMARY  *
***********************

	|--------------------|
	| Count | Exception  |
	|--------------------|
	| 1     | 0XE06D7363 |
	|--------------------|

Debugging Overhead Cost:
	Total Elapsed Ticks = 5390 (100%)
	Total Ticks Spent in Debugger Engine = 62 (1%)
	Total Ticks Spent in Crash Rule Script = 187 (3%)
 [2017-07-19 13:24 UTC] rudi dot feijo at multidadosti dot com dot br
Not sure if the backtrace is showing anything.
Further info :

This is the php error returned when I try to select from a table which have a BOOLEAN field : 

Warning: ibase_fetch_assoc(): Incorrect values within SQLDA structure empty pointer to data at SQLVAR index 1 in C:\webserver\php-7.1.7\ttt.php on line 6 
Incorrect values within SQLDA structure empty pointer to data at SQLVAR index 1 

I can confirm both php and firebird3 are 64-bit, and I have no duplicates of fbclient.dll or gds32.dll, only those that fb3 installs
 [2017-07-21 20:24 UTC] alex at zoosmart dot us
I don't think php interbase or php firebird pdo support boolean field type yet, I looked in the source of ibase_query.c and only found these data types: quad, array, blob, time, date, timestamp, bigint, double precision, float, integer, smallint, varchar, and char. Also see this bug #74462 to add boolean to pdo firebird.
 [2021-03-31 11:39 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2021-03-31 11:39 UTC] cmb@php.net
The interbase extension is moved to PECL[1] as of PHP 7.4.0, and
is looking for a new maintainer.  Until a new maintainer is found,
I suspend this ticket.

Consider to use the bundled PDO_Firebird extension, or the
php-firebird package[2] instead.

[1] <https://pecl.php.net/package/interbase>
[2] <https://github.com/FirebirdSQL/php-firebird>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 15:01:30 2024 UTC