Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-31 Thread David McMahon
On Thu, Oct 31, 2019 at 2:56 PM Ralph Little  wrote:

> Hi David,
>
> On Thu, Oct 31, 2019 at 2:45 PM David McMahon  wrote:
>
>> ...
>> [bjnp]  0050:45 53 3a 43 61 6e 6f 6e  20 4d 46 36 34 32 43 2f
>> [bjnp]  0060:36 34 33 43 2f 36 34 34  43 3b
>> [bjnp] get_scanner_id: Scanner identity string =
>> MFG:CANON;CMD:MFNP1,MultiPASS 2.1;MDL:MF642C/643C/644C;CLS:IMG;DES:Canon
>> MF642C/643C/644C; - length = 90
>> [bjnp] get_scanner_id: Scanner model = MF642C/643C/644C
>> *** buffer overflow detected ***: scanimage terminated
>> Aborted
>>
>>
> Having a quick look at the code, it looks like the very next thing the
> backend does is try to generate a "serial number" by using the hostname.
> Involves an unprotected strcpy().
> Does your scanner machine have a particularly long hostname?
>

Thanks for the clue!  Looking on that on the settings page of the printer,
the hostname is the default of "Canoncbcab3" which seems harmless enough.
I changed it to "Can" to see if that changed anything, but still getting
the buffer overflow.
If you have a link handy to that part of the code, can you point me to it?
Maybe it's something else right after the strcpy().


>
> Cheers,
> Ralph
>


Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-31 Thread David McMahon
So close!   Thanks to Kip and Rolf for updating the package.

Still wondering if anyone else has hit this problem on LinuxMint or
elsewhere.
I'm still stuck here with a non-functional scanimage / simplescan.

Anyone have any thoughts/pointers/ideas?

