-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Avoid hardly debugable PHP.exe crashes #16
Conversation
Crash fix: The current code causes hardly debugable PHP.exe crashes in case when PHP developer does not release query results in time. This is just minimal fix of just one such a scenario. Architectural fix would be better of course - like throwing regular PHP exception instead of crashing PHP.exe. Case FIXED: Avoid memory overwrites of released query or result (the memory allready allocated by somebody else) or in case of more cursors opened for one query.
Hardly debugable PHP.exe crashes fixed
Looks good. Do you have an example for such crashes? In that case I can implement a test case for the qa. |
The crashes are hard to simulate because it depend on what exact memory you overwrite. As you see the code is absolutely not designed to handle more opened query results at the same time and could basicaly fail anywhere when the situation occures. That is why I have added the second commint to this PR where I explicitely forbid this situation to happen. |
I know also about another php.exe crash that I did not investigate precisely. I only know that the first commit here did not help in that case but the proper closing of the query result in PHP code did - so it was most probably a bug of the same origin. |
…ly released in PHP code." This reverts commit 426602a.
I am working on better fix by making the query statement reference counted to avoid the problematic week pointers completely. |
I have updated PR with better fix. |
At first glance it looks good. We have to check whether existing codes can still be run. In particular, when dealing with transactions, there must be no breaks. I don't see this as a problem at the moment. Do you already have experience regarding code breaks? |
Concerning "code breaks" I am not sure if I understand, what do you mean.
|
The only thing I am not sure if I handeled it well is the code |
Hm, we will have to check, if we can delete these lines. I didn't create the extension. Since nobody wanted to keep on the development I became the maintainer. So I'm still investigating the code. I will check for errors in our ERP system. But I think it will turn out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. No problems so far.
The current code causes hardly debugable PHP.exe crashes in case when PHP developer does not release query or results in proper order.
This is just minimal fix of just one such scenario.
Architectural fix would be better of course i.e. defining supported scenarios and throwing regular PHP exception instead of crashing PHP.exe in unsuported cases.
THE FIX:
Avoids memory overwrites of released query or result (the memory already allocated by somebody else) or in case of more cursors opened for one query at the time of query destruction.