test_directory_monitor hangs when out of inotify watches
Submitted by Iain Lane
Link to original bug (#725670)
Description
`make check' hung for me at test_directory_monitor. stracing showed this looping indefinitely:
[pid 12155] poll([{fd=5, events=POLLIN}, {fd=4, events=POLLIN}], 2, 3996) = 0 (Timeout) [pid 12155] inotify_add_watch(4, "/build/glib2.0-3rjR7I/glib2.0-2.39.91/debian/build/deb/gio/tests/file_monitor_GMI3BX", IN_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) = -1 ENOSPC (No space left on device) [pid 12155] inotify_add_watch(4, "/build/glib2.0-3rjR7I/glib2.0-2.39.91/debian/build/deb/gio/tests/file_monitor_GMI3BX", IN_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) = -1 ENOSPC (No space left on device) [pid 12155] poll([{fd=5, events=POLLIN}, {fd=4, events=POLLIN}], 2, 3995) = 0 (Timeout) [pid 12155] inotify_add_watch(4, "/build/glib2.0-3rjR7I/glib2.0-2.39.91/debian/build/deb/gio/tests/file_monitor_GMI3BX", IN_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) = -1 ENOSPC (No space left on device) [pid 12155] inotify_add_watch(4, "/build/glib2.0-3rjR7I/glib2.0-2.39.91/debian/build/deb/gio/tests/file_monitor_GMI3BX", IN_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) = -1 ENOSPC (No space left on device)
I'm not sure why g_file_monitor_* didn't error out and abort the test (although this probably ought not to be fatal).
Version: 2.39.x