Opened 15 years ago

Closed 15 years ago

#4112 closed bug (fixed)

Thread exit seems to not be correctly handled.

Reported by: bga Owned by: bonefish
Priority: normal Milestone: R1
Component: Applications/Debugger Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

I have this program that has a main thread that sits waiting for connections. When it receives a connection it spawns 2 threads. During the lifetime of the program, one of those threads can die but the second one would still be running but the thread list view on Debugger removes the entry related to the thread that died but the other thread entry is emptied out (i.e. it is there but only as a blank line). because of this it is not possible to debug this other thread anymore after the first one died. I can provide the source code if needed.

Attachments (1)

test.cpp (2.0 KB ) - added by bga 15 years ago.
Example code.

Download all attachments as: .zip

Change History (6)

comment:1 by bonefish, 15 years ago

A sample to reproduces the problem would be appreciated.

by bga, 15 years ago

Attachment: test.cpp added

Example code.

comment:2 by bga, 15 years ago

Code added. Don't pay too much attention to it as it is simply a proof of concept and has at least one major bug (which is intentional, I was testing how the debug would react to crashes) which is the fact that when the thread exists it closes the BNetEndpoint and deletes it and the ping thread tries to send a packet through it.

Anyway, compile it with "gcc -O0 -g test.cpp -lbnetapi", start it with the debugger and in a different termonal do "telnet 127.0.0.1 8080" then use ] to enter command mode (in the telnet session) and type quit to close the session. At this point, what I described will happen.

BTW, I am impressed by how far the Debugger is. Congratulations.

comment:3 by bga, 15 years ago

Hmmmm... It seems the caret (control) character is special for Trac. I meant to say CTRL + ] to enter command mode.

comment:4 by anevilyak, 15 years ago

If it helps, I see a similar problem when the app being debugged exits, i.e. if I start up Vision in the debugger, have it connect to a network and then exit, the threads view has a bunch of empty phantom rows after the app is gone (and also as the threads go away).

comment:5 by bonefish, 15 years ago

Resolution: fixed
Status: newclosed

Haven't tried the attached test program, but the bug should be fixed in hrev33539.

Note: See TracTickets for help on using tickets.