Comment #3 on issue 22857 by [email protected]: Uninitialized memory sent via IPC from RenderWidgetHostViewGtkWidget::KeyPressReleaseEvent() http://code.google.com/p/chromium/issues/detail?id=22857
The reason of this issue is: in Pickle::Resize(), the buffer is expanded by calling realloc(), which will not initialize the newly allocated memory. In the case of this issue, the data written to the pickle have 85 bytes, while the pickle's capacity is 128 bytes (a factor of Pickle::kPayloadUnit, which is 64 bytes), so the bytes between 85 and 128 are left uninitialized. But in IPC::Channel::Send(), only 85 bytes (the message header and payload) will be written to the socket. So the uninitialized data after the payload would be harmless. So I think it might be ok for us to suppress this valgrind error. If we want to fix this issue in our code, the simplest way would be memset the newly allocated memory to zero in Pickle::Resize(). But I'm not sure how much performance impact it may occur. The other way is to fill the uninitialized memory just before sending the message, which may cause less performance impact but need more code change. What's your opinion? -- 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 --~--~---------~--~----~------------~-------~--~----~ Automated mail from issue updates at http://crbug.com/ Subscription options: http://groups.google.com/group/chromium-bugs -~----------~----~----~----~------~----~------~--~---
