Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 184 by h.a.syed: C++ Strange Memory Warning Under Visual Studio 2008 SP1 on Windows 7
http://code.google.com/p/protobuf/issues/detail?id=184

What steps will reproduce the problem?

1. Compile a protobuf object in an application under a visual studio debug
build.
2. Call "SerializeAsString()" on a protobuf class.
3. This may cause a memory leak warning in "AppendPartialToString" after
the
"string_as_array" function has returned.

What is the expected output? What do you see instead?

Visual studio crashed with a buffer under-run message. The stack frame
which was fine before the call is now filled with garbage. Strangely
though, the problem dissapears when a "Release" build is tried.

My code is part of a portable project, so I tried debug and normal builds
under Linux. I also ran valgrind on the binary and no leaks were reported.
I am assuming this has something to do with a combination of the debug STL
library provided by microsoft and the suspicious looking callto "stl_util-
inl.h:85". The code is accessing the underlying string buffer via the
following snippet "return s5tr->empty() ? NULL : &*str->begin();".

I hope you can reproduce the issue. I am hoping the Release build is indeed
free of errors.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to