-
Notifications
You must be signed in to change notification settings - Fork 218
Fix #11100 and #8058: binary compatibility and leaked file handle in exec_file() #15
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
Conversation
Thanks for the patches, these look good. |
Fix #11100 and #8058: binary compatibility and leaked file handle in exec_file()
The comments appear contradictory: https://svn.boost.org/trac/boost/ticket/8058 reports the issue of non-closed file handles specifically with Python 2.7 on a 64-bit host, while comments above suggest that it's only with Python 2.7 that the file is (attempted to be) closed twice. |
@stefanseefeld I encountered the problem described in this ticket under Python 3.4 (32 bit), and tested the fix only under this version. I suggested that this will also fix it under other versions and platforms and I hoped someone will test it. It sounds odd indeed that @reven86 says that behaviour under Python 2.7 is different then described in the ticket. |
@mmatrosov , thanks. For avoidance of doubt: by "the problem" are you referring to the dangling open file descriptor, or to the double free ? I wonder what may cause the file not to be closed via the handle<> destructor to begin with, as that's the typical fail-safe (and exception-safe !) technique used throughout C++. |
@stefanseefeld By "the problem" I am referring to the dangling open file descriptor, that's why I added |
@mmatrosov Thanks for the confirmation. Did you, as the OP, observe the open file descriptors accumulating when running program from https://svn.boost.org/trac/boost/ticket/8058 ? Or just after the "exec_file" function (were the file should indeed be still open) ? |
@stefanseefeld I'm sorry, I do not see the difference between the two ("open file descriptors accumulating when running program from ticket 8058" and "just after the "exec_file" function"). What do you mean? Once |
@mmatrosov Sorry, I meant to ask whether you looked at the file after the execution of PyRun_File(), or after exec_file(). But I assume it's the latter. |
@stefanseefeld Interesting. I may prepare a reprocase and send it to you. I used MS Visual Studio 2013, Python 3.4.3, boost 1.57, Windows 7 x64, 32-bit build. |
OK. Please be aware that I don't have Windows here (much less MSVC), so I'm relying on other people testing and debugging on such platforms. So if you could step through the debugger and analyze why the file isn't getting closed, that would be very much appreciated. Thanks ! |
How is boost::python tested on other platforms? |
Different testers use different test platforms, so as long as all supported platforms are covered by some testers, we are fine. Of course, to be able to develop for a specific platform, the developer needs to have access to such a platform. I suppose I could set up a VM with Windows / MSVC on it, but I haven't worked with that platform for ~10 years, so I'd rather have someone else take over that responsibility. |
@stefanseefeld Is new functionality tested when it is already merged in master? If there are any specifications of this process (development, merging, testing) specific to boost::python, could you please give me a link to those? |
I'm not aware of any formal documentation of the process (the boost There are test runs for both master and the "develop" branch, so the http://www.boost.org/development/tests/develop/developer/python.html are the two test reports.
|
Hi, @stefanseefeld. I'm currently investigating the issue. It doesn't seem complicated: we just need to destroy file handle either with help of However, now I cannot even make
And for this |
Hi, I am also observing this bug with Boost 1.58 and Python 2.7 on Arch Linux (in case you need an extra tester for a fix). Any update on the solution? |
I'm not sure what you are referring to as "this bug" here. The one I'm aware of is the leaked file descriptor. For that it would be most useful to come up with a minimal test case, so someone can walk through it in a debugger on one of those platforms that show this behavior, and identify the cause. |
@stefanseefeld I am referring to the bug detailed in the comments of fe24ab9, but maybe this has its own issue on GH and/or was already fixed. The repro code simply involves calling |
That is fixed in 1.59. |
@stefanseefeld: wonderful, thanks! |
Fixes the following bugs:
https://svn.boost.org/trac/boost/ticket/11100
https://svn.boost.org/trac/boost/ticket/8058