realfree () related to new operator

V

Vinu

I have one problem related to new operator, when the following line is
execute then Segmentation fault occurs. std::wstring
lastConjunction(L"OMIT");

Program received signal SIGSEGV, Segmentation fault 0xff04237c in
realfree () from /usr/lib/libc.so.1

(gdb) backtrace
#0 0xff04237c in realfree () from /usr/lib/libc.so.1
#1 0xff042cb8 in cleanfree () from /usr/lib/libc.so.1
#2 0xff041dec in _malloc_unlocked () from /usr/lib/libc.so.1
#3 0xff041ce0 in malloc () from /usr/lib/libc.so.1
#4 0xff1bb708 in operator new (sz=32) at
/stf/users/ann/gcc-3.4.2/libstdc
#5 0xff1b4b58 in std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::all
__capacity=4, __old_capacity=0, __alloc=@0xffbef8f8) at
new_allocator.h:81
#6 0xff1b6cf8 in std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::all
*> (__beg=0xff2ff120, __end=0xff2ff130, __a=@0xffbef8f8) at
basic_string.tcc:147
#7 0xff1b6dc8 in basic_string (this=0xffbef908, __s=0xff2ff120,
__a=@0xffbef8f8
#8 0xff2c0bf4 in Ete::RemoImp::Search (this=0x21fb8,) at
Remo_aw.cpp:113
#9 0x000112ec in main () at Crog_aw.cpp:103

Thanks,
Vinu
 
?

=?ISO-8859-1?Q?Stefan_N=E4we?=

Vinu said:
I have one problem related to new operator, when the following line is
execute then Segmentation fault occurs. std::wstring
lastConjunction(L"OMIT");

Program received signal SIGSEGV, Segmentation fault 0xff04237c in
realfree () from /usr/lib/libc.so.1

(gdb) backtrace
#0 0xff04237c in realfree () from /usr/lib/libc.so.1
#1 0xff042cb8 in cleanfree () from /usr/lib/libc.so.1
#2 0xff041dec in _malloc_unlocked () from /usr/lib/libc.so.1
#3 0xff041ce0 in malloc () from /usr/lib/libc.so.1
#4 0xff1bb708 in operator new (sz=32) at
/stf/users/ann/gcc-3.4.2/libstdc
#5 0xff1b4b58 in std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::all
__capacity=4, __old_capacity=0, __alloc=@0xffbef8f8) at
new_allocator.h:81
#6 0xff1b6cf8 in std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::all
*> (__beg=0xff2ff120, __end=0xff2ff130, __a=@0xffbef8f8) at
basic_string.tcc:147
#7 0xff1b6dc8 in basic_string (this=0xffbef908, __s=0xff2ff120,
__a=@0xffbef8f8
#8 0xff2c0bf4 in Ete::RemoImp::Search (this=0x21fb8,) at
Remo_aw.cpp:113
#9 0x000112ec in main () at Crog_aw.cpp:103

Thanks,
Vinu

Please, Please, Please don't show us enough of your code
so that we can actually help you!

/S.
 
B

Bryan Donlan

Vinu said:
I have one problem related to new operator, when the following line is
execute then Segmentation fault occurs. std::wstring
lastConjunction(L"OMIT");

Program received signal SIGSEGV, Segmentation fault 0xff04237c in
realfree () from /usr/lib/libc.so.1

(gdb) backtrace
#0 0xff04237c in realfree () from /usr/lib/libc.so.1
#1 0xff042cb8 in cleanfree () from /usr/lib/libc.so.1
#2 0xff041dec in _malloc_unlocked () from /usr/lib/libc.so.1
#3 0xff041ce0 in malloc () from /usr/lib/libc.so.1
#4 0xff1bb708 in operator new (sz=32) at
/stf/users/ann/gcc-3.4.2/libstdc
#5 0xff1b4b58 in std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::all
__capacity=4, __old_capacity=0, __alloc=@0xffbef8f8) at
new_allocator.h:81
#6 0xff1b6cf8 in std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::all
*> (__beg=0xff2ff120, __end=0xff2ff130, __a=@0xffbef8f8) at
basic_string.tcc:147
#7 0xff1b6dc8 in basic_string (this=0xffbef908, __s=0xff2ff120,
__a=@0xffbef8f8
#8 0xff2c0bf4 in Ete::RemoImp::Search (this=0x21fb8,) at
Remo_aw.cpp:113
#9 0x000112ec in main () at Crog_aw.cpp:103

Thanks,
Vinu

You've corrupted your malloc heap somehow - probably by writing beyond the
ends of a buffer, writing to unallocated memory, or freeing something that
doesn't exist. The problem could be just about anywhere in your code,
however. If you're on an x86 platform, valgrind may help track down the
location of the problem.
 
M

Markus Becker

Stefan Näwe said:
Please, Please, Please don't show us enough of your code
so that we can actually help you!

And, while we're at it: Never, ever ask the question you want to
have answered.

Markus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,059
Members
48,769
Latest member
Clifft

Latest Threads

Top