[haiku-bugs] Re: [Haiku] #5076: cat /dev/urandom hangs the terminal after a while

  • From: "jackburton" <trac@xxxxxxxxxxxx>
  • Date: Mon, 07 Jun 2010 09:35:34 -0000

#5076: cat /dev/urandom hangs the terminal after a while
-----------------------------------+----------------------------------------
 Reporter:  jackburton             |       Owner:  jackburton    
     Type:  bug                    |      Status:  new           
 Priority:  normal                 |   Milestone:  R1            
Component:  Applications/Terminal  |     Version:  R1/Development
 Keywords:  gcc4 hybrid            |    Platform:  All           
Blockedby:                         |       Patch:  0             
 Blocking:                         |  
-----------------------------------+----------------------------------------

Comment(by jackburton):

 Replying to [comment:3 bonefish]:
 > Replying to [comment:2 jackburton]:
 > > Replying to [comment:1 diver]:
 > > > http://dev.haiku-os.org/ticket/2851#comment:10 could be related?
 > >
 > > Absolutely.
 > > Should we decouple writing from that thread, Ingo ? (by passing the
 data to another thread which does the real writing?)
 >
 > I don't think this would help at all. I believe the main problem is that
 no one reads from the slave end of the TTY, so that its buffer runs full
 eventually. Moving the writing to another thread would at best delay the
 hang as long as it takes for the Terminal's internal write buffer to run
 full as well. The only option I see is to drop the writes, i.e. use non-
 blocking I/O. This would also solve the second issue, that in echo mode
 writes from the Terminal are echoed back to the TTY master, whose buffer
 could already be full.
 >

 Looking at the linux tty layer I found that they expose a reduced
 available buffer to the tty drivers, so that there is always enough room
 to handle cases like this.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/5076#comment:8>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: