OK guys, I have a prognosis, but a dubious fix.
in the changes for the last release, I isolated out the sane processing into a separate process. This isolation was defend against SANE errors bringing the whole of openDias down. When this process starts it immediately initialises SANE, does the processing it needs to (in this case gather information about the available scanning devices, then returns the information to the client and does some cleanup/shutdown routines.
It's the SANE shutdown call that is causing the failure. (I assume that) since the SANE shotdown call is made so soon after the get devices call, the background SANE processes have not completed, and so a SEGFAULT is produced. This segfault is caught by the openDias parent and then reported back to the user as an error - ergo 'no devices'.
The fix is simple but dirty. I could:
- I can add a sleep just before the call to SANE-cleanup routine. This would 'hopefully' (but not guaranteed to) allow SANE to finish all it's background processing before closing down.
- Not call the SANE-cleanup routine and just finish the openDias child process. This will stop the errors, but could cause other problems down the line.
I've got a branch of the both working locally, so if your interested I could let you have a copy.
Interestingly, this only happens for networked scanners. I supposing the SANE has some additional work to do for none USB conected devices which makes the result none sequential.
Further, I'd expect the the other programs you're seeing successful scans on, will not have to protect themselves from SANE failures as much - since they themselves are not services, and so are generally not long running. Therefore they can stand to initialise SANE when that process starts up, and only have to call the SANE-cleanup when the program itself closes down.
Regards.
Wayne.