Closed Bug 763849 Opened 12 years ago Closed 12 years ago

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

Categories

(Core :: Widget, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16
blocking-basecamp -

People

(Reporter: jseward, Assigned: mwu)

Details

Attachments

(1 file)

(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: nobody → mwu
Attachment #632159 - Flags: feedback?(jseward)
Comment on attachment 632159 [details] [diff] [review]
Initialize mVisible in Create

Yes, that makes the complaints go away.
Attachment #632159 - Flags: feedback?(jseward) → feedback+
Attachment #632159 - Flags: review?(jones.chris.g)
Attachment #632159 - Flags: review?(jones.chris.g) → review+
blocking-basecamp: --- → ?
https://hg.mozilla.org/mozilla-central/rev/5ce9ee29d71b
Status: NEW → RESOLVED
Closed: 12 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.

Attachment

General

Created:
Updated:
Size: