-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
native: mysqli fetch with ssl delivers no results, hhvm crashes #4272
Comments
Possibly related: #4165 |
The error occurs when calling native mysqli->fetch() |
By the way, there haven't been very many commits to the mysqli extension since the 3.3 branch cut if you want to try bisecting. |
could not find yet any hint. what i have found: the statement has the correct value for num_rows, num_columns, etc. |
Can you run things in gdb and get a backtrace for the segfault? |
yes here you go:
|
I have a similar issue running a self-built debug-build on ubuntu 14 very near HEAD, and then carefully exporting environment variables MYSQL_TEST_*** to make sure that I can connect to a viable mysql data base server, and then the known-good tests. There are issues handling prepared statements. Two tests fail, each with its own assertion failure. There are corrupt objects about! test/run --threads 2 'test/zend/good/ext/mysqli/tests/mysqli_stmt_bind_result_bit.php' 'test/zend/good/ext/mysqli/tests/mysqli_stmt_fetch_geom.php' Running one of these under gdb:
|
Fred Emmott implies, via IRC, that mysqli/mysql tests are probably not run on a regular basis within FB/travis, because the necessary environment variables (to configure the mysql client's notion of where the server is) are not set in the test harness. See this PR comment from February 2014: |
We have several hundred concurrent test runs - each of which runs the tests in parallel. If we made the tests sequential, that would be way too slow. The hard part of running the tests is getting an efficient way to run literally thousands of mysql instances that are automatically cleaned up, and locked to a specific test (not just test run). At the moment, there's higher-reward uses of our time. |
There should be a diff that was done later that set the right params for Travis to run them. And I specifically changed the tests to use different dbs so they could run on the same MySQL instance in parallel. That was the state when I implemented stuff at least. |
@rrh I'm still looking into things but I'm not seeing either of those tests fail for me on master :/ |
@paulbiss yikes. another instance of "it fails for me on ubuntu 14.04 systems compiled for debugging, but FB can't reproduce". Will our various corporate legal beagles let us share something as basic as a spun up EC2 instance that contains an instance(s) of the problem? |
This seems like the same problem I am still having with my piwik crashing hhvm (also using ssl) which I mentioned in my ticket that got closed: #4171 |
hi all. latest php debugging gave us a hint, that it also corresponds to array handling. while running doctrine2 with the mysqli driver, and running the query "show variables;" and trying to get the results via "fetchAll" hhvm crashes. Deep-diving into the MysqliStatement.php (bundled with Doctrine2), Line 276 it runs the following code:
We found, that the query is processed correctly (thats why all your tests pass). While performing this operation
hhvm crashes just after giving the error "Array to String conversion". Outputting $row directly runs fine. Only the array assignment seems to fail. |
@matthiasbrock: not that I'm aware of. The previous stacktraces all indicate that the crash is occurring with in the call to fetch, is your stacktrace showing something different? |
Not really, it shows the same stacktrace. Having this kind of conversion warning made me curious. What I can think of (have not done a deep dive into the hhvm code): mysqli_stmt::fetch() returns a bool or null, if the pointer exceeds the row count. I'll try to sum up, what Doctrine2 does at this point:
This one makes me thinking: Step 5 & 6:
Is it possible, that the pointer assignments in step 5 result in different data types and assigning it to another variable causes a hick up? |
Can you try this with tonight's nightly? One possible issues with that was just fixed - array_fill() would give false if count($columnNames) == 0 |
same result. here is the full stack trace:
|
okay, got an example script for you. run it in browser or cli - same result: Update: and for completeness: Update 2:
|
is there anything I can help you with? |
I just wanted to add that I also get this error at mysqli_stmt->fetch(). HHVM 3.4.0 on Ubuntu 12.04 installed from these instructions: I'll try to build 3.3.1 and see what happens.
|
This issue broke our testsuite @ Doctrine/DBAL. As previously mentioned |
I was able t reproduce this on my local ~1 week old build of master. SSL is irrelevant, crashes even without it. |
@Majkl578 got a stacktrace? |
@paulbiss: Sure:
Based on code provided by @matthiasbrock, but with SSL disabled. Build based on 6b7e3a9. |
This is related to #4505. Please see part 3 in #4505 (comment). |
This issue seems to be fixed in v3.7.0. Works like charme. Thanks! |
Ran fine on hhvm 3.3. On 3.4. and 3.5 nightly hhvm crashes completely.
Connection is established via Doctrine2 (latest), MySQLi-Driver, SSL enabled:
Worked just fine prior the update.
How to reproduce:
The hhvm error.log does not give any information (or at least for what I can see). The dev.log of Symfony2 does:
[2014-11-18 17:05:29] request.CRITICAL: Uncaught PHP Exception ErrorException: "Notice: Array to string conversion in /var/www/project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php line 224" at /var/www/project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php line 224 {"exception":"[object](ErrorException: Notice: Array to string conversion in /var/www/project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php line 224 at /var/www/project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:224)"} []
If I can provide more information, please let me know.
The text was updated successfully, but these errors were encountered: