[pulseaudio-tickets] [PulseAudio] #333: Pulseaudio blocks forever when /dev/urandom is not accesible

PulseAudio trac-noreply at tango.0pointer.de
Sun Aug 3 00:17:33 PDT 2008


#333: Pulseaudio blocks forever when /dev/urandom is not accesible
--------------------+-------------------------------------------------------
 Reporter:  diegoe  |       Owner:  lennart
     Type:  defect  |      Status:  new    
 Priority:  normal  |   Milestone:         
Component:  daemon  |    Severity:  major  
 Keywords:          |  
--------------------+-------------------------------------------------------
 Forwarded from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=491270:
 """
 I found the bug thanks to strace: it loops for ever with

 open("/dev/urandom",O_RDONLY|O_LARGEFILE) = -1 EACCES (Permission denied)

 I guess it comes from src/pulsecore/random.c, line 64:

 /* $Id: random.c 1971 2007-10-28 19:13:50Z lennart $ */

 [snip - device = "/dev/urandom"]

 while (*device) {
     ret = 0;

     if ((fd = open(*device, O_RDONLY)) >= 0) {

         if ((r = pa_loop_read(fd, ret_data, length, NULL)) < 0 || (size_t)
 r != length)
             ret = -1;

         pa_close(fd);
     } else
         ret = -1;

     if (ret == 0)
         break;
 }

 It can't open /dev/urandom (because of wrong file permission) and thus
 never
 gets out of the while loop. I think it would be safer to exit (with a
 failure
 code) when /dev/urandom is not available.

 Kind regards,
 --
 Gabriel Kerneis

 """

 There's a proposed patch:
 http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=42;filename=increment-
 device;att=1;bug=491270

 I guess it's not quite normal to have /dev/urandom with no write access,
 but still makes sense to exit if that happens, don't ya?

 Confirmed that it indeed blocks forever. Is the patch fine btw?

-- 
Ticket URL: <http://www.pulseaudio.org/ticket/333>
PulseAudio <http://pulseaudio.org/>
The PulseAudio Sound Server


More information about the pulseaudio-bugs mailing list