RE: Migration from RWTools to string - problems [newbie]

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

 



Are you attempting to modify the strings using the pointer returned by
c_str()?  If so, DON'T!  Otherwise, normally, calling c_str() several
times should not cause a memory leak or cause your program to crash.
Have you tried looking at the stack trace to see where it is crashing?

Thanks,
Lyle Taylor

-----Original Message-----
From: Krzysztof.Wisniowski@xxxxxxxxxxx
[mailto:Krzysztof.Wisniowski@xxxxxxxxxxx] 
Sent: Monday, September 29, 2003 9:06 AM
To: gcc-help@xxxxxxxxxxx
Subject: Migration from RWTools to string - problems [newbie]

Hi all,

	I am trying to adapt a code which uses Rogue Wave libraries for
string manipulation, to use std::string. So far I have managed to
compile
and link the program with little modifications in the source code,
mostly by
replacing the .data() with .c_str() method. The main program consists of
the
for() loop which iterates through the file list, and applies some
calculations to the files data. After the changes I've made the program
completes only one full loop run, the second run almost always ends up
with
"Bus error" or "out of memory" error, all in the random places of the
loop.
Does anyone know if std::string might not entirely free the used
resources,
or do I have to look for something else to blame?
I am looking for some function to display the free memory, perhaps that
would give me any idea what goes wrong in the program, unfortunately I
cannot find any. Can you give me some hints?
I am working on SunOS 5.8 with gcc++ 2.95.3.

Thanks,
Krzysztof

-- 
Krzysztof Wisniowski   | Siemens Sp. z o.o.
ICM N&S SDC NE 3       | Software Design Center
Phone: +48 71 799 2403 | 54A Strzegomska Str.
Fax: +48 71 799 2320   | 53-611 Wroclaw POLAND


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux