Fun fact: sane_exit(), contrary to its documentation, does not clean up
all the resources used by sane and its backends.

Specifically, a bunch of backends will fail to close the file
descriptors opened in sane_get_devices(). Since colord-sane rescans for
devices on a timer, after some time we run out of fds.

On Ubuntu, this results in a crash in the FORTIFY_SOURCE checks when
sane tries to add an fd > 1024 to an FD_SET. It seems we don't build
with that on Debian, so we instead it seems we try to select() on an
invalid fd. With hilarious consequences!

Urgh.

So I'll rework colord-sane to only call sane_get_devices once before
exiting, and just get respawned for each poll.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to