Segmentation fault on examples/computer_vision/opencvExample

Hi,

i try to run the example for computer_vision/opencvExample on Manjaro Linux (Arch linux based). I always get a segmentation fault on start. Seems like Gstreamer is crashing with OF. It works fine on the system.

GStreamer 1.20.0
https://www.archlinux.org/

Starting program: /home/falko/Downloads/of_v20220320_linux64gcc6_release/examples/computer_vision/opencvExample/bin/opencvExample_debug 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffe674d640 (LWP 10282)]
[New Thread 0x7fffe5f4c640 (LWP 10283)]
[New Thread 0x7fffe574b640 (LWP 10284)]
[New Thread 0x7fffe4f4a640 (LWP 10285)]
[New Thread 0x7fffd7fff640 (LWP 10286)]
[New Thread 0x7fffd77fe640 (LWP 10287)]
[New Thread 0x7fffd6ffd640 (LWP 10288)]
[New Thread 0x7fffd67fc640 (LWP 10289)]
[New Thread 0x7fffd5ffb640 (LWP 10290)]
[New Thread 0x7fffd57fa640 (LWP 10291)]
[New Thread 0x7fffd4ff9640 (LWP 10292)]
[New Thread 0x7fffb63ff640 (LWP 10293)]
[New Thread 0x7fffb5bfe640 (LWP 10294)]
[New Thread 0x7fffb53fd640 (LWP 10295)]
[New Thread 0x7fffb4bfc640 (LWP 10296)]
[New Thread 0x7fff92563640 (LWP 10297)]
[New Thread 0x7fff91d62640 (LWP 10298)]
[New Thread 0x7fff91561640 (LWP 10299)]
[New Thread 0x7fff90d60640 (LWP 10300)]
[New Thread 0x7fff9055f640 (LWP 10301)]
[New Thread 0x7fff8fd5e640 (LWP 10302)]
[New Thread 0x7fff8f55d640 (LWP 10303)]
[New Thread 0x7fff8ed5c640 (LWP 10304)]
[New Thread 0x7fff8e55b640 (LWP 10305)]
[New Thread 0x7fff8dd5a640 (LWP 10306)]
[New Thread 0x7fff8d559640 (LWP 10307)]
[New Thread 0x7fff8cd58640 (LWP 10308)]
[New Thread 0x7fff5ffff640 (LWP 10309)]

