Bug 635644

Summary: SIGSEGV within ucil_alsa_* when attempted to record a video
Product: Red Hat Enterprise Linux 6 Reporter: Kamil Dudka <kdudka>
Component: unicapAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: ovasik, pkovar, redhat-bugzilla, tpelka
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Prior to this update, the unicap utility did not check for a return value of the Advanced Linux Sound Architecture (ALSA) initialization. As a result, unicap terminated unexpectedly if the initialization of ALSA failed. With this update, the bug has been fixed by adding the missing check for a return value in order to handle failure of the ALSA initialization gracefully.
Story Points: ---
Clone Of: 572966 Environment:
Last Closed: 2011-08-24 15:09:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 572966    
Bug Blocks:    

Description Kamil Dudka 2010-09-20 12:24:53 UTC
+++ This bug was initially created as a clone of Bug #572966 +++

Created attachment 399648 [details]
proposed fix

Version-Release number of selected component (if applicable):
0.9.8-1

How reproducible:
100% on my configuration

Steps to Reproduce:
1. gdb -q --args ucview
2. run
3. start to record the video
  
Actual results:
Program received signal SIGSEGV, Segmentation fault.
(gdb) l
189     long ucil_alsa_fill_audio_buffer( void *_data )
190     {
191        alsa_data_t *data = _data;
192        long nread;
193
194        if( data->buff_fill >= ( sizeof( data->audio_buffer ) / sizeof( short ) - 1 ) )
195        {
196           return 0;
197        }
198        
(gdb) bt
#0  ucil_alsa_fill_audio_buffer (_data=0x0) at ucil_alsa.c:194
#1  fetch_and_process_audio (vobj=0x96ae10, ...) at ucil_theora.c:480
#2  ucil_theora_encode_thread (vobj=<value optimized out>) at ucil_theora.c:659
#3  start_thread (arg=<value optimized out>) at pthread_create.c:297
#4  clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

Expected results:
no crash

Additional info:
patch attached

--- Additional comment from kdudka on 2010-03-12 15:30:23 CET ---

Created attachment 399657 [details]
proposed fix V2

now got the same crash on yet another ucil_alsa_*() function ... an amended patch attached

--- Additional comment from kdudka on 2010-03-12 15:37:41 CET ---

Created attachment 399664 [details]
proposed fix V3

Oops, the same patch as V2, but this one can be compiled :-)

--- Additional comment from kdudka on 2010-03-12 16:28:30 CET ---

Comment on attachment 399664 [details]
proposed fix V3

Still not perfect.  With the patch applied, it crashes within
theora_encode_YUVin() when the recording is stopped.

--- Additional comment from kdudka on 2010-03-12 17:32:40 CET ---

Created attachment 399694 [details]
check the result of ucil_alsa_init()

--- Additional comment from kdudka on 2010-06-02 12:01:19 CEST ---

Patch proposed upstream:

https://bugs.launchpad.net/unicap/+bug/588658

--- Additional comment from updates on 2010-06-02 18:06:06 CEST ---

libucil-0.9.8-2.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/libucil-0.9.8-2.fc12

--- Additional comment from updates on 2010-06-02 18:06:39 CEST ---

libucil-0.9.8-2.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/libucil-0.9.8-2.fc13

--- Additional comment from redhat-bugzilla on 2010-06-03 13:29:53 CEST ---

*** Bug 599489 has been marked as a duplicate of this bug. ***

--- Additional comment from updates on 2010-06-03 20:07:44 CEST ---

libucil-0.9.8-2.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update libucil'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/libucil-0.9.8-2.fc13

--- Additional comment from updates on 2010-06-03 20:14:22 CEST ---

libucil-0.9.8-2.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update libucil'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/libucil-0.9.8-2.fc12

--- Additional comment from updates on 2010-06-21 23:37:07 CEST ---

libucil-0.9.8-2.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

--- Additional comment from updates on 2010-06-21 23:43:47 CEST ---

libucil-0.9.8-2.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 2 Suzanne Logcher 2011-02-15 21:42:58 UTC
This issue was proposed for RHEL 6.1 FasTrack but did not get resolved in time.
It has been moved to RHEL 6.2 FasTrack.

Comment 7 Petr Kovar 2011-07-04 17:09:12 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Prior to this update, the unicap utility did not check for a return value of the Advanced Linux Sound Architecture (ALSA) initialization. As a result, unicap terminated unexpectedly if the initialization of ALSA failed. With this update, the bug has been fixed by adding the missing check for a return value in order to handle failure of the ALSA initialization gracefully.

Comment 10 errata-xmlrpc 2011-08-24 15:09:58 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1202.html