Skip to content

Update TSRM/tsrm_win32.c #226

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

Closed
wants to merge 1 commit into from
Closed

Update TSRM/tsrm_win32.c #226

wants to merge 1 commit into from

Conversation

krazyest
Copy link

@krazyest krazyest commented Nov 2, 2012

This update fixes the handle leak described here - https://bugs.php.net/bug.php?id=62444

We have to initialize the local thread_token variable to prevent closing some 'random' handle. And at the end of the function we have to use CloseHandle to free the resources we might have obtained, to prevent the leak.

This update fixes the handle leak described here - https://bugs.php.net/bug.php?id=62444

We have to initialize the local thread_token variable to prevent closing some 'random' handle. And at the end of the function we have to use CloseHandle to free the resources we might have obtained, to prevent the leak.
@laruence
Copy link
Member

laruence commented Nov 2, 2012

it will be better if you also attach this patch to the bug entry ;) thanks

@krazyest
Copy link
Author

krazyest commented Nov 2, 2012

Not sure what is funny, this problem causes headaches to many users. Also not sure about the patch file format, so ... could you check please?

@laruence
Copy link
Member

laruence commented Nov 2, 2012

git diff > bug62444.patch

then attach that patch, done :)

@reeze
Copy link
Contributor

reeze commented Nov 2, 2012

try download this:

https://github.com/php/php-src/pull/226.patch

or in your branch:

$ git format-patch  -1   // last commit

you will get a patch file

@@ -363,6 +363,10 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC)
}

Finished:
if(thread_token != NULL) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, according to the CS, there should a space after if

@laruence
Copy link
Member

laruence commented Nov 2, 2012

oh, I saw you have commented about the fix in that bug entry, sounds okey to me. ingore the patch attaching thing.

thanks

@krazyest
Copy link
Author

krazyest commented Nov 2, 2012

Guys, I am doing this for the first time. I do not have GIT, I am not familiar with how PHP bugs are being solved, nor with its code style.

The code I have submitted was created in style of the code I have made the change into. If someone created the original code in wrong style then I am sorry but I can not really do anything about it.

I just have a server here that is freaking out because of this problem. Everyday 10000 handles leak and we do not even have some real traffic.

I have submitted the patch using the common DIFF, not GIT DIFF. If this is wrong, PLEASE could someone create the actual PATCH file that is what is needed.

Thank you1

@laruence
Copy link
Member

laruence commented Nov 2, 2012

karzyest, sorry for that. it's okey now. thanks for your work. ;)

@krazyest
Copy link
Author

krazyest commented Nov 2, 2012

Thank you for your help. I am looking forward to a new version of PHP to have this fixed.

@php-pulls
Copy link

Comment on behalf of laruence at php.net:

patch merged. thanks

@php-pulls php-pulls closed this Nov 2, 2012
@laruence
Copy link
Member

laruence commented Nov 2, 2012

fixed at : 3fe3029

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants