kidok / protobuf

Automatically exported from code.google.com/p/protobuf
0 stars 0 forks source link

Memoryleak since change const ::std::string kEmptyString to const ::std::string& GetEmptyString() #619

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
The original report is in 
https://code.google.com/p/webrtc/issues/detail?id=3086.

What is the expected output? What do you see instead?
VLD reports there is memory leak according to the original report.

What version of the product are you using? On what operating system?
The change happens in protobuf r517. Please help to check if this is a problem 
in protobuf or the way webrtc using protobuf.

Please provide any additional information below.

BTW: I don't quite understand the call stack in which GetEmptyString() is 
called: 
#0  google::protobuf::internal::GetEmptyString ()
    at ../../third_party/protobuf/src/google/protobuf/generated_message_util.h:71

#1  0x000000000087df80 in webrtc::audioproc::ReverseStream::SharedCtor (
    this=0x7fffc000e5b0)
    at gen/protoc_out/webrtc/audio_processing/debug.pb.cc:428
#2  0x000000000087defc in webrtc::audioproc::ReverseStream::ReverseStream (
    this=0x7fffc000e5b0)
    at gen/protoc_out/webrtc/audio_processing/debug.pb.cc:414

What is the debug.pb.cc?

Original issue reported on code.google.com by braveyao@webrtc.org on 24 Mar 2014 at 6:02

GoogleCodeExporter commented 9 years ago
Can you narrow down the cause and provide us a simple source file that can 
reproduce the memory leak? I don't see a problem in the protobuf change and I 
know too little of webrtc to find a problem there.

Original comment by xiaof...@google.com on 24 Mar 2014 at 6:35

GoogleCodeExporter commented 9 years ago
Hallo, I provide you with the collected files of my investigations. I hope that 
it is enough that you can see the problem.

Original comment by berthold...@googlemail.com on 25 Mar 2014 at 10:23

Attachments:

GoogleCodeExporter commented 9 years ago
ok, so the problem is that we should register a shutdown callback to delete 
this empty string singleton when ShutdownProtobufLibrary() is called.

Original comment by xiaof...@google.com on 25 Mar 2014 at 8:05

GoogleCodeExporter commented 9 years ago

Original comment by xiaof...@google.com on 8 Oct 2014 at 1:02

GoogleCodeExporter commented 9 years ago
Fixed in:
https://github.com/google/protobuf/commit/06e6690bf2055b4361db2a6bdd21facf3f2d86
d6

Original comment by xiaof...@google.com on 9 Oct 2014 at 12:29