Bug #63075 [Com]: PHP Segfault in PDO ODBC Execute

[email protected] ("kubaszymanowski at gmail dot com")
Newsgroups php.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=63075&edit=1

 ID:                 63075
 Comment by:         kubaszymanowski at gmail dot com
 Reported by:        Ew6jQ8tSJhf3 at dyweni dot com
 Summary:            PHP Segfault in PDO ODBC Execute
 Status:             Feedback
 Type:               Bug
 Package:            PDO ODBC
 Operating System:   Linux x86_64 (CentOS 5.8 final)
 PHP Version:        5.4.6
 Block user comment: N
 Private report:     N

 New Comment:

@requinix
I have compiled PHP 7.1.3 from source with no extensions but PDO-ODBC and it works. Previously I have been installing PHP using apt-get from Ondřej Surý. I will now try to replicate the production configuration(all needed extensions) from source and get back to you if I get the SEGFAULT.


Previous Comments:
------------------------------------------------------------------------
[2017-03-30 14:58:05] [email protected]

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.

@kubaszymanowski, can you generate and post a backtrace?

------------------------------------------------------------------------
[2017-03-30 14:32:54] kubaszymanowski at gmail dot com

I get the same error running PHP 5.6 and 7.1 on Ubuntu 16.04.1

Files I used for testing:

<?php
$c = odbc_connect("DSN_NAME", "Master", "pass");
odbc_exec($c, "SELECT COUNT(*) FROM dp");

<?php
$pdo = new PDO("odbc:DSN_NAME");
$pdo->query("SELECT COUNT(*) FROM dp");

------------------------------------------------------------------------
[2012-09-12 19:51:50] Ew6jQ8tSJhf3 at dyweni dot com

The 5.2.17-6.ius.el5 version of PHP from the IUS repositories works OK too.

FYI IUS is http://iuscommunity.org/

------------------------------------------------------------------------
[2012-09-12 19:44:03] Ew6jQ8tSJhf3 at dyweni dot com

I tested the 5.3.16-1.ius.el5 version of PHP from the IUS repository... These have the same issue.

I tested the 5.3.3-13.el5_8 version of PHP from the CentOS5 Updates repository... These work OK.

------------------------------------------------------------------------
[2012-09-12 19:22:30] Ew6jQ8tSJhf3 at dyweni dot com

Breaking GDB at /usr/src/debug/php-5.4.6/ext/pdo/pdo_stmt.c:514:


(gdb) p stmt
$6 = (pdo_stmt_t *) 0x2aaaab283960
(gdb) p *stmt
$7 = {std = {ce = 0xbbd490, properties = 0x0, properties_table = 0x2aaaab284440, guards = 0x0}, methods = 0x2aaab09b9640, driver_data = 0x2aaaab283ad8, executed = 0, 
supports_placeholders = 2, _reserved = 0, column_count = 0,
  columns = 0x0, database_object_handle = {value = {lval = 46909632806913, dval = 2.3176438028923198e-310, str = {val = 0x2aaa00000001 <Address 0x2aaa00000001 out of 
bounds>, len = -1336223392}, ht = 0x2aaa00000001, obj = {handle = 1,
        handlers = 0x2aaab05ad960}}, refcount__gc = 2, type = 5 '\005', is_ref__gc = 0 '\000'}, dbh = 0x2aaaab2842b0, bound_params = 0x0, bound_param_map = 0x0, 
bound_columns = 0x0, row_count = 0,
  query_string = 0x2aaaab284c20 "SELECT fid, original_filename, dateUploaded, filesize, client FROM upload ORDER BY dateUploaded DESC", query_stringlen = 100, 
active_query_string = 0x0, active_query_stringlen = 0, error_code = "00000",
  lazy_object_ref = {value = {lval = 0, dval = 0, str = {val = 0x0, len = 0}, ht = 0x0, obj = {handle = 0, handlers = 0x0}}, refcount__gc = 0, type = 0 '\000', is_ref__gc 
= 0 '\000'}, refcount = 1, default_fetch_type = PDO_FETCH_BOTH,
  fetch = {column = 0, cls = {ce = 0x0, ctor_args = 0x0, retval_ptr = 0x0, fci = {size = 0, function_table = 0x0, function_name = 0x0, symbol_table = 0x0, retval_ptr_ptr = 
0x0, param_count = 0, params = 0x0, object_ptr = 0x0,
        no_separation = 0 '\000'}, fcc = {initialized = 0 '\000', function_handler = 0x0, calling_scope = 0x0, called_scope = 0x0, object_ptr = 0x0}}, func = {function = 
0x0, fetch_args = 0x0, object = 0x0, fci = {size = 0,
        function_table = 0x0, function_name = 0x0, symbol_table = 0x0, retval_ptr_ptr = 0x0, param_count = 0, params = 0x0, object_ptr = 0x0, no_separation = 0 '\000'}, 
fcc = {initialized = 0 '\000', function_handler = 0x0,
        calling_scope = 0x0, called_scope = 0x0, object_ptr = 0x0}, values = 0x0}, into = 0x0}, named_rewrite_template = 0x0}


(gdb) n
515                     if (stmt->active_query_string && stmt->active_query_string != stmt->query_string) {


(gdb) p stmt
$12 = (pdo_stmt_t *) 0x2aaaffffffff
(gdb) p *stmt
Cannot access memory at address 0x2aaaffffffff

------------------------------------------------------------------------


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=63075


--
Edit this bug report at https://bugs.php.net/bug.php?id=63075&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.