Bug 171064 - odbc_exec segfaults in MyODBC
Summary: odbc_exec segfaults in MyODBC
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: php
Version: 6
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Joe Orton
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-10-17 20:17 UTC by Patrick Monnerat
Modified: 2008-08-02 23:40 UTC (History)
0 users

Fixed In Version: fc6
Clone Of:
Environment:
Last Closed: 2007-01-22 14:50:19 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Patrick Monnerat 2005-10-17 20:17:01 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc4 Firefox/1.0.7

Description of problem:
Upon execution in a good context (no other error, single record matching) of
odbc_exec($res,  "select * from GRPARAME where PRCODE = 'ODBCCMTOPTION'")
on a MySQL database, php terminates with a segmentation fault.
Same statement executed from OpenOffice in the same DB/ODBC context works perfectly.

Version-Release number of selected component (if applicable):
php-odbc-5.0.4-10.4

How reproducible:
Always

Steps to Reproduce:
1) In a MySQL database, create and fill a table as:
CREATE TABLE `GRPARAME` (
  `PRCODE` char(15) NOT NULL default '',
  `PRDESC` char(50) NOT NULL default '',
  `PRTYPE` char(3) NOT NULL default '',
  `PREDIT` char(1) NOT NULL default '',
  `PRDFVAL` char(128) NOT NULL default '',
  `PRVALUE` char(128) NOT NULL default '',
  `PRSTATUS` char(1) NOT NULL default '',
  `PRCRTSTP` decimal(14,0) NOT NULL default '0',
  `PRCRUSER` char(10) NOT NULL default '',
  `PRCHTSTP` decimal(14,0) NOT NULL default '0',
  `PRCHUSER` char(10) NOT NULL default '',
  `PRCNTSTP` decimal(14,0) NOT NULL default '0',
  `PRCNUSER` char(10) NOT NULL default '',
  PRIMARY KEY  (`PRCODE`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
2) Configure ODBC to acess it.
3) Call odbc_exec from php with a statement as above after getting the resource for this database.

Actual Results:  Segmentation fault.

Expected Results:  Successful query from PHP.

Additional info:

MyODBC-2.50.39-25.FC4.1
unixODBC-2.2.11-3.FC4.1
mysql-4.1.14-1.FC4.1

Stack trace from gdb on /usr/bin/php:
#0  0x001bf7e9 in my_SQLPrepare () from /usr/lib/libmyodbc.so
#1  0x001bc793 in SQLExecDirect () from /usr/lib/libmyodbc.so
#2  0x006cb842 in SQLExecDirect () from /usr/lib/libodbc.so.1
#3  0x00d2b1ce in zif_odbc_exec () from /usr/lib/php/modules/odbc.so
#4  0x08194113 in zend_do_fcall_common_helper ()
#5  0x081a1d22 in zend_do_fcall_handler ()
#6  0x08191ac7 in execute ()
#7  0x08193b25 in zend_do_fcall_common_helper ()
#8  0x08191ac7 in execute ()
#9  0x08173aba in zend_execute_scripts ()
#10 0x0813e7e0 in php_execute_script ()
#11 0x081a859e in main ()

ODBC config:
[LINUXDEV_GENERIGHT]
Description     =       Generight test database
Driver          =       /usr/lib/libmyodbc.so
DATABASE        =       GENERIGHT
Server          =       localhost
Port            =       3306

Also crashes within Apache.
Might be a MyODBC problem...

Comment 1 Christian Iseli 2007-01-22 10:07:56 UTC
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Thanks.

Comment 2 Patrick Monnerat 2007-01-22 14:50:19 UTC
In FC6, it works properly with:
php-5.1.6-3.3.fc6
php-odbc-5.1.6-3.3.fc6
unixODBC-2.2.11-7.1
mysql-5.0.27-1.fc6
mysql-odbc-connector-3.51.12-2.2

Closing the case


Note You need to log in before you can comment on or make changes to this bug.