I successfully compiled the latest iftop on openbsd 3.4 (installed yesterday from the current /snapshot/i386/ openbsd directory)
It seems to work except once loaded I cant stop it with "q" like I can in linux, and I cant ctrl-C or ctrl-X it or anything it keeps running, I have to open a new bash shell and kill -9 its pid
Anyone use iftop on openbsd with no probs?
On Thu, Aug 28, 2003 at 01:54:38PM -0700, Michael wrote:
I successfully compiled the latest iftop on openbsd 3.4 (installed yesterday from the current /snapshot/i386/ openbsd directory)
It seems to work except once loaded I cant stop it with "q" like I can in linux, and I cant ctrl-C or ctrl-X it or anything it keeps running, I have to open a new bash shell and kill -9 its pid
Anyone use iftop on openbsd with no probs?
I'm not ignoring this, I just don't know the answer :-(
After you press "q" does it keep on running to the extent that you can still press keys and have them do stuff?
My guess is that it's a difference in the handling of threads (is that vague enough?), and the stuff that makes is quit is <blame-torch action="pass">stuff that Chris wrote</blame-torch>
Paul
On Fri, Aug 29, 2003 at 04:51:53PM +0100, Paul Warren wrote:
On Thu, Aug 28, 2003 at 01:54:38PM -0700, Michael wrote:
I successfully compiled the latest iftop on openbsd 3.4 (installed yesterday from the current /snapshot/i386/ openbsd directory)
It seems to work except once loaded I cant stop it with "q" like I can in linux, and I cant ctrl-C or ctrl-X it or anything it keeps running, I have to open a new bash shell and kill -9 its pid
[...]
My guess is that it's a difference in the handling of threads (is that vague enough?), and the stuff that makes is quit is <blame-torch action="pass">stuff that Chris wrote</blame-torch>
*groan*
I wonder if OpenBSD runs under VMWare yet? Alternatively, would one of you security-conscious OpenBSD people like to give me root access to your machine? (No, I didn't think so.)
On Fri, Aug 29, 2003 at 04:54:11PM +0100, Chris Lightfoot wrote:
On Fri, Aug 29, 2003 at 04:51:53PM +0100, Paul Warren wrote:
On Thu, Aug 28, 2003 at 01:54:38PM -0700, Michael wrote:
I successfully compiled the latest iftop on openbsd 3.4 (installed yesterday from the current /snapshot/i386/ openbsd directory)
It seems to work except once loaded I cant stop it with "q" like I can in linux, and I cant ctrl-C or ctrl-X it or anything it keeps running, I have to open a new bash shell and kill -9 its pid
[...]
My guess is that it's a difference in the handling of threads (is that vague enough?), and the stuff that makes is quit is <blame-torch action="pass">stuff that Chris wrote</blame-torch>
*groan*
I wonder if OpenBSD runs under VMWare yet? Alternatively, would one of you security-conscious OpenBSD people like to give me root access to your machine? (No, I didn't think so.)
At a quick guess, I'd say that pcap_loop doesn't call any thread cancellation points, so it hangs on pthread_cancel.
Paul
On Fri, Aug 29, 2003 at 05:07:29PM +0100, Paul Warren wrote:
On Fri, Aug 29, 2003 at 04:54:11PM +0100, Chris Lightfoot wrote:
My guess is that it's a difference in the handling of threads (is that vague enough?), and the stuff that makes is quit is <blame-torch action="pass">stuff that Chris wrote</blame-torch>
[...]
At a quick guess, I'd say that pcap_loop doesn't call any thread cancellation points, so it hangs on pthread_cancel.
Ah, that's a good point. That said, I'm surprised that quitting works on Mac OS X if that's the problem....
Try this patch: (not absolutely certain about the second parameter to pcap_dispatch; try 1 if -1 doesn't work)
diff -u -r1.44 iftop.c --- iftop.c 2003/05/20 21:14:37 1.44 +++ iftop.c 2003/08/29 16:10:06 @@ -528,7 +528,9 @@ /* packet_loop: * Worker function for packet capture thread. */ void packet_loop(void* ptr) { - pcap_loop(pd,-1,(pcap_handler)packet_handler,NULL); + /* Make sure that this thread is cancellable. */ + while (pcap_dispatch(p, -1, (pcap_handler)packet_handler, NULL) != -1) + pcap_testcancel(); }
(I should say that I don't recall being the one to put the PCAP stuff in a thread. I have a horror of threads anyway....)
On Fri, Aug 29, 2003 at 05:13:02PM +0100, Chris Lightfoot wrote:
On Fri, Aug 29, 2003 at 05:07:29PM +0100, Paul Warren wrote:
On Fri, Aug 29, 2003 at 04:54:11PM +0100, Chris Lightfoot wrote:
My guess is that it's a difference in the handling of threads (is that vague enough?), and the stuff that makes is quit is <blame-torch action="pass">stuff that Chris wrote</blame-torch>
[...]
At a quick guess, I'd say that pcap_loop doesn't call any thread cancellation points, so it hangs on pthread_cancel.
Ah, that's a good point. That said, I'm surprised that quitting works on Mac OS X if that's the problem....
Try this patch: (not absolutely certain about the second parameter to pcap_dispatch; try 1 if -1 doesn't work)
diff -u -r1.44 iftop.c --- iftop.c 2003/05/20 21:14:37 1.44 +++ iftop.c 2003/08/29 16:10:06 @@ -528,7 +528,9 @@ /* packet_loop:
- Worker function for packet capture thread. */
void packet_loop(void* ptr) {
- pcap_loop(pd,-1,(pcap_handler)packet_handler,NULL);
- /* Make sure that this thread is cancellable. */
- while (pcap_dispatch(p, -1, (pcap_handler)packet_handler, NULL) != -1)
pcap_testcancel();
}
ITYM pthread_testcancel, and that'll nead the thread handle.
(I should say that I don't recall being the one to put the PCAP stuff in a thread. I have a horror of threads anyway....)
No. I don't understand threads, but I managed to figure out just enough to get them to start in different threads. Obviously, I couldn't then figure out how to make the stop again - you fixed that bit, and therefore claim ownership of that functionality ;-) It may be far less broken than when you first touched it, but you were the last one to touch it...
Paul
On Fri, Aug 29, 2003 at 05:26:45PM +0100, Paul Warren wrote:
On Fri, Aug 29, 2003 at 05:13:02PM +0100, Chris Lightfoot wrote:
Try this patch: (not absolutely certain about the second parameter to pcap_dispatch; try 1 if -1 doesn't work)
diff -u -r1.44 iftop.c --- iftop.c 2003/05/20 21:14:37 1.44 +++ iftop.c 2003/08/29 16:10:06 @@ -528,7 +528,9 @@ /* packet_loop:
- Worker function for packet capture thread. */
void packet_loop(void* ptr) {
- pcap_loop(pd,-1,(pcap_handler)packet_handler,NULL);
- /* Make sure that this thread is cancellable. */
- while (pcap_dispatch(p, -1, (pcap_handler)packet_handler, NULL) != -1)
pcap_testcancel();
}
ITYM pthread_testcancel,
yes
and that'll nead the thread handle.
no, in fact.
(I should say that I don't recall being the one to put the PCAP stuff in a thread. I have a horror of threads anyway....)
No. I don't understand threads, but I managed to figure out just enough to get them to start in different threads. Obviously, I couldn't then figure out how to make the stop again - you fixed that bit, and therefore claim ownership of that functionality ;-) It may be far less broken than when you first touched it, but you were the last one to touch it...
gah. ok, fair enough.