bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TCPStream bug ??


From: Pierre Bacquet
Subject: TCPStream bug ??
Date: Mon, 6 Aug 2001 17:24:04 +0200

Hello,

I am using CommonC++ version 1.5.0 on a Solaris box with gcc, wiz .

% uname -a
SunOS neptune 5.6 Generic_105181-12 sun4m sparc SUNW,SPARCstation-5

% gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.3/specs
gcc version 2.95.3 20010315 (release)

I have tried the TCP stream class with a C++ client (using CommonC++) trying
to connect
to a C++ (actually old C code but in a .cpp file) server (using BSD sockets
just to see where
can be the problem). The client + server + Makefile are attached to this
mail.

The client connects to the server, send it a string using << operator and
expects a string
back from the server using getline method. The client core dumps when using
any *input*
mechanism (i.e. getline or >> operator). See traces of execution from 2
differents windows :

% ./server -d
Ready to accept new connections
Received incoming connection from 127.0.0.1 port 34911
Hello world

Getline returned 0, Error 0 (0)

% ./client
Connected to server
Illegal instruction (core dumped)

As can be seen, the client has managed to send its string but failed
aftewards. If I run the client
under xxgdb, here is the call stack :

Program received signal SIGILL, Illegal instruction.
0x5cb68 in ?? ()
(xxgdb) info stack
#0  0x5cb68 in ?? ()
#1  0x29adc in __uflow (fp=0xeffff780) at genops.c:295
#2  0x3066c in _IO_getc (fp=0xeffff780) at iogetc.c:39
#3  0x3fea0 in streambuf::sbumpc (this=0xeffff780) at streambuf.h:396
#4  0x39638 in istream & istream::getline<char, string_char_traits<char>,
__default_alloc_template<false, 0> > (address@hidden, address@hidden,
delim=10 '\n') at
/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.3/../../../../include/g++-3
/std/bastring.cc:485
#5  0x28eec in main (argc=1, argv=0xeffff92c) at client.cpp:86

Have I done something wrong or has someone run into that bug ??

Best regards,

Pierre Bacquet,
Delta Partners.


Attachment: SockSample.tar.gz
Description: GNU Zip compressed data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]