The default bug view has changed. See this FAQ.

Uninitialised value use in nsWindow::Show(bool aState)

RESOLVED FIXED in mozilla16

Status

()

Core
Widget
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jseward, Assigned: mwu)

Tracking

Trunk
mozilla16
ARM
Gonk (Firefox OS)
Points:
---

Firefox Tracking Flags

(blocking-basecamp:-)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
(the one in widget/gonk/nsWindow.cpp)

When starting B2G on GalaxyS2, I got the complaint shown below,
plus probably related other ones.

The complained-about line is widget/gonk/nsWindow.cpp:301

    if (mVisible == aState)

A bit of grepping around suggests the relevant constructor,
nsWindow::nsWindow(), at the same file line 121, does not initialise
mVisible.

Conditional jump or move depends on uninitialised value(s)
   at 0x5844612: nsWindow::Show(bool) (widget/gonk/nsWindow.cpp:301)
   by 0x51FABD3: DocumentViewerImpl::Hide() (layout/base/nsDocumentViewer.cpp:2028)
   by 0x51FA879: DocumentViewerImpl::InitInternal(nsIWidget*, nsISupports*, nsIntRect const&, bool, bool, bool) (layout/base/nsDocumentViewer.cpp:891)
   by 0x51FAA57: DocumentViewerImpl::Init(nsIWidget*, nsIntRect const&) (layout/base/nsDocumentViewer.cpp:676)
   by 0x572B8E3: nsDocShell::SetupNewViewer(nsIContentViewer*) (docshell/base/nsDocShell.cpp:7801)
   by 0x572C11B: nsDocShell::Embed(nsIContentViewer*, char const*, nsISupports*) (docshell/base/nsDocShell.cpp:5880)
   by 0x5730DC1: nsDocShell::CreateAboutBlankContentViewer(nsIPrincipal*, nsIURI*, bool) (docshell/base/nsDocShell.cpp:6615)
   by 0x5731235: nsDocShell::EnsureContentViewer() (docshell/base/nsDocShell.cpp:6508)
   by 0x573207F: nsDocShell::GetInterface(nsID const&, void**) (docshell/base/nsDocShell.cpp:941)
   by 0x598A1DB: nsGetInterface::operator()(nsID const&, void**) const (/home/sewardj/B2G-1/B2G/objdir-gecko/xpcom/build/nsIInterfaceRequestorUtils.cpp:19)
   by 0x598929D: nsCOMPtr_base::assign_from_helper(nsCOMPtr_helper const&, nsID const&) (/home/sewardj/B2G-1/B2G/objdir-gecko/xpcom/build/nsCOMPtr.cpp:117)
   by 0x54A20A3: nsGlobalWindow::GetDocument(nsIDOMDocument**) (/home/sewardj/B2G-1/B2G/objdir-gecko/dom/base/../../dist/include/nsCOMPtr.h:598)

 Uninitialised value was created by a heap allocation
   at 0x48067E0: malloc (/home/sewardj/VgTRUNK/trunk-b2g/coregrind/m_replacemalloc/vg_replace_malloc.c:267)
   by 0x5DEC767: moz_xmalloc (memory/mozalloc/mozalloc.cpp:54)
   by 0x5843377: nsWindowConstructor(nsISupports*, nsID const&, void**) (/home/sewardj/B2G-1/B2G/objdir-gecko/widget/gonk/../../dist/include/mozilla/mozalloc.h:200)
   by 0x598DF5B: mozilla::GenericFactory::CreateInstance(nsISupports*, nsID const&, void**) (/home/sewardj/B2G-1/B2G/objdir-gecko/xpcom/build/GenericFactory.cpp:16)
   by 0x59AD0A9: nsComponentManagerImpl::CreateInstance(nsID const&, nsISupports*, nsID const&, void**) (xpcom/components/nsComponentManager.cpp:944)
   by 0x5989B05: CallCreateInstance(nsID const&, nsISupports*, nsID const&, void**) (/home/sewardj/B2G-1/B2G/objdir-gecko/xpcom/build/nsComponentManagerUtils.cpp:125)
   by 0x5989B23: nsCreateInstanceByCID::operator()(nsID const&, void**) const (/home/sewardj/B2G-1/B2G/objdir-gecko/xpcom/build/nsComponentManagerUtils.cpp:167)
   by 0x598929D: nsCOMPtr_base::assign_from_helper(nsCOMPtr_helper const&, nsID const&) (/home/sewardj/B2G-1/B2G/objdir-gecko/xpcom/build/nsCOMPtr.cpp:117)
   by 0x5862F93: nsBaseWidget::CreateChild(nsIntRect const&, nsEventStatus (*)(nsGUIEvent*), nsDeviceContext*, nsWidgetInitData*, bool) (/home/sewardj/B2G-1/B2G/objdir-gecko/widget/xpwidgets/../../dist/include/nsCOMPtr.h:684)
   by 0x5489EE9: nsView::CreateWidgetForParent(nsIWidget*, nsWidgetInitData*, bool, bool) (view/src/nsView.cpp:730)
   by 0x5489F4D: nsIView::CreateWidgetForParent(nsIWidget*, nsWidgetInitData*, bool, bool) (view/src/nsView.cpp:641)
   by 0x51F8209: DocumentViewerImpl::MakeWindow(nsSize const&, nsIView*) (layout/base/nsDocumentViewer.cpp:2311)
(Assignee)

Updated

5 years ago
Assignee: nobody → mwu
(Assignee)

Comment 1

5 years ago
Created attachment 632159 [details] [diff] [review]
Initialize mVisible in Create
Attachment #632159 - Flags: feedback?(jseward)
(Reporter)

Comment 2

5 years ago
Comment on attachment 632159 [details] [diff] [review]
Initialize mVisible in Create

Yes, that makes the complaints go away.
Attachment #632159 - Flags: feedback?(jseward) → feedback+
(Assignee)

Updated

5 years ago
Attachment #632159 - Flags: review?(jones.chris.g)
Attachment #632159 - Flags: review?(jones.chris.g) → review+

Updated

5 years ago
blocking-basecamp: --- → ?
(Assignee)

Comment 3

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/5ce9ee29d71b
https://hg.mozilla.org/mozilla-central/rev/5ce9ee29d71b
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
blocking-basecamp: ? → -
You need to log in before you can comment on or make changes to this bug.