Thread 29 "vqueue:src" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff5ffff640 (LWP 10309)]
0x000000000000000a in ?? ()
(gdb) bt
#0  0x000000000000000a in  ()
#1  0x00007ffff7f806f5 in  () at /usr/lib/libgstapp-1.0.so.0
#2  0x00007ffff7e5ca62 in  () at /usr/lib/libgstbase-1.0.so.0
#3  0x00007ffff7d6fcfd in  () at /usr/lib/libgstreamer-1.0.so.0
#4  0x00007ffff7d7039e in  () at /usr/lib/libgstreamer-1.0.so.0
#5  0x00007ffff7d70879 in  () at /usr/lib/libgstreamer-1.0.so.0
#6  0x00007ffff7d663e1 in  () at /usr/lib/libgstreamer-1.0.so.0
#7  0x00007ffff7d73a7b in gst_pad_push_event () at /usr/lib/libgstreamer-1.0.so.0
#8  0x00007ffff7d74045 in  () at /usr/lib/libgstreamer-1.0.so.0
#9  0x00007ffff7d6d87e in gst_pad_forward () at /usr/lib/libgstreamer-1.0.so.0
#10 0x00007ffff7d6d9d6 in gst_pad_event_default () at /usr/lib/libgstreamer-1.0.so.0
#11 0x00007ffff7d6fcfd in  () at /usr/lib/libgstreamer-1.0.so.0
#12 0x00007ffff7d7039e in  () at /usr/lib/libgstreamer-1.0.so.0
#13 0x00007ffff7d70879 in  () at /usr/lib/libgstreamer-1.0.so.0
#14 0x00007ffff7d663e1 in  () at /usr/lib/libgstreamer-1.0.so.0
#15 0x00007ffff7d73a7b in gst_pad_push_event () at /usr/lib/libgstreamer-1.0.so.0
#16 0x00007ffff7d6fcfd in  () at /usr/lib/libgstreamer-1.0.so.0
#17 0x00007ffff7d7039e in  () at /usr/lib/libgstreamer-1.0.so.0
#18 0x00007ffff7d70879 in  () at /usr/lib/libgstreamer-1.0.so.0
#19 0x00007ffff7d663e1 in  () at /usr/lib/libgstreamer-1.0.so.0
#20 0x00007ffff7d73a7b in gst_pad_push_event () at /usr/lib/libgstreamer-1.0.so.0
#21 0x00007ffff7d74045 in  () at /usr/lib/libgstreamer-1.0.so.0
#22 0x00007ffff7d6d87e in gst_pad_forward () at /usr/lib/libgstreamer-1.0.so.0
#23 0x00007ffff7d6d9d6 in gst_pad_event_default () at /usr/lib/libgstreamer-1.0.so.0
#24 0x00007fffe42ba12c in  () at /usr/lib/gstreamer-1.0/libgstplayback.so
#25 0x00007ffff7d6fcfd in  () at /usr/lib/libgstreamer-1.0.so.0
#26 0x00007ffff7d7039e in  () at /usr/lib/libgstreamer-1.0.so.0
#27 0x00007ffff7d70879 in  () at /usr/lib/libgstreamer-1.0.so.0
#28 0x00007ffff7d663e1 in  () at /usr/lib/libgstreamer-1.0.so.0
#29 0x00007ffff7d73a7b in gst_pad_push_event () at /usr/lib/libgstreamer-1.0.so.0
#30 0x00007fffe40fa467 in  () at /usr/lib/gstreamer-1.0/libgstcoreelements.so
#31 0x00007ffff7d99c81 in  () at /usr/lib/libgstreamer-1.0.so.0
#32 0x00007ffff742e7e7 in  () at /usr/lib/libglib-2.0.so.0
#33 0x00007ffff742b815 in  () at /usr/lib/libglib-2.0.so.0
#34 0x00007ffff3f765c2 in start_thread () at /usr/lib/libc.so.6
#35 0x00007ffff3ffb584 in clone () at /usr/lib/libc.so.6

Any ideas how to handle this?

Since I am on linux right now I ran this example to see if I had the same issue. I am on ubuntu 20.4 and it works without any segmentation faults. Did the install codecs and dependencies scripts from this guide run for you? That’s the first place I would start. :v:

1 Like

I have a similar problem that I recently reported:

I don’t know if the cause is the same.

I am running Debian 11 Testing.

Thx for Testing. What Version of GStreamer do you have?

I am very sure i did do a correct installation for for Dependencies. I assume you have a GStreamer version <1.20. Archlinux based Distros are always very bleeding-edge. So it might be that the issue does not exist in the Version used in Ubuntu 20.6

StaffanMelin, did you try using the latest openFrameworks Version from github (Nightly Build)? What Version of GStreamer do you have ?

gst-play-1.0 --version

1 Like

Hi @habales, just downloaded the latest nightly build and tried the videoGrabber example but it still crashes.

It Seg Faults in the call to

vidGrabber.initGrabber()

even though there is a device found.

Looking into this call it is the call to

if( grabber->isInitialized() && bUseTexture ){

that crashes (in ofVideoGrabberg.cpp, line 65).

All previous calls to isInitialised(), calling isLoaded(), seems to return false.

My version of GSreamer is 1.20.0.

This does seem to be a problem with GNU/Linux and gstreamer v 1.20.

For now I have solved my gstreamer issues by violently downgrading everything gstreamer-related, as detailed in my blogpost. Did this on arch linux, which should make it doable on manjaro as well.

1 Like

have you checked issues on Gstreamer project itself?

Sorry for the late reply here and thank you for the link (that you also posted on the issue: https://github.com/openframeworks/openFrameworks/issues/6871). Great!

For me it doesn’t happen with a video (maybe it does, too) but when capturing from my laptops camera.