Discussion:
Enumeration devices gets SEGV on Ubuntu 16.10
(too old to reply)
Wilhelm Meier
2017-04-04 08:23:23 UTC
Permalink
Raw Message
Hi all,

there are problems scanning for new usb-devices on Ubuntu-16.10. This
problem hits most (all) users of scanbd if they remove/insert usb devices.

It can be be broken down to the following example, which crashes with
SEGV if one inserts/removes use-devices:

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <sane/sane.h>

int main () {
while (true) {
SANE_Int sane_version = 0;
if (sane_init(&sane_version, 0) != SANE_STATUS_GOOD) {
printf("Can't init sane\n");
exit(EXIT_FAILURE);
}
printf("sane version %d.%d\n", SANE_VERSION_MAJOR(sane_version),
SANE_VERSION_MINOR(sane_version));

const SANE_Device** device_list = NULL;
if (sane_get_devices(&device_list, SANE_TRUE) == SANE_STATUS_GOOD) {
const SANE_Device** dev = device_list;
while (*dev) {
printf("dev name: %s\n", (*dev)->name);
dev++;
}
} else {
printf("Can't get dev list\n");
exit(EXIT_FAILURE);
}
sleep (1);
printf("sane_exit\n");
sane_exit();
sleep (1);
}
exit(EXIT_SUCCESS);
}

Are there any hints or workarounds?

BTW: on ArchLinux and Gentoo there are no problems ...

--
Wilhelm
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.org
Olaf Meeuwissen
2017-05-04 12:29:51 UTC
Permalink
Raw Message
Hi Wilhelm,
Post by Wilhelm Meier
Hi all,
there are problems scanning for new usb-devices on Ubuntu-16.10. This
problem hits most (all) users of scanbd if they remove/insert usb devices.
It can be be broken down to the following example, which crashes with
Hmm, same code as in your other mail[1] to which I just, belatedly,
replied[2]. Perhaps I need to set up saned at the very least when
trying to reproduce. That's for tomorrow, if (still?) necessary.

[1] https://lists.alioth.debian.org/pipermail/sane-devel/2017-April/035155.html
[2] https://lists.alioth.debian.org/pipermail/sane-devel/2017-May/035270.html

Hope that helps,
--
Olaf Meeuwissen, LPIC-2 FSF Associate Member since 2004-01-27
GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9
Support Free Software https://my.fsf.org/donate
Join the Free Software Foundation https://my.fsf.org/join
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.org
Loading...