dspinellis / dgsh

Shell supporting pipelines to and from multiple processes
http://www.spinellis.gr/sw/dgsh/
Other
323 stars 22 forks source link

dgsh-tee deadlock #117

Closed tammam1998 closed 3 years ago

tammam1998 commented 3 years ago

This is an attempt to fix issue #116 by moving the termination code to be after reached_eof is set.

dspinellis commented 3 years ago

Thank you for debugging and submitting this! Can you please ensure that no unneeded parts are modified? It's difficult to see what you fixed in the current diff. Feel free to rebase and force-push a single commit.

tammam1998 commented 3 years ago

Hi, @dspinellis I squashed the commits. I realized that my old fix didn't pass the test cases for some reason so I changed it. Changes should be clearer now. I'm not sure if there is a better way to go about fixing this issue but my fix is basically just making sure we set at least one fd before calling select. This resolved the deadlock issue I was having and seems to pass the test cases.

dspinellis commented 3 years ago

Good catch; thank you!