I tried this on Ubuntu 14.04 with address sanitizer enabled and it did not find
any problems. You might try putting log_trace/log_debug statements in the
string functions to trace the flow. Alternately, you can use gdb to set
breakpoints and step through the code until it crashes. Could be a library
difference or locale/Unicode settings for the OS.
Steve
From: Raphael Fuchs [mailto:[email protected]]
Sent: Friday, February 6, 2015 3:11 AM
To: Steve Gieseking
Cc: [email protected]
Subject: Re: [Tntnet-general] cxxtools: base64-test, binaryTest()
Hi Steve,
I am searching for a simmilar issue, where the following main crashes when
compiled with Solaris Studio, but not with GCC or clang:
int main(int, char**)
{
cxxtools::String s;
s = "lorem ipsum dolur 1234567890 1234567890 1234567890 1234567890";
return 0;
}
The version I am debugging, is very much stripped down, with only char and
string included, and the short string functionality removed from the string:
src/main.cpp
src/char.cpp
src/string.cpp
I am clueless on where the issues could come from since I could not get leads
from valgrind. I will try to check this with address-sanitizer as well. Do you
have any Ideas how this happens?
Cheers
Raphael
PS: this is the repo with the stripped down version
https://bitbucket.org/Farmion/cxxtools-suncc
2015-02-05 20:57 GMT+01:00 Steve Gieseking <[email protected]
<mailto:[email protected]> >:
In base64-test.cpp binaryTest() function, the first data.assign has a string
with 13 values but requests a copy of 16 values. In
http://www.cplusplus.com/reference/string/string/assign/ this is indicated at
the bottom of the page as having undefined behavior. This was flagged in a
compilation with Address Sanitizer in Linux as having a global buffer overrun
in libstdc++.
Steve
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Tntnet-general mailing list
[email protected]
<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/tntnet-general
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general