|
From: Stephen T. <st...@to...> - 2005-03-15 19:43:16
|
I have the follow message from memcheck.
==32005==
==32005== Conditional jump or move depends on uninitialised value(s)
==32005== at 0x1BE5920A: std::string::~string() (basic_string.h:226)
==32005== by 0x1BC54534:
kurt::data_types::Single_Hash<std::string>::operator()(std::string)
const (Tables_T.hpp:58)
==32005== by 0x1BC540E9: __gnu_cxx::hashtable<std::pair<std::string
const, std::string>, std::string,
kurt::data_types::Single_Hash<std::string>,
std::_Select1st<std::pair<std::string const, std::string> >,
std::equal_to<std::string>, std::allocator<std::string>
>::_M_bkt_num_key(std::string const&, unsigned) const(hashtable.h:518)
==32005== by 0x1BC53843: __gnu_cxx::hashtable<std::pair<std::string
const, std::string>, std::string,
kurt::data_types::Single_Hash<std::string>,
std::_Select1st<std::pair<std::string const, std::string> >,
std::equal_to<std::string>, std::allocator<std::string>
>::_M_bkt_num_key(std::string const&) const (hashtable.h:508)
I don't understand what is wrong with the following code:
size_t operator() (Key_Type val) const
{
std::stringstream input;
input << val;
std::string textstring = input.str();
const char* textcharstring = textstring.c_str();
size_t hash_val = __gnu_cxx::__stl_hash_string(textcharstring);
return hash_val; << Error: Line 58 - Tables_T.hpp
}
What is up with the std::string destructor?
Stephen
|
|
From: Jeremy F. <je...@go...> - 2005-03-15 20:08:22
|
Stephen Torri wrote:
>What is up with the std::string destructor?
>
>
Hard to say. I presume it is destructing textstring? Is val defined?
Try including <valgrind/memcheck.h> and doing
VALGRIND_CHECK_DEFINED(val) (though this depends on what val actually
is, and whether its valid to check every byte in the range [&val,
&val+1) for definedness.
(If you can convince your mailer not to wrap these messages when posting
them, that would be nice.)
J
|
|
From: Stephen T. <st...@to...> - 2005-03-15 21:38:11
|
On Tue, 2005-03-15 at 12:08 -0800, Jeremy Fitzhardinge wrote:
> Stephen Torri wrote:
>
> >What is up with the std::string destructor?
> >
> >
> Hard to say. I presume it is destructing textstring? Is val defined?
> Try including <valgrind/memcheck.h> and doing
> VALGRIND_CHECK_DEFINED(val) (though this depends on what val actually
> is, and whether its valid to check every byte in the range [&val,
> &val+1) for definedness.
Where I believe I am using it val is of type 'std::string'.
Here is what val is reported by gdb
(gdb) print val
$2 = {static npos = 4294967295,
_M_dataplus = {<std::allocator<char>> =
{<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data
fields>}, _M_p = 0x1bfe0494 "pid"}}
> (If you can convince your mailer not to wrap these messages when posting
> them, that would be nice.)
If you know how to make Evolution do it I am all ears.
Stephen
|
|
From: Bryan O'S. <bo...@se...> - 2005-03-15 21:46:08
|
On Tue, 2005-03-15 at 16:38 -0500, Stephen Torri wrote: > If you know how to make Evolution do it I am all ears. Change the paragraph type from "Normal" to "Preformat". <b |
|
From: Kjartan M. <km...@br...> - 2005-03-15 21:51:45
|
tir, 15,.03.2005 kl. 16.38 -0500, skrev Stephen Torri:
> On Tue, 2005-03-15 at 12:08 -0800, Jeremy Fitzhardinge wrote:
> > Stephen Torri wrote:
> >
> > >What is up with the std::string destructor?
> > >
> > >
> > Hard to say. I presume it is destructing textstring? Is val defined?
> > Try including <valgrind/memcheck.h> and doing
> > VALGRIND_CHECK_DEFINED(val) (though this depends on what val actually
> > is, and whether its valid to check every byte in the range [&val,
> > &val+1) for definedness.
>
> Where I believe I am using it val is of type 'std::string'.
>
> Here is what val is reported by gdb
>
> (gdb) print val
> $2 = {static npos = 4294967295,
> _M_dataplus = {<std::allocator<char>> =
> {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data
> fields>}, _M_p = 0x1bfe0494 "pid"}}
>
>
> > (If you can convince your mailer not to wrap these messages when posting
> > them, that would be nice.)
>
> If you know how to make Evolution do it I am all ears.
>
Set the style to "Preformat" when pasting output from valgrind or
anything else that is longer than linewidth.
Cheers
Kjartan
|
|
From: Stephen T. <st...@to...> - 2005-03-15 22:09:04
|
On Tue, 2005-03-15 at 22:51 +0100, Kjartan Maraas wrote: > > > (If you can convince your mailer not to wrap these messages when posting > > > them, that would be nice.) > > > > If you know how to make Evolution do it I am all ears. > > > Set the style to "Preformat" when pasting output from valgrind or > anything else that is longer than linewidth. Thanks. Stephen |