Code Monkey home page Code Monkey logo

Comments (3)

arun11299 avatar arun11299 commented on August 22, 2024

Will take a look at this. Thanks for reporting.

from cpp-subprocess.

vvviperrr avatar vvviperrr commented on August 22, 2024

seems like everything works normal.
g++ (Arch Linux 9.2.1+20200130-2) 9.2.1 20200130

from cpp-subprocess.

nils1603 avatar nils1603 commented on August 22, 2024

I think the issue still exists. My program segfaults as well.

The error shows up, when a new file_ptr is supposed to be opened here:

int read_bytes = util::read_atmost_n(

I have adjusted this line, to check the error and it shows that too many files are opened and segfaults in the following read_atmost_n line, since the file could not be opened

auto file_ptr = fdopen(err_rd_pipe, "r");

if (file_ptr == NULL)
{
    printf("Oh dear, something went wrong with read()! %s\n", strerror(errno));
}

The file descriptors do not show up in lsof, as observed above.

I have noticed a difference between the usage of the reset function for the std::shared_ptr<FILE>

void input(FILE* fp) { input_.reset(fp, fclose); }

I think in the case below, the filepointer is actually not properly closed and the deleted file descriptor still counts against the limit.

stream_->input_.reset();

I am not sure if this needs to be adjusted and if I understand the std API correctly.

from cpp-subprocess.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.