php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55104 Calling mysqli::get_attr() leads php to crash.
Submitted: 2011-07-01 11:25 UTC Modified: 2013-02-18 00:34 UTC
From: 1000235409 at smail dot shnu dot edu dot cn Assigned:
Status: No Feedback Package: MySQLi related
PHP Version: Irrelevant OS: Mac OS X 10.6.7
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: 1000235409 at smail dot shnu dot edu dot cn
New email:
PHP Version: OS:

 

 [2011-07-01 11:25 UTC] 1000235409 at smail dot shnu dot edu dot cn
Description:
------------
Calling mysqli::get_attr() under Mac OS X always leads php to crash with exit code 
139, even after receiving true with calling mysqli::set_attr() before.

Proved under PHP-CGI 5.3.3 with MySQL 5.1.44.

This situation will not happen under Windows and Linux (at least Ubuntu 10.10).

Test script:
---------------
$conn=new mysqli('localhost', 'root', '', 'test', 3306, '/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock');
$stmt=$conn->stmt_init();
$stmt->prepare('select 1+1');
$a=$stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE,MYSQLI_CURSOR_TYPE_READ_ONLY);
var_dump($a); //true
$stmt->attr_get(MYSQLI_STMT_ATTR_CURSOR_TYPE); //php crashed with exit value 139.
$stmt->execute();
echo $stmt->attr_get(MYSQLI_STMT_ATTR_CURSOR_TYPE);// ...or, put that code here, and the same problem happens.
echo 'SUCC';

Expected result:
----------------
SUCC

Actual result:
--------------
*SIMPLY CRASHED*

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-01 11:48 UTC] aharvey@php.net
-Status: Open +Status: Feedback
 [2011-07-01 11:48 UTC] aharvey@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.
 [2011-07-03 00:06 UTC] 1000235409 at smail dot shnu dot edu dot cn
-Status: Feedback +Status: Open
 [2011-07-03 00:06 UTC] 1000235409 at smail dot shnu dot edu dot cn
I cannot generate a backtrace since I am not willing to mess up machine, and there 
is no possibility to install a virtual machine because I haven't a OS X Server 
installation DVD,

So, is it possible to solve this bug without providing a backtrace?
 [2011-07-03 10:29 UTC] felipe@php.net
I can't reproduce it on 5.4.
 [2011-07-03 11:21 UTC] 1000235409 at smail dot shnu dot edu dot cn
try it on 5.3.3, or is it meaningless?
 [2011-07-05 08:44 UTC] johannes@php.net
-Status: Open +Status: Feedback
 [2011-07-05 08:44 UTC] johannes@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

This seems to be fixed in more recent 5.3 versions. I couldn't reproduce the issue. In case you can reproduce it with a recent version please tell use whether you're using libmysql or mysqlnd (check "MySQL CLient Library Version" in phpinfo() )
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 09:01:28 2024 UTC