Closed Bug 1098703 Opened 10 years ago Closed 10 years ago

Zero HttpBaseChannel::{mSelfAddr,mPeerAddr} on construction to avoid Valgrind complaints in e10s builds

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36
Tracking Status
e10s + ---

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

Attachments

(1 file)

When I run |mach valgrind-test| with e10s enabled, I get this error:

> TEST-UNEXPECTED-FAIL | valgrind-test | Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s) at ??? / IPC::Channel::ChannelImpl::ProcessOutgoingMessages / IPC::Channel::ChannelImpl::Send / IPC::Channel::Send
> 
> ==10967== Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s)
> ==10967==    at 0x4E469BD: ??? (syscall-template.S:81)
> ==10967==    by 0x803A3FC: IPC::Channel::ChannelImpl::ProcessOutgoingMessages() (ipc_channel_posix.cc:725)
> ==10967==    by 0x803ADE8: IPC::Channel::ChannelImpl::Send(IPC::Message*) (ipc_channel_posix.cc:801)
> ==10967==    by 0x803ADF8: IPC::Channel::Send(IPC::Message*) (ipc_channel_posix.cc:1000)
> ==10967==    by 0x806A44F: RunnableMethod<IPC::Channel, bool (IPC::Channel::*)(IPC::Message*), Tuple1<IPC::Message*> >::Run() (tuple.h:393)
> 
> ==10967==  Address 0x23fbfbcc is 748 bytes inside a block of size 1,024 alloc'd
> ==10967==    at 0x4C2CE8E: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==10967==    by 0x80439C8: Pickle::Resize(unsigned int) (pickle.cc:635)
> ==10967==    by 0x8043B86: Pickle::BeginWrite(unsigned int, unsigned int) (pickle.cc:513)
> ==10967==    by 0x8043C06: Pickle::WriteBytes(void const*, int, unsigned int) (pickle.cc:558)
> ==10967==    by 0x81CAAD5: mozilla::net::PHttpChannelParent::SendOnStartRequest(tag_nsresult const&, mozilla::net::nsHttpResponseHead const&, bool const&, mozilla::net::nsHttpHeaderArray const&, bool const&, bool const&, unsigned int const&, nsCString const&, nsCString const&, mozilla::net::NetAddr const&, mozilla::net::NetAddr const&, short const&) (pickle.h:133)
> ==10967==    by 0x7F4B36D: mozilla::net::HttpChannelParent::OnStartRequest(nsIRequest*, nsISupports*) (HttpChannelParent.cpp:695)
> 
> ==10967==  Uninitialised value was created by a heap allocation
> ==10967==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==10967==    by 0x4034684: moz_xmalloc (mozalloc.cpp:52)
> ==10967==    by 0x7F1A76A: mozilla::net::nsHttpHandler::NewProxiedChannel2(nsIURI*, nsIProxyInfo*, unsigned int, nsIURI*, nsILoadInfo*, nsIChannel**) (mozalloc.h:208)
> ==10967==    by 0x7F1A8FC: mozilla::net::nsHttpHandler::NewProxiedChannel(nsIURI*, nsIProxyInfo*, unsigned int, nsIURI*, nsIChannel**) (nsHttpHandler.cpp:1795)
> ==10967==    by 0x7E51567: nsIOService::NewChannelFromURIWithProxyFlags2(nsIURI*, nsIURI*, unsigned int, nsIDOMNode*, nsIPrincipal*, nsIPrincipal*, unsigned int, unsigned int, nsIChannel**) (nsIOService.cpp:639)
> ==10967==    by 0x7E51707: nsIOService::NewChannelFromURI2(nsIURI*, nsIDOMNode*, nsIPrincipal*, nsIPrincipal*, unsigned int, unsigned int, nsIChannel**) (nsIOService.cpp:593)
> ==10967==    by 0x7E51738: nsIOService::NewChannelFromURI(nsIURI*, nsIChannel**) (nsIOService.cpp:605)
> ==10967==

At first I thought it was caused by HttpBaseChannel::mChannelCreationTime or
nsHttpChannel::mRedirectType, both of which are *not* initialized by their
destructors. But zeroing them didn't help.

I eventually tracked it down to HttpBaseChannel::{mSelfAddr,mPeerAddr}. It
looks like a false positive -- having parts of those unions uninitialized is ok
as long as the other process doesn't read them, which it probably doesn't. But
it's good to keep Valgrind happy.
Blocks: 1069695
jduell: review ping. This is a tiny patch.
Attachment #8522652 - Flags: review?(jduell.mcbugs) → review+
https://hg.mozilla.org/mozilla-central/rev/addcdfa8504d
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: