Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

[Canon EOS 100D] OBS Studio crashes when toggling the gphoto2 camera off and on again #12

Open
nekohayo opened this issue Oct 5, 2019 · 2 comments

Comments

@nekohayo
Copy link

nekohayo commented Oct 5, 2019

If I add this plugin as a video source with my DSLR plugged in so I can use it in obs studio, if I temporarily disable the source (with the "eye" icon in the sources list) and then try to turn it on again, OBS will freeze or crash with the following:

double free or corruption (out)
Aborted (core dumped)

If I try to run it in gdb, it looks like this when the crash is triggered:

[New Thread 0x7fff56b3e700 (LWP 27020)]
[Thread 0x7fff56b3e700 (LWP 27020) exited]
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
[New Thread 0x7fff56b3e700 (LWP 27021)]
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
[New Thread 0x7fff56256700 (LWP 27023)]
Attempted path: share/obs/obs-studio/images/overflow.png
Attempted path: /usr/share/obs/obs-studio/images/overflow.png
[New Thread 0x7fff55404700 (LWP 27024)]
[Thread 0x7fff56256700 (LWP 27023) exited]
[Thread 0x7fff56b3e700 (LWP 27021) exited]
double free or corruption (out)

Thread 23 "libobs: graphic" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fff82f16700 (LWP 27005)]
0x00007ffff519fe35 in raise () from /lib64/libc.so.6
(gdb) bt full
#0  0x00007ffff519fe35 in raise () at /lib64/libc.so.6
#1  0x00007ffff518a895 in abort () at /lib64/libc.so.6
#2  0x00007ffff51e323f in __libc_message () at /lib64/libc.so.6
#3  0x00007ffff51ea7bc in  () at /lib64/libc.so.6
#4  0x00007ffff51ec1a8 in _int_free () at /lib64/libc.so.6
#5  0x00007fff816e8264 in capture_terminate () at /usr//lib64/obs-plugins/obs-gphoto.so
#6  0x00007fff816e8cdd in capture_show () at /usr//lib64/obs-plugins/obs-gphoto.so
#7  0x00007ffff617091b in obs_source_video_tick () at /lib64/libobs.so.0
#8  0x00007ffff61a837c in obs_graphics_thread () at /lib64/libobs.so.0
#9  0x00007ffff53364c0 in start_thread () at /lib64/libpthread.so.0
#10 0x00007ffff5264553 in clone () at /lib64/libc.so.6
Doeme added a commit to Doeme/obs-gphoto that referenced this issue Mar 17, 2020
This function is called e.g. when a scene is switched.
We do not want the camera to shut down at this time, since the next scene
may also include its image.

Furthermore, this fixes issue Atterratio#12, though the underlying cause for the crash
still remains, namely that the terminate-funciton is called multiple times
without checking that the camera is still valid.
@Lyle-Tafoya
Copy link

I have the exact same issue with my Nikon D5200. OBS outputs "double free or corruption (out)" when it crashes from this issue. In addition to crashing when I hide and then show the camera, it also crashes when I switch from a scene that does not use the camera to a scene that does use the camera. For example, when switching to my "Be Right Back" scene (which does not display my camera) and then back to my main scene, OBS crashes.

@Lyle-Tafoya
Copy link

I've tested the above commit and can confirm that it works to prevent crashes from this issue.

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

No branches or pull requests

2 participants