process id checking for g_child_watch_source-new



Hi,

While working on some bug (not sure yet if it's one in my own app, or
in glib), I noticed that if you pass a pid of 0 to
g_child_watch_source_new, it doesn't complain right away, and will
return a GSource pointer, but if you attach that GSource to a context,
it will hang the message loop, because an invalid handle will be
passed to WaitForMultipleObjects, somewhere deep in the message loop
(I'm using windows). I don't think it should be valid to pass a GPid
of 0 to g_child_watch_source_new anyway, so I made a patch that adds
some g_return_val_if_fail checking to the mainloop code.

The patch is attached to this mail.

Greets,

Lieven van der Heide.

Attachment: invalid_pid_checking.patch
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]