By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,571 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,571 IT Pros & Developers. It's quick & easy.

std::basic_string<wchar_t>: segmentation fault while accessing any member functions

P: n/a
have a type given by:

typedef std::basic_string<wchar_t> mystringtype;

at one instacne of my program, i have a vairable called 'abc' of type
mystringtype. When i try to access the .c_str() or even .length()
functions, I get a segmentation fault. Is there a way to check what
exists in 'abc' because it's definitely holding something .. though
looks like some corrupt memory address ..

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Thu, 21 Jul 2005 11:45:13 +0400, mufasa <so*****@gmail.com> wrote:
have a type given by:

typedef std::basic_string<wchar_t> mystringtype;

at one instacne of my program, i have a vairable called 'abc' of type
mystringtype. When i try to access the .c_str() or even .length()
functions, I get a segmentation fault.
Probably, you overwrited the memory used by the string.
Is there a way to check what
exists in 'abc' because it's definitely holding something .. though
looks like some corrupt memory address ..


Yes, use a debugger or dump the string's binary representation. Having
checked up the string implementation you can then map the binary dump with
string's members.

--
Maxim Yegorushkin
<fi****************@gmail.com>
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.