@jamey Yes please!
I have tried a small test to try isolate the problem (that calls popen()/pclose()) but could not reproduce it. Probably something with the larger system.
I have tried strace, but I can't figure out why wait4() (which pclose() calls) returns ECHILD. Clearly the child process has run, because I could read its stdout.
I'm just gonna look for patterns in the said stdout and declare victory for tonight. But I too am curious to know what's going on.
@sajith As I expected, you have tried what I would have!
After checking the Linux man page for waitpid(2), the only other thing I can think of is whether the signal handling action for SIGCHLD is SIG_IGN, which signal(7) says is the default. (I feel like it ought to be possible to check that by digging around in /proc but I can't find anything about signals there.) I don't know how that's supposed to work, but maybe you have to set a signal handler to be able to call wait*?
Follow friends and discover new ones. Publish anything you want: links, pictures, text, video. This server is run by the main developers of the Mastodon project. Everyone is welcome as long as you follow our code of conduct!