[03:00:07] * SB-X throws a de-idle bomb at Darke.
[03:07:41] <Sheng_Gradilla> good evening :)
[03:21:00] <SB-X> hello
[04:30:15] --- Kabalx is now known as Cahaan
[05:15:17] --- Kabalx is now known as Cahaan
[13:56:55] <Colourless> hi
[14:19:40] <wjp> hi
[14:21:07] <Colourless> amazing! 23 minutes
[23:23:39] <wjp> hi Fingolfin
[23:25:07] <Fingolfin> hi
[23:26:01] <wjp> how familiar are you with unix pipes (popen and such) ?
[23:27:13] <wjp> really weird problem with xdm... it forks a process using popen, then uses fgets to read the output through the pipe
[23:27:39] <wjp> xdm hangs at that point, with the forked process defunct
[23:27:54] <wjp> and I don't really understand how it could end up in that situation :-)
[23:29:10] <Fingolfin> hum
[23:29:24] <Fingolfin> fgets would wait until it is able to read a newline, wouldn't it?
[23:29:30] <wjp> yes
[23:29:52] <Fingolfin> (which BTW can lead to major issues when doing this stuff with Java, when line end conversion has to be done <g>, but I disgress)
[23:29:54] <wjp> would it really keep waiting on a broken pipe?
[23:30:12] <Fingolfin> wouldn't surprise me if it did =) but is the pipe really broken?
[23:30:26] <wjp> hm, a defunct process can't have any fd's open
[23:30:44] <wjp> (I think?)
[23:31:05] <wjp> I guess I should write some small test programs to see what happens
[23:35:14] <wjp> if the forked process is a simple int main() { return 0; }, and I sleep a while before the fgets, it works as expected
[23:35:48] <wjp> (fgets returns 0, which it should for EOF)
[23:35:56] <Fingolfin> oh it's really defunct, ok, I thought you meant it was hanging, too
[23:36:00] <Fingolfin> yup
[23:36:04] <Fingolfin> strange, this..
[23:36:13] <Fingolfin> sorry no valuable insight from my side
[23:36:41] <wjp> I currently freed it from its hanging state by doing a 'return' from gdb :-)
[23:37:00] <wjp> (which was the only way I could think of to get out of that fgets)
[23:37:44] <wjp> hm, wait a sec
[23:38:09] <wjp> it's not just doing a fgets; it's doing a "while(!(s = fgets(statusBuf, 256, fd)) && errno == EINTR);"
[23:38:31] <wjp> does errno get set if there is no error?
[23:38:43] <wjp> if not, it would hang if errno was still set to EINTR from a previous error
[23:38:55] <wjp> s/hang/loop/