[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: TCPProblem -- more info -- short program that hangs included
From: |
Chad Yates |
Subject: |
RE: TCPProblem -- more info -- short program that hangs included |
Date: |
Fri, 07 Feb 2003 13:07:03 -0800 |
Don't know what your problem is, but I've converted your test routine to a
testcase of a TCPStream test fixture. It seems to run fine under
msvc++6.0/win32 I originally had the loop terminate after 1000 reps
(instead of infinity), but have moved it down to 50 in the provided code.
attached is a zip file with the sourcefiles, and a new msvc++ project file.
the last msvc project file I sent for the test suite didn't seem to get the
references to the source files (my bad, I think I sent the wrong version
when i was cleaning things up), so unless someone has made changes to the
.dsp file, I'd recommend replacing it with this version.
,chad
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden Behalf Of
> Alex Pavloff
> Sent: Friday, February 07, 2003 11:59 AM
> To: 'address@hidden'
> Subject: TCPProblem -- more info -- short program that hangs included
>
>
>
> Here is a sample program that duplicates the problems I described
> yesterday.
> What's going on here? Is it CC++ that's broken or gcc? Would
> other people
> try this and see what the result is? It appears that after 32 or
> 33 quickly
> repeated call to isPending(), something breaks horribly.
>
>
> #include <cc++/socket.h>
>
> int main()
> {
> try
> {
> // Just connect to a port that won't send data -- doesn't
> matter what
> ost::TCPStream foo("10.0.0.5",5800,512,true,100);
> for( ; ; )
> {
> while( foo.isPending(ost::Socket::pendingInput,100)
> );
> }
> }
> catch( ost::Socket* s )
> {
> std::cout << "Socket error" << std::endl;
> }
> return 0;
> }
>
> Here is the GDB backtrace. Notice how the this pointer got completely
> clobbered
> resulting in a massively large value being passed to poll(),
> which causes
> the hang
> but what causes the clobbering in the first place?
>
> (gdb) bt
> #0 0x420d224b in poll () from /lib/i686/libc.so.6
> #1 0x4004436f in ost::Socket::isPending(ost::Socket::Pending, unsigned
> long) (
> this=0xfffffffc, pending=53, timeout=3221222896) at socket.cpp:502
> #2 0x400466bc in ost::TCPStream::isPending(ost::Socket::Pending, unsigned
> long) (this=0xbffff670, pending=pendingInput, timeout=100) at
> socket.cpp:1158
> #3 0x0804903e in main () at cute.cpp:12
> #4 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6
>
>
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp
Test_TCPStream.zip
Description: Zip compressed data