Atterratio / obs-gphoto

Allows connect DSLR cameras with obs-studio through gPhoto on Linux
GNU General Public License v2.0
43 stars 16 forks source link

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

Open nekohayo opened 4 years ago

nekohayo commented 4 years ago

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
Lyle-Tafoya commented 3 years ago

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 commented 3 years ago

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