FS#63625 - [boost] boost::process system and child seem to cause file descriptor leaks

Attached to Project: Arch Linux
Opened by Jussi Hietanen (jussihi) - Monday, 02 September 2019, 08:31 GMT
Last edited by Antonio Rojas (arojas) - Tuesday, 08 October 2019, 16:49 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Running commands with boost::process::child or boost::process::system seem to cause file descriptor leaks.


Additional info:
boost 1.69.0-2
kernel 5.2.4-arch1-1-ARCH
gcc (GCC) 9.1.0

Steps to reproduce:

Compile and run the following, monitor /proc/PID/fd:

#include <boost/process.hpp>
#include <thread>
#include <cstdlib>


int main(void)
{
while(true)
{
std::this_thread::sleep_for(std::chrono::seconds(1));
std::system("/usr/bin/iptables -F");
}
return 0;
}
This task depends upon

Closed by  Antonio Rojas (arojas)
Tuesday, 08 October 2019, 16:49 GMT
Reason for closing:  Fixed
Comment by Jussi Hietanen (jussihi) - Monday, 02 September 2019, 08:38 GMT
Good god, I accidentally pasted the code I was debugging with, and it has std::system instead of boost::process::system. The line std::system should be replaced with boost::process::system("/usr/bin/iptables", "-F");

I will attach the correct source file to this comment.
Comment by Levente Polyak (anthraxx) - Monday, 02 September 2019, 08:57 GMT
that's nothing packaging related, please contact upstream if you think you encounter a bug
Comment by Jussi Hietanen (jussihi) - Monday, 02 September 2019, 09:27 GMT
Sorry, if it is so, I will open an issue on their github page. This can be closed then.
Comment by Jussi Hietanen (jussihi) - Monday, 02 September 2019, 15:16 GMT
It seems like this bug was already known and is only present in the version 1.69 of boost (which is currently in the Arch repo). It can be patched by editing the header file described in https://github.com/boostorg/process/issues/62 .

Could this bug be patched for Arch's release of boost, or do I need to hotfix the issue myself? If you are planning to package the next version (1.70, which is already out), could you tell me when you're planning on doing that? I'm kind of dependent of boost::process in my projects.

Thanks.

Loading...