bug-gplusplus
[Top][All Lists]
Advanced

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

hang in ostrstream::operator<<(int n)


From: Geoff Alexander
Subject: hang in ostrstream::operator<<(int n)
Date: 14 Jan 2002 19:07:23 -0800

I have a C++ program which sometimes hangs (fairly infrequently) in
ostrstream::operator<<(int n) when debugging under DDD 3.2.1/GDB 5.0
with the following stack trace:

  (gdb) where
  #0  0x40121b7e in __backtrace_symbols (array=0xbfffe9d0, size=0) at
./sysdeps/generic/elf/backtracesyms.c:78
  #1  0x401e1718 in ?? ()
  #2  0x405782d0 in __pthread_wait_for_restart_signal
(self=0x40580260) at pthread.c:793
  #3  0x4057985e in __pthread_lock (lock=0x8060bc8, self=0x40580260)at
restart.h:26
  #4  0x40576cd2 in __pthread_mutex_lock (mutex=0x8060bb8) at
mutex.c:85
  #5  0x40579122 in __flockfile (stream=0xbfffeb64) at lockfile.c:32
  #6  0x405a0d94 in ostream::operator<< (this=0xbfffec04, n=403) at
iostream.h:53
  #7  0x4025f633 in ModCmvc::StringUtilities::intToString (num=403) at
/projects/cmvcdev/bld/mod_cmvc/latest/src/mod_cmvc/StringUtilities.cpp:21
  #8  0x4025dc83 in ModCmvc::Request::setResponseStatusCode
(this=0xbfffed44, statusCode=403) at
/projects/cmvcdev/dev/geoff/sb/4860/src/mod_cmvc/Request.cpp:633
  #9  0x4025cec4 in ModCmvc::Request::sendErrorResponse
(this=0xbfffed44, statusCode=403, address@hidden) at
/projects/cmvcdev/dev/geoff/sb/4860/src/mod_cmvc/Request.cpp:500
  #10 0x40254963 in ModCmvc::ModCmvcMain::responseHandler
(r=0x806844c) at 
/projects/cmvcdev/dev/geoff/sb/4860/src/mod_cmvc/ModCmvcMain.cpp:433
  #11 0x40048509 in ap_invoke_handler (r=0x806844c) at
http_config.c:517
  #12 0x40060413 in process_request_internal (r=0x806844c) at
http_request.c:1307
  #13 0x40060491 in ap_process_request (r=0x806844c) at
http_request.c:1323
  #14 0x40055f53 in child_main (child_num_arg=0) at http_main.c:4209
  #15 0x4005613f in make_child (s=0x804b974, slot=0, now=1011038813)
at http_main.c:4313
  #16 0x400562f7 in startup_children (number_to_start=5) at
http_main.c:4395
  #17 0x40056a70 in standalone_main (argc=2, argv=0xbffff004) at
http_main.c:4683
  #18 0x4005749b in ap_main (argc=2, argv=0xbffff004) at
http_main.c:5010
  #19 0x8048713 in ?? ()
  #20 0x4011ba8e in hol_entry_help (entry=0x80486f0, state=0x2,
stream=0xbffff004, hhstate=0x8048554) at argp-fmtstream.h:230

The code for StringUtilities::intToString() is

  // This method converts int to string and returns string
  string ModCmvc::StringUtilities::intToString(int num)
  {
    ostrstream intStream;
    intStream << num << ends;
    string intAsString = intStream.str();
    return intAsString;
  }

The code is compiled using gcc 2.95.2 on SuSE Linux 7.0 for x386.  Is
this a known problem or is there something wrong with my code?

Thanks,
Geoff Alexander, Ph.D.
919/254-5216 T/L 444-5216
CMVC95 WebDAV Development
IBM Corporation
RTP, NC



reply via email to

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