Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zbarcam crashes on ubuntu server #239

Open
bedy93 opened this issue Dec 27, 2022 · 4 comments
Open

zbarcam crashes on ubuntu server #239

bedy93 opened this issue Dec 27, 2022 · 4 comments

Comments

@bedy93
Copy link

bedy93 commented Dec 27, 2022

Hi all,

I was trying to use zbarcam on some notebooks but it crashes.
OS: ubuntu 22.04 lts server & 22.10 server Zbarcam: 0.23.92

I'm using the following command: zbarcam --nodisplay --verbose=3
It gives the following log: https://pastebin.com/pcZcJHUG After v4l2_get_supported_resolutions fails in v4l2_probe_iomode, which leads to a segmentation fault.

I thought I dig into the issue, so I've installed the tools built my own version.
Surprisingly that leads to a different failiure(Probably because I haven't set HAVE_SYS_MMAN_H switch...?), see: https://pastebin.com/Nrd71Ebt
The v4l2_probe_iomode finishes, but doesn't set vdo->iomode so after the probe_iomode finished it defaults to READWRITE, but it still fails.

I've hardcoded the idomode to MMAP and with that it runs just fine. See: https://pastebin.com/0USHcj0h
It also works with USERPTR. (No log saved) Strange that it defaults to READWRITE, which is the only not working option.

So my conclusion is, that there are two issues:

  • The v4l2_probe_iomode fails during probing.
  • The fallback idomode in v4l2_probe_iomode failure case is READWRITE which is not working (at least on my config)

Could you fix this? I can offer some support.

@jsfan3
Copy link

jsfan3 commented Aug 18, 2023

I confirm the same bug on Linux Mint 21.

@Harvie
Copy link

Harvie commented Nov 8, 2023

I have same issue on Debian 12 (package from debian repo), zbarcam version 0.23.92. It only happens with --nodisplay parameter. Causes segmentation fault when trying to acquire pthread mutex during zbar_processor_init(), precisely zbar_negotiate_format():

(gdb) bt full
#0  0x0000fffff7e31e64 in ___pthread_mutex_lock (mutex=0x98) at ./nptl/pthread_mutex_lock.c:80
        type = <optimized out>
        __PRETTY_FUNCTION__ = "___pthread_mutex_lock"
        id = <optimized out>
#1  0x0000fffff7f6aa58 in zbar_negotiate_format () from /lib/aarch64-linux-gnu/libzbar.so.0
No symbol table info available.
#2  0x0000fffff7f6c894 in zbar_processor_init () from /lib/aarch64-linux-gnu/libzbar.so.0
No symbol table info available.
#3  0x0000aaaaaaaa1ba4 in main (argc=<optimized out>, argv=<optimized out>) at zbarcam/zbarcam.c:307
        video_device = 0xaaaaaaaa2a18 ""
        dbus = 1
        display = 0
        infmt = 0
        outfmt = 0
        i = 4
        active = <optimized out>

@Harvie
Copy link

Harvie commented Nov 8, 2023

Probably related to calling window_lock() when in --nodisplay mode?

@Harvie
Copy link

Harvie commented Nov 8, 2023

Which was probably fixed in 8c9b148
@bedy93 @jsfan3 can you test latest git master please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants