Bug#1030332: libcamera0.0.3:amd64: crashes wireplumber/pipewire sometimes when camera appears

2023-02-03 Thread Tomas Janousek

Hi,

On Fri, Feb 03, 2023 at 12:06:38PM +0100, Dylan Aïssi wrote:

What versions of pipewire and wireplumber do you use?


I'm on testing, so the latest:

ii  pipewire:amd64   0.3.65-1   
   amd64audio and video processing engine multimedia server
ii  pipewire-libcamera:amd64 0.3.65-1   
   amd64audio and video processing engine multimedia server
ii  wireplumber  0.4.13-1   
   amd64modular session / policy manager for PipeWire


Can you try to reproduce with libcamera 0.0.4 in experimental? But because of
a soname change, you would need to rebuild pipewire against the new libcamera.


I looked at the commits and diff between 0.0.3 and 0.0.4 yesterday and 
it seemed that testing 0.0.4 would be a waste of time, but suppose I can 
try it someday. Although I've since realised that I don't really need 
pipewire-libcamera on this hardware (or, well, any sort of camera 
support in pipewire at all…) so it's a bit of a low priority for me (and 
I'll understand if you treat it the same; just wanted to post the 
backtrace somewhere for reference really).


--
Tomáš "liskin" ("Pivník") Janoušek, https://lisk.in/


Bug#1030332: libcamera0.0.3:amd64: crashes wireplumber/pipewire sometimes when camera appears

2023-02-03 Thread Dylan Aïssi
Hello,

Le ven. 3 févr. 2023 à 01:27, Tomas Janousek  a écrit :
>
> When a USB camera appears (usbguard allow-device …, or just
> echo 1 >/sys/…/authorized), the pipewire and/or wireplumber processes 
> sometimes segfault in libcamera. Not always, but doing usbguard block-device 
> followed by usbguard allow-device a couple times makes them crash eventually. 
> I can reproduce this with the integrated camera on two different ThinkPads 
> made a couple years apart, the T25 and P14s Gen2i.
>

What versions of pipewire and wireplumber do you use?

Can you try to reproduce with libcamera 0.0.4 in experimental? But because of
a soname change, you would need to rebuild pipewire against the new libcamera.

Best,
Dylan



Bug#1030332: libcamera0.0.3:amd64: crashes wireplumber/pipewire sometimes when camera appears

2023-02-02 Thread Tomas Janousek
Package: libcamera0.0.3
Version: 0.0.3-4
Severity: normal

When a USB camera appears (usbguard allow-device …, or just
echo 1 >/sys/…/authorized), the pipewire and/or wireplumber processes 
sometimes segfault in libcamera. Not always, but doing usbguard 
block-device followed by usbguard allow-device a couple times makes them 
crash eventually. I can reproduce this with the integrated camera on two 
different ThinkPads made a couple years apart, the T25 and P14s Gen2i.

Backtraces from coredumpctl debug follow:

Core was generated by `/usr/bin/wireplumber'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  std::_Rb_tree > >, std::_Select1st > > >, std::less, 
std::allocator > > > >::_S_left (__x=) 
at /usr/include/c++/12/bits/stl_function.h:407
407   operator()(const _Tp& __x, const _Tp& __y) const
[Current thread is 1 (Thread 0x7fd067eb16c0 (LWP 1508236))]
(gdb) bt
#0  std::_Rb_tree > >, std::_Select1st > > >, std::less, 
std::allocator > > > 
>::_S_left(std::_Rb_tree_node_base*) (__x=)
at /usr/include/c++/12/bits/stl_function.h:407
#1  std::_Rb_tree > >, std::_Select1st > > >, std::less, 
std::allocator > > > 
>::_M_lower_bound(std::_Rb_tree_node > > >*, std::_Rb_tree_node_base*, 
unsigned long const&) (__k=@0x7fd067eaff08: 20736, __y=0x7fd05c002e20, 
__x=0x21, this=0x7fd05c002e18) at /usr/include/c++/12/bits/stl_tree.h:1952
#2  std::_Rb_tree > >, std::_Select1st > > >, std::less, 
std::allocator > > > >::lower_bound(unsigned long 
const&) (__k=@0x7fd067eaff08: 20736, this=0x7fd05c002e18)
at /usr/include/c++/12/bits/stl_tree.h:1270
#3  std::map >, std::less, 
std::allocator > > > >::lower_bound(unsigned long 
const&) (__x=@0x7fd067eaff08: 20736, this=0x7fd05c002e18) at 
/usr/include/c++/12/bits/stl_map.h:1307
#4  std::map >, std::less, 
std::allocator > > > >::operator[](unsigned long 
const&) (__k=@0x7fd067eaff08: 20736, this=0x7fd05c002e18) at 
/usr/include/c++/12/bits/stl_map.h:507
#5  libcamera::DeviceEnumeratorUdev::addV4L2Device(unsigned long) 
(this=0x7fd05c000e10, devnum=) at 
../src/libcamera/device_enumerator_udev.cpp:306
#6  0x7fd075efe10f in 
libcamera::DeviceEnumeratorUdev::addUdevDevice(udev_device*) 
(this=0x7fd05c000e10, dev=0x7fd05c0037d0) at 
../src/libcamera/device_enumerator_udev.cpp:113
#7  0x7fd075efed03 in libcamera::DeviceEnumeratorUdev::udevNotify() 
(this=0x7fd05c000e10) at ../src/libcamera/device_enumerator_udev.cpp:340
#8  0x7fd075d7092c in libcamera::Signal<>::emit() (this=) at 
../include/libcamera/base/signal.h:153
#9  libcamera::EventDispatcherPoll::processNotifiers(std::vector > const&) (this=0x7fd05c0012e0, pollfds=) 
at ../src/libcamera/base/event_dispatcher_poll.cpp:281
#10 0x7fd075d70dc2 in libcamera::EventDispatcherPoll::processEvents() 
(this=0x7fd05c0012e0) at ../src/libcamera/base/event_dispatcher_poll.cpp:169
#11 0x7fd075d79809 in libcamera::Thread::exec() 
(this=this@entry=0x56119d05f840) at ../src/libcamera/base/thread.cpp:341
#12 0x7fd075e52507 in libcamera::CameraManager::Private::run() 
(this=0x56119d05f830) at ../src/libcamera/camera_manager.cpp:122
#13 0x7fd075ad44a3 in std::execute_native_thread_routine(void*) 
(__p=0x56119cfa2aa0) at ../../../../../src/libstdc++-v3/src/c++11/thread.cc:82
#14 0x7fd079377fd4 in start_thread (arg=) at 
./nptl/pthread_create.c:442
#15 0x7fd0793f78d0 in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:100

Core was generated by `/usr/bin/pipewire'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  std::_Rb_tree > >, std::_Select1st > > >, std::less, 
std::allocator > > > >::_S_left (__x=) 
at /usr/include/c++/12/bits/stl_function.h:407
407   operator()(const _Tp& __x, const _Tp& __y) const
[Current thread is 1 (Thread 0x7fe1d62986c0 (LWP 1507832))]
(gdb) bt
#0  std::_Rb_tree > >, std::_Select1st > > >, std::less, 
std::allocator > > > >::_S_left (__x=) 
at /usr/include/c++/12/bits/stl_function.h:407
#1  std::_Rb_tree > >, std::_Select1st > > >, std::less, 
std::allocator > > > >::_M_lower_bound 
(__k=@0x7fe1d6297008: 20738, __y=0x7fe1cc010f30, __x=0x10001,
this=0x7fe1cc010f28) at /usr/include/c++/12/bits/stl_tree.h:1952
#2  std::_Rb_tree > >, std::_Select1st > > >, std::less, 
std::allocator > > > >::lower_bound 
(__k=@0x7fe1d6297008: 20738, this=0x7fe1cc010f28)
at /usr/include/c++/12/bits/stl_tree.h:1270
#3  std::map >, std::less, 
std::allocator > > > >::lower_bound 
(__x=@0x7fe1d6297008: 20738, this=0x7fe1cc010f28) at 
/usr/include/c++/12/bits/stl_map.h:1307
#4  std::map >, std::less, 
std::allocator > > > >::operator[] 
(__k=@0x7fe1d6297008: 20738, this=0x7fe1cc010f28) at 
/usr/include/c++/12/bits/stl_map.h:507
#5  libcamera::DeviceEnumeratorUdev::addV4L2Device (this=0x7fe1cc012130, 
devnum=) at ../src/libcamera/device_enumerator_udev.cpp:306
#6  0x7fe1d9fa810f in libcamera::DeviceEnumeratorUdev::addUdevDevice 
(this=0x7fe1cc012130, dev=0x7fe1cc012790) at 
../src/libcamera/device_enumerator_udev.cpp:113
#7