|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-12-21 04:20 UTC] laruence@php.net
-Assigned To:
+Assigned To: ab
[2015-12-21 04:20 UTC] laruence@php.net
[2016-02-23 13:42 UTC] ab@php.net
-Status: Assigned
+Status: Feedback
[2016-02-23 13:42 UTC] ab@php.net
[2016-03-06 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 12:00:01 2025 UTC |
Description: ------------ When the query returns a non UTF-8 character, odbc_fetch_array generates SIGFAULT If the record contains normal UTF-8 (for example Chinese characters) it works fine. The SQL Server field containing non UTF-8 chars has been defined as NVARCHAR(40) Test script: --------------- $dbConn = odbc_connect("Driver={ODBC Driver 11 for SQL Server};Server=myserver.domain.com", 'MyUSER', 'MyPWD'); $query = "SELECT [TXTMD] FROM [/BI0/TMATERIAL] WHERE [LANGU] = 'E' AND [MATERIAL] = 'T_PO1234568'"; $r = odbc_exec($dbConn,$query); while($record = odbc_fetch_array($r) ) print_r($record); odbc_close($dbConn); Expected result: ---------------- If I run it with WHERE [LANGU] = '1' I get UTF-8 chars Array ( [TXTMD] => JLGLQ-0.45-100£¬¹ýÂËÆ÷,ˮϵPES,0.45um,100/°ü ) with WHERE [LANGU] = 'E' I get segfault. The actual records contains non UTF-8 chars Actual result: -------------- edsradmin@SHALSTest:~/apps.cndb/scripts/cndb$ gdb /usr/local/php/7.0.1/bin/php core GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /usr/local/php/7.0.1/bin/php...done. [New LWP 16450] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `php -q ./tmp/odbc_sqlsrv.php'. Program terminated with signal SIGSEGV, Segmentation fault. #0 __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:116 116 ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: No such file or directory. Traceback (most recent call last): File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module> from libstdcxx.v6.printers import register_libstdcxx_printers ImportError: No module named 'libstdcxx' (gdb) bt #0 __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:116 #1 0x00000000006ecfeb in zend_string_init (str=0x7f6e2ba76080 "", len=18446744073709551612, persistent=0) at /home/edsradmin/software/php-7.0.1/Zend/zend_string.h:159 #2 0x00000000006f16ec in php_odbc_fetch_hash (execute_data=0x7f6e2ba14120, return_value=0x7f6e2ba14110, result_type=2) at /home/edsradmin/software/php-7.0.1/ext/odbc/php_odbc.c:1812 #3 0x00000000006f18d8 in zif_odbc_fetch_array (execute_data=0x7f6e2ba14120, return_value=0x7f6e2ba14110) at /home/edsradmin/software/php-7.0.1/ext/odbc/php_odbc.c:1848 #4 0x0000000000a32ed8 in ZEND_DO_ICALL_SPEC_HANDLER () at /home/edsradmin/software/php-7.0.1/Zend/zend_vm_execute.h:586 #5 0x0000000000a32913 in execute_ex (ex=0x7f6e2ba14030) at /home/edsradmin/software/php-7.0.1/Zend/zend_vm_execute.h:414 #6 0x0000000000a32a25 in zend_execute (op_array=0x7f6e2ba83000, return_value=0x0) at /home/edsradmin/software/php-7.0.1/Zend/zend_vm_execute.h:458 #7 0x00000000009d7c8b in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/edsradmin/software/php-7.0.1/Zend/zend.c:1428 #8 0x00000000009451e8 in php_execute_script (primary_file=0x7ffc7fc3fec0) at /home/edsradmin/software/php-7.0.1/main/main.c:2471 #9 0x0000000000a96c73 in do_cli (argc=3, argv=0x2b821c0) at /home/edsradmin/software/php-7.0.1/sapi/cli/php_cli.c:974 #10 0x0000000000a97e37 in main (argc=3, argv=0x2b821c0) at /home/edsradmin/software/php-7.0.1/sapi/cli/php_cli.c:1345