Menu

#2 segfault in 1.3.1 after inserting USB cable

1.0
closed
WilhelmM
None
2025-12-26
2014-10-12
Rolf
No

I get a segfault for 1.3.1 when starting scanbd first and only inserting the scanner USB cable afterwards.

$ scanbd -f
scanbd: Can't set the effective gid to 157
scanbd: Can't set the effective uid to 113
scanbd: dbus match type='signal',interface='org.freedesktop.Hal.Manager'
scanbd: Not Primary Owner (-1)
scanbd: Name Error (Connection ":1.130" is not allowed to own the service "de.kmux.scanbd.server" due to security policies in the configuration file)
Segmentation fault (core dumped)

Related

Tickets: #2

Discussion

1 2 > >> (Page 1 of 2)
  • WilhelmM

    WilhelmM - 2014-10-12

    can you verify that withh trunk? Or 1.4.0?

     
  • Rolf

    Rolf - 2014-10-12

    I was able to verify this with 1.4.0. But I was unable to run scanbd in gdb, I suspect scanbd went to the background, despite being called like "gdb scanbd -f".

     
  • Rolf

    Rolf - 2014-10-13

    I was able to get a gdb backtrace now, but I am not sure it will be very helpful. Here is what I did.

    1) fire up gdb as "gdb scanbd"
    2) run scanbd as "run -f"
    3) unplug cable
    4) observe the crash and get the backtrace with "bt"

    /usr/sbin/scanbd: option[32] sensors for device genesys:libusb:001:009 not of type BOOL|INT|FIXED|STRING|BUTTON. Skipping
    /usr/sbin/scanbd: option[41] Buttons for device genesys:libusb:001:009 not of type BOOL|INT|FIXED|STRING|BUTTON. Skipping
    /usr/sbin/scanbd: Can't read value of scan: Invalid argument
    /usr/sbin/scanbd: Can't read value of email: Invalid argument
    /usr/sbin/scanbd: Can't read value of copy: Invalid argument
    /usr/sbin/scanbd: Can't read value of file: Invalid argument
    [Thread 0xb42feb40 (LWP 26662) exited]
    [Thread 0xb4affb40 (LWP 26661) exited]

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 0xb7aa7b40 (LWP 26629)]
    0xb7ab64dc in ?? ()
    (gdb) bt
    #0 0xb7ab64dc in ?? ()
    #1 0xb4d03318 in ?? ()
    #2 0xb7e5f4ce in clone () from /lib/i386-linux-gnu/libc.so.6
    (gdb)

     

    Last edit: Rolf 2014-10-13
  • WilhelmM

    WilhelmM - 2014-12-15

    not reproducable for me

     
  • WilhelmM

    WilhelmM - 2014-12-15
    • status: open --> closed
     
  • Lazar Nikolic

    Lazar Nikolic - 2015-06-17

    I'm experiencing the same thing (or very similar) in Ubuntu 15.04 with fujitsu fi-6130 Here are the steps to reproduce.

    1) Scanner is turned off
    2) Computer is restarted
    3) On startup scanbd service is brought up by systemd so its up and running
    4) I press the button that turns the scanner on
    5) Immediatelly afterwards scanbd segfaults

    If the scanner is on when the computer is being restarted - then scanbd continues working just fine. However, if I power the scanner off, and then power it on - scanbd segfaults again once the scanner is turned on.

    I'm not at all familiar with scanbd code, I'm just a user. But I'm willing to do whatever steps are necessary to help debug. I've seen other people complain online about this same exact issue.

     
  • bulica2006

    bulica2006 - 2015-08-05

    I have the same problem with scanbd 1.4.1-5 on ubuntu 15.04. My scanner is CanoScan LiDE 700F.

    scanbd seems working fine when the scanner has already been plugged in. But when I plug in the scanner after scanbd has ben started, it segfaulted. Does anyone has a solution for this?

    Thanks

     
  • WilhelmM

    WilhelmM - 2015-08-06

    Can you give the latest trunk version a try?

     
  • Lazar Nikolic

    Lazar Nikolic - 2015-10-24

    Same issue in Ubuntu 15.10 with scandb version 1.4.1-7. I've been experiencing this issue ever since Ubuntu migrated from scanbuttond to scanbd. Several Ubuntu versions later (and several scandb versions later), the exact same thing is happening over and over again.

     
  • WilhelmM

    WilhelmM - 2015-10-27

    Please provide a log-file with debug level=7 containing this very situation.

     
  • Lazar Nikolic

    Lazar Nikolic - 2015-10-27

    Here is the output of "journalctl -u scanbd.service" command with debug level 7 in the scanbd config file.

    Oct 27 03:37:37 knopfler systemd[1]: Started Scanner button polling Service.
    Oct 27 03:37:38 knopfler scanbd[28186]: /usr/sbin/scanbd: debug on: level: 7
    Oct 27 03:37:38 knopfler scanbd[28186]: /usr/sbin/scanbd: dropping privs to uid lazar
    Oct 27 03:37:38 knopfler scanbd[28186]: /usr/sbin/scanbd: dropping privs to gid lazar
    Oct 27 03:37:38 knopfler scanbd[28186]: /usr/sbin/scanbd: drop privileges to gid: 1000
    Oct 27 03:37:38 knopfler scanbd[28186]: /usr/sbin/scanbd: Running as effective gid 1000
    Oct 27 03:37:38 knopfler scanbd[28186]: /usr/sbin/scanbd: drop privileges to uid: 1000
    Oct 27 03:37:38 knopfler scanbd[28186]: /usr/sbin/scanbd: Running as effective uid 1000
    Oct 27 03:37:38 knopfler scanbd[28186]: /usr/sbin/scanbd: dbus_init
    Oct 27 03:37:38 knopfler scanbd[28186]: /usr/sbin/scanbd: dbus match type='signal',interface='org.freedesktop.Hal.Manager'
    Oct 27 03:37:38 knopfler scanbd[28186]: /usr/sbin/scanbd: sane version 1.0
    Oct 27 03:37:38 knopfler scanbd[28186]: /usr/sbin/scanbd: Scanning for local-only devices
    Oct 27 03:37:42 knopfler scanbd[28186]: /usr/sbin/scanbd: start_sane_threads
    Oct 27 03:37:42 knopfler scanbd[28186]: /usr/sbin/scanbd: start dbus thread
    Oct 27 03:37:42 knopfler scanbd[28186]: /usr/sbin/scanbd: Not Primary Owner (-1)
    Oct 27 03:37:42 knopfler scanbd[28186]: /usr/sbin/scanbd: Name Error (Connection ":1.402" is not allowed to own the service "de.kmux.scanbd.server" due to security policies in the configuration file)
    Oct 27 03:37:42 knopfler scanbd[28186]: /usr/sbin/scanbd: udev init
    Oct 27 03:37:42 knopfler scanbd[28186]: /usr/sbin/scanbd: get udev monitor
    Oct 27 03:37:42 knopfler scanbd[28186]: /usr/sbin/scanbd: udev fd is non-blocking, now setting to blocking mode
    Oct 27 03:37:42 knopfler scanbd[28186]: /usr/sbin/scanbd: start udev thread
    Oct 27 03:37:42 knopfler scanbd[28186]: /usr/sbin/scanbd: udev thread started
    Oct 27 03:37:52 knopfler scanbd[28186]: /usr/sbin/scanbd: new devive
    Oct 27 03:37:52 knopfler scanbd[28186]: /usr/sbin/scanbd: udev device type: usb_device
    Oct 27 03:37:52 knopfler scanbd[28186]: /usr/sbin/scanbd: udev device action: add
    Oct 27 03:37:52 knopfler scanbd[28186]: /usr/sbin/scanbd: dbus_signal_device_added
    Oct 27 03:37:52 knopfler scanbd[28186]: /usr/sbin/scanbd: stop_sane_threads
    Oct 27 03:37:52 knopfler scanbd[28186]: /usr/sbin/scanbd: sane_exit
    Oct 27 03:37:54 knopfler systemd[1]: scanbd.service: Main process exited, code=killed, status=11/SEGV
    Oct 27 03:37:54 knopfler systemd[1]: scanbd.service: Unit entered failed state.
    Oct 27 03:37:54 knopfler systemd[1]: scanbd.service: Failed with result 'signal'.

     

    Last edit: Lazar Nikolic 2015-10-27
  • Lazar Nikolic

    Lazar Nikolic - 2015-10-27

    Another thing I noticed - not sure if this is relevant, while the debug level 7 is on. IF the scanner is turned on I'm not doing anything with it, systemd logs are full of the following lines non stop:

    Oct 27 03:47:04 knopfler scanbd[28243]: /usr/sbin/scanbd: get_sane_option_value
    Oct 27 03:47:04 knopfler scanbd[28243]: /usr/sbin/scanbd: checking option scan number 91 (0) for device fujitsu:fi-6130dj:66440: value: 0
    Oct 27 03:47:04 knopfler scanbd[28243]: /usr/sbin/scanbd: get_sane_option_value
    Oct 27 03:47:05 knopfler scanbd[28243]: /usr/sbin/scanbd: polling thread for fujitsu:fi-6130dj:66440 cancellation point
    Oct 27 03:47:05 knopfler scanbd[28243]: /usr/sbin/scanbd: polling device fujitsu:fi-6130dj:66440
    Oct 27 03:47:05 knopfler scanbd[28243]: /usr/sbin/scanbd: get_sane_option_value
    Oct 27 03:47:05 knopfler scanbd[28243]: /usr/sbin/scanbd: checking option scan number 91 (0) for device fujitsu:fi-6130dj:66440: value: 0
    Oct 27 03:47:05 knopfler scanbd[28243]: /usr/sbin/scanbd: get_sane_option_value
    Oct 27 03:47:05 knopfler scanbd[28243]: /usr/sbin/scanbd: checking option email number 89 (1) for device fujitsu:fi-6130dj:66440: value: 0
    Oct 27 03:47:05 knopfler scanbd[28243]: /usr/sbin/scanbd: get_sane_option_value
    Oct 27 03:47:05 knopfler scanbd[28243]: /usr/sbin/scanbd: checking option page-loaded number 85 (2) for device fujitsu:fi-6130dj:66440: value: 0
    Oct 27 03:47:05 knopfler scanbd[28243]: /usr/sbin/scanbd: got the value already -> copy
    Oct 27 03:47:05 knopfler scanbd[28243]: /usr/sbin/scanbd: copy the value of option 85
    Oct 27 03:47:05 knopfler scanbd[28243]: /usr/sbin/scanbd: checking option page-loaded number 85 (3) for device fujitsu:fi-6130dj:66440: value: 0
    Oct 27 03:47:05 knopfler scanbd[28243]: /usr/sbin/scanbd: get_sane_option_value
    Oct 27 03:47:05 knopfler scanbd[28243]: /usr/sbin/scanbd: checking option cover-open number 87 (4) for device fujitsu:fi-6130dj:66440: value: 0
    Oct 27 03:47:05 knopfler scanbd[28243]: /usr/sbin/scanbd: get_sane_option_value
    Oct 27 03:47:05 knopfler scanbd[28243]: /usr/sbin/scanbd: checking option power-save number 88 (5) for device fujitsu:fi-6130dj:66440: value: 0

    I'm not sure if this is what's supposed to be happening, but every second there are like 30 lines in the log even though I'm not doing anythign with the scanner. This might be completely irrelevant, but i just figured i throw it out there just in case.

     
  • WilhelmM

    WilhelmM - 2015-10-27

    Just added additional debug code to trunk. Please give it a try and send me the log as I can't reproduce the error.

     
  • Lazar Nikolic

    Lazar Nikolic - 2015-11-06

    I will give this new code a try today once i get home from work and report the debug output. If there are any particular instructions as to how to compile/run the code after it's checked out from trunk - please post it here.

     
  • Lazar Nikolic

    Lazar Nikolic - 2015-11-07

    So I've checked out the code via:
    "svn checkout svn://svn.code.sf.net/p/scanbd/code/trunk scanbd-code"
    As far as I can tell there are no instructions there as to how to build this and run it. Plese post a sequence of commands that will accomplish both of these tasks so that I can run thist lastest version with more debug code in it.

     
  • Lazar Nikolic

    Lazar Nikolic - 2015-11-07

    ./configure gmake all
    fails with
    "checking build system type... Invalid configuration gmake': machinegmake' not recognized configure: error: /bin/bash ./config.sub gmake failed"

    How do I install the appropriate gmake on my system? Doing a quick search for "gmake on ubuntu" says that you have to install "make" - but I already have "make" on my system as "sudo apt-get install make" confirms.

     
  • WilhelmM

    WilhelmM - 2015-11-07

    As usual execute first:
    $ ./configure

    Then execute:

    $ make all

    (Read gmake as GNU-make!, Sorry, but the documentation is not clear in ths respect, but no one in the past mentioned that)

     
  • Lazar Nikolic

    Lazar Nikolic - 2015-11-07

    README.txt file is super confusing and it seems like it's written by the developers of scanbd for the developers of scanbd. If you don't fall in this camp - the file is pretty useless.

    Either way, both commands executed successfully now (after installing libdbus-1dev which was a dependency for ./configure). So now that I've built it - how would i go about running this build? I do NOT want to run gmake install as the README.txt suggests, as this would presumably override the exsisting installation, config files, and my custom scripts. I would like to run the copy i've just built without copying any files to /usr/bin/ or any other system directories. I want to keep this build separate from the official version that was installed on my computer originally. How do I do accomplish this?

     
    • WilhelmM

      WilhelmM - 2015-11-07

      The usual prefix is /usr/local. confugure will do than as well as Makefile.simple. Just have a look inside. You can change the install-prefix with the prefix-option to configure or set the variable in the Makefile.simple.

       
  • Rolf

    Rolf - 2016-03-22

    Please reopen this ticket as it's obviously not fixed.

    I'm currently working on releasing 1.4.4 with r214 to Debian so that all users can provide the necessary debug information.

     
  • WilhelmM

    WilhelmM - 2016-03-23
    • status: closed --> open
     
  • Rolf

    Rolf - 2016-03-24

    1.4.4 builds fine in Debian unstable but fails to build in Ubuntu trusty for me.

     
  • Rolf

    Rolf - 2016-03-24

    I've released 1.4.4-1 to Debian unstable so people on Debian should be able to test for this problem more easily now.

     
  • Rolf

    Rolf - 2016-03-24

    I can reproduce the segfault even with 1.4.4. Here is the log with debug log level 7.

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.

MongoDB Logo MongoDB