[haiku-bugs] Re: [Haiku] #12286: Menus seem to be leaking ports

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Thu, 06 Aug 2015 10:03:01 -0000

#12286: Menus seem to be leaking ports
----------------------------------+----------------------------
Reporter: ttcoder | Owner: axeld
Type: bug | Status: new
Priority: high | Milestone: R1/beta1
Component: Kits/Interface Kit | Version: R1/Development
Resolution: | Keywords:
Blocked By: | Blocking:
Has a Patch: 0 | Platform: All
----------------------------------+----------------------------

Comment (by bonefish):

Not sure whether this is a good idea (and/or BeOS compatible), but
`listport` (i.e. `get_next_port_info()`) omits closed ports. So, you may
get:
{{{
$ listport 532
port: total: 4096, used: 176, left: 3920

TEAM 532 (/boot/system/apps/Terminal):
ID name capacity queued
----------------------------------------------------
352 rAppLooperPort 100 0
354 tmp_rport1 1 0
355 tmp_rport2 1 0
357 a<app_server 100 0
358 a<532:x-vnd.Haiku-Terminal 50 0
359 200 0
360 w<app_server 200 1
353 tmp_rport0 1 0
}}}

but the kernel debugger command will show them all:

{{{
kdebug> ports 532
port id cap read-cnt write-cnt total team name
0xd1223e60 352 100 0 100 4 532
rAppLooperPort
0xd12235a0 353 1 0 1 2247 532 tmp_rport0
0xd1223460 354 1 0 1 0 532 tmp_rport1
0xd12233c0 355 1 0 1 0 532 tmp_rport2
0xd1223280 357 100 0 100 584 532 a<app_server
0xd12231e0 358 50 0 50 594 532 a<532:x-vnd
.Haiku-Terminal
0xd12230a0 359 200 0 200 13465 532
0xd1223000 360 200 0 200 3283 532 w<app_server
0xce4d3ab0 385 0 2 198 7 532 mbar cached
menu
0xce4d38d0 388 0 1 199 7 532 mbar cached
menu
0xce4d3830 391 0 2 198 11 532 mbar cached
menu
0xce4d36f0 394 0 2 198 30 532 mbar cached
menu
0xce4d3290 397 0 2 198 7 532 mbar cached
menu
0xce6883c8 400 0 2 198 6 532 mbar cached
menu
0xce4d3470 403 0 2 198 7 532 mbar cached
menu
0xce688148 406 0 2 198 7 532 mbar cached
menu
0xd1256dd8 409 0 2 198 7 532 mbar cached
menu
0xd1256e78 412 0 2 198 6 532 mbar cached
menu
}}}

Capacity 0 means closed.

So, indeed it appears like the menu code leaks (closed) ports. FWIW, I
have an old hrev48150 gcc4-only image lying around, which doesn't show the
issue.

--
Ticket URL: <https://dev.haiku-os.org/ticket/12286#comment:10>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: