Opened 16 years ago

Closed 16 years ago

#2048 closed bug (invalid)

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: Blocking: #2999
Platform: All

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 (5)

comment:1 by mmadia, 16 years ago

the observed behavior: im_server fails to load any protocols.

comment:2 by jackburton, 16 years ago

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

comment:3 by mmu_man, 16 years ago

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).

comment:4 by axeld, 16 years ago

Resolution: invalid
Status: newclosed

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.

comment:5 by axeld, 15 years ago

Blocking: 2999 added

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

Note: See TracTickets for help on using tickets.