Page MenuHomeFreeBSD

rtpbusr_gmail.com (rtpbusr)
User

Projects

User does not belong to any projects.

User Details

User Since
Nov 5 2015, 11:28 PM (468 w, 2 d)

Recent Activity

Nov 19 2015

rtpbusr_gmail.com added a comment to D4126: popen requires check for fdopen failure.

Hi mjg,
Diff2 ID:10314 and Diff 3 ID:10315 provide alternative solutions to eliminate abort() in popen() along the lines of your thought.

Nov 19 2015, 1:46 AM
rtpbusr_gmail.com updated the diff for D4126: popen requires check for fdopen failure.

popen() attempts to allocate resources (memory, file stream) before child creation.

Nov 19 2015, 1:29 AM
rtpbusr_gmail.com updated the diff for D4126: popen requires check for fdopen failure.

Modifications focus on minimum resources and apply to a couple of lines in parent.

Nov 19 2015, 1:09 AM

Nov 12 2015

rtpbusr_gmail.com added a comment to D4126: popen requires check for fdopen failure.

Hi mjg,
Here we are hitting the case of resource limits getting exhausted (max file streams opened hits the ceiling). Following are the options we can take to solve the problem:

  1. It is conventional practice to generate exception like abort() in software indicating there is something critically wrong so that the issue can be debugged at the earliest.
  2. Check for failures, undo things already done in the function path (close files, free memory, etc.,.) and return error. In such cases, the system

may end up with side-effect problems or exit indicating error. It may not be possible to undo all things. This increases complexity.
Option 1 is preferable since it keeps things simple.

Nov 12 2015, 3:19 AM

Nov 11 2015

rtpbusr_gmail.com added a comment to D4126: popen requires check for fdopen failure.

Check is added for fdopen() returning NULL and corresponding error message emitted through perror() followed by abort() exception generation.

Nov 11 2015, 1:38 AM
rtpbusr_gmail.com retitled D4126: popen requires check for fdopen failure from to popen requires check for fdopen failure.
Nov 11 2015, 1:32 AM