[haiku-bugs] Re: [Haiku] #5790: panic: out of ports, but sUsedPorts is broken

  • From: "axeld" <trac@xxxxxxxxxxxx>
  • Date: Thu, 29 Apr 2010 06:34:56 -0000

#5790: panic: out of ports, but sUsedPorts is broken
---------------------------+------------------------------------------------
 Reporter:  mmlr           |       Owner:  axeld         
     Type:  bug            |      Status:  new           
 Priority:  normal         |   Milestone:  R1            
Component:  System/Kernel  |     Version:  R1/Development
 Keywords:                 |   Blockedby:                
 Platform:  All            |    Blocking:                
---------------------------+------------------------------------------------

Comment(by axeld):

 The port ID computation is actually pretty stupid, and can advance
 rapidly:
 {{{
         // make the port_id be a multiple of the slot it's in
         if (i >= sNextPort % sMaxPorts)
                 sNextPort += i - sNextPort % sMaxPorts;
         else
                 sNextPort += sMaxPorts - (sNextPort % sMaxPorts - i);
 }}}
 Still, the code looks reasonably safe to overflows, so I think sUsedPorts
 is actually broken.

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

Other related posts: