Valgrind warning upon sending "Hello" Message

RESOLVED FIXED

Status

()

RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: cjones, Unassigned)

Tracking

Trunk
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

==31546==
==31546== Syscall param socketcall.sendmsg(msg.msg_iov[i]) points to uninitialised byte(s)
==31546==    at 0x4E37FCB: (within /lib64/libpthread-2.9.so)
==31546==    by 0x6ABA007: IPC::Channel::ChannelImpl::ProcessOutgoingMessages() (ipc_channel_posix.cc:598)
==31546==    by 0x6ABA3B3: IPC::Channel::ChannelImpl::Connect() (ipc_channel_posix.cc:350)
==31546==    by 0x6ABA3E4: IPC::Channel::Connect() (ipc_channel_posix.cc:777)
==31546==    by 0x6A19F96: mozilla::ipc::AsyncChannel::OnChannelOpened() (AsyncChannel.cpp:212)
==31546==    by 0x6A1A7F1: void DispatchToMethod<mozilla::ipc::AsyncChannel, void (mozilla::ipc::AsyncChannel::*)()>(mozilla::ipc::AsyncChannel*, void (mozilla::ipc::AsyncChannel::*)(), Tuple0 const&) (tuple.h:383)
==31546==    by 0x6A1A82D: RunnableMethod<mozilla::ipc::AsyncChannel, void (mozilla::ipc::AsyncChannel::*)(), Tuple0>::Run() (task.h:307)
==31546==    by 0x6A4F27E: MessageLoop::RunTask(Task*) (message_loop.cc:322)
==31546==    by 0x6A4F757: MessageLoop::DeferOrRunPendingTask(MessageLoop::PendingTask const&) (message_loop.cc:330)
==31546==    by 0x6A4FADA: MessageLoop::DoWork() (message_loop.cc:430)
==31546==    by 0x6AA8DDC: base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) (message_pump_libevent.cc:224)
==31546==    by 0x6A5001A: MessageLoop::RunInternal() (message_loop.cc:211)
==31546==  Address 0xfc0cdb0 is 24 bytes inside a block of size 64 alloc'd
==31546==    at 0x4C25BC6: malloc (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
==31546==    by 0x4C25DAA: realloc (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
==31546==    by 0x6A5D169: Pickle::Resize(unsigned long) (pickle.cc:419)
==31546==    by 0x6A5D4A4: Pickle::Pickle(int) (pickle.cc:38)
==31546==    by 0x6A93A0F: IPC::Message::Message(int, unsigned short, IPC::Message::PriorityValue) (ipc_message.cc:31)
==31546==    by 0x6ABBFC9: IPC::Channel::ChannelImpl::CreatePipe(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, IPC::Channel::Mode) (ipc_channel_posix.cc:315)
==31546==    by 0x6ABC24D: IPC::Channel::ChannelImpl::ChannelImpl(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, IPC::Channel::Mode, IPC::Channel::Listener*) (ipc_channel_posix.cc:258)
==31546==    by 0x6ABC390: IPC::Channel::Channel(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, IPC::Channel::Mode, IPC::Channel::Listener*) (ipc_channel_posix.cc:769)
==31546==    by 0x6A8A096: ChildThread::Init() (child_thread.cc:106)
==31546==    by 0x6A1CE7A: mozilla::ipc::GeckoThread::Init() (GeckoThread.cpp:61)
==31546==    by 0x6A19AEE: mozilla::plugins::PluginThreadChild::Init() (PluginThreadChild.cpp:67)
==31546==    by 0x6A776D2: base::Thread::ThreadMain() (thread.cc:156)


AFAICT, this happens because the iovec.iov_base in this message header ends up pointing to some IPC::Message::Header fields that are never written to before the Hello() message is sent.  In fact, this same warning should appear when any async or sync message is sent, if my hypothesis is correct.

Not a high priority because although the warning is valid, those fields are never read in the cases where they're never written.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.