Ticket #2048 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

get_team_info() does not work properly

Reported by: mmadia Owned by: axeld
Priority: normal Milestone: R1
Component: - General Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Platform: All
Blocking: #2999

Description

the function get_team_info() is used by im_kit's im_server, specifically in Server::UnloadAddons()

im_kit's svn:  http://www.beclan.org/svn/repos/imkit/server/im_server.cpp code snippet:

while (info.thread_count > (protoCount + 1)) {

get_team_info(info.team, &info); snooze(20000);

}

Change History

Changed 2 years ago by mmadia

the observed behavior: im_server fails to load any protocols.

Changed 2 years ago by jackburton

Did you test if the preceding code breaks correctly when (or, if, at all) it finds the im_server (on haiku) ?

Changed 2 years ago by mmu_man

Note the code preceding it is incorrect (it searches for name ending with im_server), as "strace im_server" would come first in the process list. But fixing it still showed a wrong behaviour (it returned 6 while there was still only 1 thread last I tested). I worked around in the version I have, an tried to make a test case, but they seemed to work ok (before spawning a thread, after, after terminating it, ... seems consistent).

Changed 2 years ago by axeld

  • status changed from new to closed
  • resolution set to invalid

Are you sure the problem is get_team_info()? It really doesn't look like this is the case. num_threads seems to be correctly maintained, as does the team_info::id field.

Besides, this code looks broken to me, anyway, as it makes assumptions on the number of running threads that it cannot possibly know as it's implementation dependent - please fix your app.

Changed 17 months ago by axeld

  • blocking 2999 added

(In #2999) No need to, I just mark this as a duplicate.

Note: See TracTickets for help on using tickets.