SimulPiscator / AirSane

Publish SANE scanners to MacOS, Android, and Windows via Apple AirScan.
GNU General Public License v3.0
243 stars 26 forks source link

NULL pointer access on OpenWRT and Epson CX-6400 #79

Closed ypopovych closed 2 years ago

ypopovych commented 2 years ago

Hi. Compiled binaries for OpenWRT from the master branch.

AirSane crashes when the printer is connected (shows web interface without it).

In System Logs

Sat Sep 11 18:23:27 2021 kern.info kernel: [ 1525.814951] do_page_fault(): sending SIGSEGV to airsaned for invalid write access to 00000000
Sat Sep 11 18:23:27 2021 kern.info kernel: [ 1525.823709] epc = 77dc5f50 in libc.so[77d98000+9c000]
Sat Sep 11 18:23:27 2021 kern.info kernel: [ 1525.828906] ra  = 77d7eb0b in libsane.so.1.0.32[77d7a000+1a000]

With --debug=true:

git commit: N/A (branch N/A, rev N/A+)
build date: 2021-08-31T22:20:08Z
no device options at '/etc/airsane/options.conf'
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: epson2:libusb:001:003 (Epson PX-A650)
stable unique name: epson2:Epson PX-A650:1
uuid: 43120360-36e3-537e-8b29-04e05b0b5167
sane_init(nullptr, nullptr)
sane_open(epson2:libusb:001:003) -> 0x77b954f0
sane_close(0x77b954f0)
sane_exit()
Segmentation fault

Thanks, Yehor.

SimulPiscator commented 2 years ago

Can you check that your avahi-daemon is running?

ypopovych commented 2 years ago

Yes. It's running (can see printer service). Installed with DBus support

It crashes the same way with --mdns-announce=false.

SimulPiscator commented 2 years ago

So it crashes before logging the aunnouncement, but the announcement is active nevertheless?

ypopovych commented 2 years ago

Sorry, I added some confusion here.

I can see the Printing service (not the Scanner service) on the network (from the printing daemon).

AirSane doesn't add anything. Seems as it crashes before. From the kernel log seems as it crashed somewhere inside libsane.

SimulPiscator commented 2 years ago

If the crash is inside libsane, it must be happening from the sane_exit() call (sane_exit() is called immediately after it is logged). So it seems there is a bug in libsane or in the epson backend?

Can you scan without crash using scanimage?

ypopovych commented 2 years ago

You were right! This was a bug in the SANE backend. Compiled epkowa backend for OpenWRT and it works fine.