GNOME Bugzilla – Bug 697236
v4l2src: SEGFAULT when changing state of uvch264src pipeline
Last modified: 2013-04-17 19:38:23 UTC
Created attachment 240561 [details] [review] Check if pool is NULL before calling gst_v4l2_buffer_pool_process To reproduce, run the uvch264 test program, change the state to playing after hitting capture. This bug does not happen every time. I've attached a patch which fixes the immediate problem of the NULL pointer access, however I'm not sure if it's the right approach. Here's the backtrace.
+ Trace 231723
I think there's a similar bug somewhere just with v4l2src, not sure if it got fixed or not.
I don't understand in what condition the pool can be NULL. The only reason I can think of is when negotiation fails but then it should never reach the fill method. Do you have a debug log? something like: GST_DEBUG=*basesrc*:8,*v4l2*:8 should be enough
Bug #695981 looks the same, and has a script to reproduce it.
Created attachment 240688 [details] log with GST_DEBUG=*basesrc*:8,*v4l2*:8 up until SEGFAULT
Created attachment 240689 [details] output of thread apply all bt
Ok I've added the logs plus the backtrace from GDB for all the threads, let me know if you need more info.
I assume you have a Logitech C920 ?
I can't reproduce the bug, but I'm pretty sure Tim is right that this is the same as #695981, can you please test the two patches attached there ? *** This bug has been marked as a duplicate of bug 695981 ***
(In reply to comment #7) > I assume you have a Logitech C920 ? yup
(In reply to comment #8) > I can't reproduce the bug, but I'm pretty sure Tim is right that this is the > same as #695981, can you please test the two patches attached there ? > > *** This bug has been marked as a duplicate of bug 695981 *** Will do, I should be able to test that tonight.
Ok I've tested the patches from Bug #695981 and I'm no longer getting the segfault, but I do get a SIGABORT, here are the logs: 0:00:29.317479955 18999 0x82da430 ERROR v4l2 gstv4l2bufferpool.c:414:gst_v4l2_buffer_pool_set_config:<v4l2bufferpool5> error requesting 4 buffers: Device or resource busy 0:00:29.318569774 18999 0x82da430 ERROR v4l2 gstv4l2bufferpool.c:414:gst_v4l2_buffer_pool_set_config:<v4l2bufferpool5> error requesting 4 buffers: Device or resource busy 0:00:29.318629140 18999 0x82da430 ERROR v4l2 gstv4l2bufferpool.c:414:gst_v4l2_buffer_pool_set_config:<v4l2bufferpool5> error requesting 4 buffers: Device or resource busy 0:00:29.318681243 18999 0x82da430 ERROR bufferpool gstbufferpool.c:485:gst_buffer_pool_set_active:<v4l2bufferpool5> pool was not configured 0:00:29.318717351 18999 0x82da430 ERROR basesrc gstbasesrc.c:2871:gst_base_src_set_allocation:<v4l2src2> failed to activate bufferpool. 0:00:30.623800030 18999 0x82da430 ERROR v4l2 gstv4l2bufferpool.c:414:gst_v4l2_buffer_pool_set_config:<v4l2bufferpool6> error requesting 4 buffers: Device or resource busy 0:00:30.624452498 18999 0x82da430 ERROR v4l2 gstv4l2bufferpool.c:414:gst_v4l2_buffer_pool_set_config:<v4l2bufferpool6> error requesting 4 buffers: Device or resource busy 0:00:30.624511724 18999 0x82da430 ERROR v4l2 gstv4l2bufferpool.c:414:gst_v4l2_buffer_pool_set_config:<v4l2bufferpool6> error requesting 4 buffers: Device or resource busy 0:00:30.624550068 18999 0x82da430 ERROR bufferpool gstbufferpool.c:485:gst_buffer_pool_set_active:<v4l2bufferpool6> pool was not configured 0:00:30.624580798 18999 0x82da430 ERROR basesrc gstbasesrc.c:2871:gst_base_src_set_allocation:<v4l2src3> failed to activate bufferpool. 0:00:32.574675228 18999 0x82da430 ERROR v4l2 gstv4l2bufferpool.c:414:gst_v4l2_buffer_pool_set_config:<v4l2bufferpool7> error requesting 4 buffers: Device or resource busy 0:00:32.575328533 18999 0x82da430 ERROR v4l2 gstv4l2bufferpool.c:414:gst_v4l2_buffer_pool_set_config:<v4l2bufferpool7> error requesting 4 buffers: Device or resource busy 0:00:32.575386921 18999 0x82da430 ERROR v4l2 gstv4l2bufferpool.c:414:gst_v4l2_buffer_pool_set_config:<v4l2bufferpool7> error requesting 4 buffers: Device or resource busy 0:00:32.575420725 18999 0x82da430 ERROR bufferpool gstbufferpool.c:485:gst_buffer_pool_set_active:<v4l2bufferpool7> pool was not configured 0:00:32.575449500 18999 0x82da430 ERROR basesrc gstbasesrc.c:2871:gst_base_src_set_allocation:<v4l2src4> failed to activate bufferpool. 0:00:33.779579837 18999 0x82da430 ERROR v4l2 gstv4l2bufferpool.c:414:gst_v4l2_buffer_pool_set_config:<v4l2bufferpool8> error requesting 4 buffers: Device or resource busy 0:00:33.780233840 18999 0x82da430 ERROR v4l2 gstv4l2bufferpool.c:414:gst_v4l2_buffer_pool_set_config:<v4l2bufferpool8> error requesting 4 buffers: Device or resource busy 0:00:33.780291739 18999 0x82da430 ERROR v4l2 gstv4l2bufferpool.c:414:gst_v4l2_buffer_pool_set_config:<v4l2bufferpool8> error requesting 4 buffers: Device or resource busy 0:00:33.780330641 18999 0x82da430 ERROR bufferpool gstbufferpool.c:485:gst_buffer_pool_set_active:<v4l2bufferpool8> pool was not configured 0:00:33.780353759 18999 0x82da430 ERROR basesrc gstbasesrc.c:2871:gst_base_src_set_allocation:<v4l2src5> failed to activate bufferpool. 0:00:34.706867921 18999 0x82da430 ERROR v4l2 gstv4l2bufferpool.c:414:gst_v4l2_buffer_pool_set_config:<v4l2bufferpool9> error requesting 4 buffers: Device or resource busy 0:00:34.707544344 18999 0x82da430 ERROR v4l2 gstv4l2bufferpool.c:414:gst_v4l2_buffer_pool_set_config:<v4l2bufferpool9> error requesting 4 buffers: Device or resource busy 0:00:34.707602732 18999 0x82da430 ERROR v4l2 gstv4l2bufferpool.c:414:gst_v4l2_buffer_pool_set_config:<v4l2bufferpool9> error requesting 4 buffers: Device or resource busy 0:00:34.707636186 18999 0x82da430 ERROR bufferpool gstbufferpool.c:485:gst_buffer_pool_set_active:<v4l2bufferpool9> pool was not configured 0:00:34.707660142 18999 0x82da430 ERROR basesrc gstbasesrc.c:2871:gst_base_src_set_allocation:<v4l2src6> failed to activate bufferpool. ** ERROR:gstv4l2bufferpool.c:922:gst_v4l2_buffer_pool_release_buffer: code should not be reached Program received signal SIGABRT, Aborted. 0xb7fdd424 in __kernel_vsyscall ()
And the backtrace:
+ Trace 231804
Thread 1 (Thread 0xb6e4a840 (LWP 18999))
Can you attach more of the log? with GST_DEBUG=*v4l2*:8,basesrc:8 ?
Created attachment 241713 [details] log with GST_DEBUG=*basesrc*:8,*v4l2*:8 up until Abort
I'm not sure what you're application is.. but with the current v4l2src, you have to shut down the entire pipeline while stopping v4l2src. Work to fix that has been done on bug #682770
All this testing was with: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/tests/examples/uvch264/test-uvch264.c