$ SANE_DEBUG_BJNP=5 scanimage -L 2>&1
[sanei_debug] Setting debug level of bjnp to 5.
[bjnp] sanei_bjnp_find_devices, pixma backend version: 0.24.1
[bjnp] sanei_bjnp_find_devices: No devices specified in configuration file.
[bjnp] sanei_bjnp_find_devices: Added all configured scanners, now do auto
detection...
[bjnp] prepare_socket: lo is not a valid IPv4 interface, skipping...
[bjnp] prepare_socket: eth0 is IPv4 capable, sending broadcast, socket = 9
[bjnp] prepare_socket: docker0 is IPv4 capable, sending broadcast, socket =
10
[bjnp] prepare_socket: lo is not a valid IPv6 interface, skipping...
[bjnp] prepare_socket: eth0 is IPv6 capable, sending broadcast, socket = 11
[bjnp] sanei_bjnp_find_devices: Select returned, time left 0.40
[bjnp] sanei_find_devices: Discover response:
[bjnp]  :42 4a 4e 50 02 01 00 00  00 00 00 00 00 00 00 00
[bjnp] sanei_bjnp_find_devices: Select returned, time left 0.499986
[bjnp] sanei_find_devices: Discover response:
[bjnp]  :42 4a 4e 50 02 01 00 00  00 00 00 00 00 00 00 00
[bjnp] sanei_bjnp_find_devices: Select returned, time left 0.339876
[bjnp] sanei_find_devices: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 10 98  c3 da 2c f7 c0 a8 56 27
[bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
using as hostname
[bjnp] bjnp_allocate_device(mfnp://canoncbcab3.lan:8610/timeout=1) 0
[bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
using as hostname
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8610
[bjnp] bjnp_get_scanner_mac_address: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 10 98  c3 da 2c f7 c0 a8 56 27
[bjnp] bjnp_allocate_device: Scanner not yet in our list, added it:
canoncbcab3.lan:8610
[bjnp] get_scanner_id: Get scanner identity
[bjnp]  :4d 46 4e 50 02 30 00 00  00 01 00 00 00 00 00 00
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8610
[bjnp] get_scanner_id: scanner identity:
[bjnp]  :4d 46 4e 50 82 30 00 00  00 01 00 00 00 00 00 5a
[bjnp]  0010:4d 46 47 3a 43 41 4e 4f  4e 3b 43 4d 44 3a 4d 46
[bjnp]  0020:4e 50 31 2c 4d 75 6c 74  69 50 41 53 53 20 32 2e
[bjnp]  0030:31 3b 4d 44 4c 3a 4d 46  36 34 32 43 2f 36 34 33
[bjnp]  0040:43 2f 36 34 34 43 3b 43  4c 53 3a 49 4d 47 3b 44
[bjnp]  0050:45 53 3a 43 61 6e 6f 6e  20 4d 46 36 34 32 43 2f
[bjnp]  0060:36 34 33 43 2f 36 34 34  43 3b
[bjnp] get_scanner_id: Scanner identity string =
MFG:CANON;CMD:MFNP1,MultiPASS 2.1;MDL:MF642C/643C/644C;CLS:IMG;DES:Canon
MF642C/643C/644C; - length = 90
[bjnp] get_scanner_id: Scanner model = MF642C/643C/644C
*** buffer overflow detected ***: scanimage terminated
Aborted

On Sat, Oct 5, 2019 at 1:48 PM David McMahon  wrote:

> Thanks Kip.  I've tried a few more things to try to isolate.
>
> First
>
> $  cat /etc/lsb-release
> DISTRIB_ID=LinuxMint
> DISTRIB_RELEASE=19
> DISTRIB_CODENAME=tara
> DISTRIB_DESCRIPTION="Linux Mint 19 Tara"
>
> Commenting pixma out of dll.conf avoids the buffer overflow but then of
> course the scanner is not found.
>
> $ scanimage -L
>
> No scanners were identified. If you were expecting something different,
> check that the scanner is plugged in, turned on and detected by the
> sane-find-scanner tool (if appropriate). Please read the documentation
> which came with this software (README, FAQ, manpages).
>
> valgrind might be of use here?  Here's a rum with pixma uncommented in
> dll.conf:
>
> $ valgrind scanimage -L
> ==16057== Memcheck, a memory error detector
> ==16057== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
> ==16057== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright
> info
> ==16057== Command: scanimage -L
> ==16057==
> *** buffer overflow detected ***: scanimage terminated
> ==16057==
> ==16057== Process terminating with default action of signal 6 (SIGABRT)
> ==16057==at 0x5526E97: raise (raise.c:51)
> ==16057==by 0x5528800: abort (abort.c:79)
> ==16057==by 0x5571896: __libc_message (libc_fatal.c:181)
> ==16057==by 0x561CCFE: __fortify_fail_abort (fortify_fail.c:33)
> ==16057==by 0x561CD20: __fortify_fail (fortify_fail.c:44)
> ==16057==by 0x561AA0F: __chk_fail (chk_fail.c:28)
> ==16057==by 0x5619F28: _IO_str_chk_overflow (vsprintf_chk.c:31)
> ==16057==by 0x5576493: _IO_default_xsputn (genops.c:417)
> ==16057==by 0x5544FEA: vfprintf (vfprintf.c:1643)
> ==16057==by 0x5619FCA

Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-05 Thread David McMahon
Hi Kip, Rolf

I've got the latest and still unable to connect.  Did you need to resolve
anything like this?  Are you just adding a bjnp line to pixma.conf?

$ SANE_DEBUG_BJNP=5 scanimage -L 2>&1
[sanei_debug] Setting debug level of bjnp to 5.
[bjnp] sanei_bjnp_find_devices, pixma backend version: 0.23.4
[bjnp] sanei_bjnp_find_devices: Adding scanner from pixma.conf: bjnp://
192.168.86.39
[bjnp] bjnp_allocate_device(bjnp://192.168.86.39:8612/timeout=1) 0
[bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
using as hostname
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8612
[bjnp] udp_command: ERROR - recv failed: Connection refused[bjnp]
udp_command: ERROR - recv failed: Connection refused[bjnp] udp_command:
ERROR - recv failed: Connection refused[bjnp] udp_command: ERROR - no data
received (timeout = 1)
[bjnp] bjnp_init_device_structure: Cannot read mac address, skipping this
scanner
[bjnp] bjnp_allocate_device: Scanner not yet in our list, added it:
192.168.86.39:8612
[bjnp] get_scanner_id: Get scanner identity
[bjnp]  :42 4a 4e 50 02 30 00 00  00 01 00 00 00 00 00 00
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8612
[bjnp] udp_command: ERROR - recv failed: Connection refused[bjnp]
udp_command: ERROR - recv failed: Connection refused[bjnp] udp_command:
ERROR - recv failed: Connection refused[bjnp] udp_command: ERROR - no data
received (timeout = 1)
[bjnp] get_scanner_id: ERROR - Failed to retrieve scanner identity:
[bjnp] add_scanner: ERROR - Cannot read scanner make & model: bjnp://
192.168.86.39:8612/timeout=1
[bjnp] sanei_bjnp_find_devices: Added all configured scanners, now do auto
detection...
[bjnp] prepare_socket: lo is not a valid IPv4 interface, skipping...
[bjnp] prepare_socket: eth0 is IPv4 capable, sending broadcast, socket = 9
[bjnp] prepare_socket: docker0 is IPv4 capable, sending broadcast, socket =
10
[bjnp] prepare_socket: lo is not a valid IPv6 interface, skipping...
[bjnp] prepare_socket: eth0 is IPv6 capable, sending broadcast, socket = 11
[bjnp] sanei_bjnp_find_devices: Select returned, time left 0.499969
[bjnp] sanei_find_devices: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 10 98  c3 da 2c f7 c0 a8 56 27
[bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
using as hostname
[bjnp] bjnp_allocate_device(mfnp://canoncbcab3.lan:8610/timeout=1) 1
[bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
using as hostname
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8610
[bjnp] bjnp_get_scanner_mac_address: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 10 98  c3 da 2c f7 c0 a8 56 27
[bjnp] bjnp_allocate_device: Scanner not yet in our list, added it:
canoncbcab3.lan:8610
[bjnp] get_scanner_id: Get scanner identity
[bjnp]  :4d 46 4e 50 02 30 00 00  00 01 00 00 00 00 00 00
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8610
[bjnp] get_scanner_id: scanner identity:
[bjnp]  :4d 46 4e 50 82 30 00 00  00 01 00 00 00 00 00 5a
[bjnp]  0010:4d 46 47 3a 43 41 4e 4f  4e 3b 43 4d 44 3a 4d 46
[bjnp]  0020:4e 50 31 2c 4d 75 6c 74  69 50 41 53 53 20 32 2e
[bjnp]  0030:31 3b 4d 44 4c 3a 4d 46  36 34 32 43 2f 36 34 33
[bjnp]  0040:43 2f 36 34 34 43 3b 43  4c 53 3a 49 4d 47 3b 44
[bjnp]  0050:45 53 3a 43 61 6e 6f 6e  20 4d 46 36 34 32 43 2f
[bjnp]  0060:36 34 33 43 2f 36 34 34  43 3b
*** buffer overflow detected ***: scanimage terminated
[bjnp] get_scanner_id: Scanner identity string =
MFG:CANON;CMD:MFNP1,MultiPASS 2.1;MDL:MF642C/643C/644C;CLS:IMG;DES:Canon
MF642C/643C/644C; - length = 90
[bjnp] get_scanner_id: Scanner model = MF642C/643C/644C

On Sat, Oct 5, 2019 at 8:13 AM Kip Shaffer  wrote:

> I just updated from Rolf's PPA, and I am very happy to say that I can now
> detect and scan from my Canon ImageClass MF644Cdw over the network.  I
> confirmed it can scan in resolutions of 75, 150, 300, 600, 1200, and 2400
> for both Text and Color modes.  It successfully read 2 sided multiple pages
> from the sheet feeder.
>
> The only issue I saw (same as earlier) is that when it completes a job
> reading from the sheet feeder, SimpleScan pops up a dialog box stating
> "Failed to Scan" "Error communicating with scanner."   This does not affect
> the job... all pages were scanned successfully.
>
> Thank you everyone!  I am happy to continue tests if there is energy for
> debugging the error message!
>
> -Kip
>
> On Fri, Oct 4, 2019 at 3:33 PM Rolf Bensch  wrote:
>
>> Hi,
>>
>> It seems that the network model differs between sources and network
>> scanner discovery. I just fixed it. It will be available from my ppa

Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-04 Thread David McMahon
On Fri, Oct 4, 2019 at 3:51 AM Rolf Bensch  wrote:

> Hi Kip,
>
> Am 14.09.19 um 03:40 schrieb Kip Shaffer:
> > Scanning Results!  I updated to today's
> version: 1.0.28+git20190913-bionic0
> >
> > Using Simple Scan I was able to scan at 75, 150, 300, 600, 1200, and
> > 2400 dpi in both Text and Photo modes.  Perfect!
>
> I just updated the doc files.
>
> >
> > When scanning from the document feeder, it scans front and back, one
> > sheet or many, but after the job is done there is a pause, and then it
> > says "Error communicating with scanner".
>
> Can you scan again after closing the message and/or does your scanner hang?
>
> The pause comes from adf-wait parameter. Please read the man page for
> details.
>
> >
> > Also, this has all been through USB.  I tried to connect with the
> > network and scanimage -L cannot find it.  I added the address to
> > pixma.conf (neither line helped):
> > bjnp://MF640_192.168.1.97
> > bjnp://192.168.1.97 
>
> Please read 'man sane-pixma' to get some help for this issue. If this
> won't help, please provide a log file with SANE_DEBUG_BJNP.
>

Here's mine:

$ SANE_DEBUG_BJNP=5 scanimage -L 2>&1
[sanei_debug] Setting debug level of bjnp to 5.
[bjnp] sanei_bjnp_find_devices, pixma backend version: 0.23.3
[bjnp] sanei_bjnp_find_devices: Adding scanner from pixma.conf: bjnp://
192.168.86.39
[bjnp] bjnp_allocate_device(bjnp://192.168.86.39:8612/timeout=1) 0
[bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
using as hostname
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8612
[bjnp] udp_command: ERROR - recv failed: Connection refused[bjnp]
udp_command: ERROR - recv failed: Connection refused[bjnp] udp_command:
ERROR - recv failed: Connection refused[bjnp] udp_command: ERROR - no data
received (timeout = 1)
[bjnp] bjnp_init_device_structure: Cannot read mac address, skipping this
scanner
[bjnp] bjnp_allocate_device: Scanner not yet in our list, added it:
192.168.86.39:8612
[bjnp] get_scanner_id: Get scanner identity
[bjnp]  :42 4a 4e 50 02 30 00 00  00 01 00 00 00 00 00 00
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8612
[bjnp] udp_command: ERROR - recv failed: Connection refused[bjnp]
udp_command: ERROR - recv failed: Connection refused[bjnp] udp_command:
ERROR - recv failed: Connection refused[bjnp] udp_command: ERROR - no data
received (timeout = 1)
[bjnp] get_scanner_id: ERROR - Failed to retrieve scanner identity:
[bjnp] add_scanner: ERROR - Cannot read scanner make & model: bjnp://
192.168.86.39:8612/timeout=1
[bjnp] sanei_bjnp_find_devices: Added all configured scanners, now do auto
detection...
[bjnp] prepare_socket: lo is not a valid IPv4 interface, skipping...
[bjnp] prepare_socket: eth0 is IPv4 capable, sending broadcast, socket = 9
[bjnp] prepare_socket: docker0 is IPv4 capable, sending broadcast, socket =
10
[bjnp] prepare_socket: lo is not a valid IPv6 interface, skipping...
[bjnp] prepare_socket: eth0 is IPv6 capable, sending broadcast, socket = 11
[bjnp] sanei_bjnp_find_devices: Select returned, time left 0.499988
[bjnp] sanei_find_devices: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 10 98  c3 da 2c f7 c0 a8 56 27
[bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
using as hostname
[bjnp] bjnp_allocate_device(mfnp://canoncbcab3.lan:8610/timeout=1) 1
[bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
using as hostname
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8610
[bjnp] bjnp_get_scanner_mac_address: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 10 98  c3 da 2c f7 c0 a8 56 27
[bjnp] bjnp_allocate_device: Scanner not yet in our list, added it:
canoncbcab3.lan:8610
[bjnp] get_scanner_id: Get scanner identity
[bjnp]  :4d 46 4e 50 02 30 00 00  00 01 00 00 00 00 00 00
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8610
[bjnp] get_scanner_id: scanner identity:
[bjnp]  :4d 46 4e 50 82 30 00 00  00 01 00 00 00 00 00 5a
[bjnp]  0010:4d 46 47 3a 43 41 4e 4f  4e 3b 43 4d 44 3a 4d 46
[bjnp]  0020:4e 50 31 2c 4d 75 6c 74  69 50 41 53 53 20 32 2e
[bjnp]  0030:31 3b 4d 44 4c 3a 4d 46  36 34 32 43 2f 36 34 33
[bjnp]  0040:43 2f 36 34 34 43 3b 43  4c 53 3a 49 4d 47 3b 44
[bjnp]  0050:45 53 3a 43 61 6e 6f 6e  20 4d 46 36 34 32 43 2f
[bjnp]  0060:36 34 33 43 2f 36 34 34  43 3b
[bjnp] get_scanner_id: Scanner identity string =
MFG:CANON;CMD:MFNP1,MultiPASS 2.1;MDL:MF642C/643C/644C;CLS:IMG;DES:Canon
MF642C/643C/644C; - length = 90
[bjnp] get_scanner_id: Scanner model = MF642C/643C/644C
[bjnp] add_scanner: New scanner added:
mfnp://canoncbcab3.lan:8610/timeout=1, serial canoncbcab3.lan, mac
address: 1098c3da2cf7.
[bjnp] sanei_find_devices: Discover response: