Closed Bug 47302 Opened 24 years ago Closed 24 years ago

[FIX]Assertion: aPresContext is NULL in RegUnRegAccessKey

Categories

(Core :: Layout: Form Controls, defect, P3)

x86
FreeBSD
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: jesup, Assigned: rods)

References

()

Details

(Keywords: memory-footprint, memory-leak, Whiteboard: [nsbeta3+]Fix in hand)

Attachments

(1 file)

I had just posted a comment to a bug in bugzilla, and while it was rendering the
resultant page to my browser I got this assertion.  From the code, it looks as
if the radio button was deleted without ever having been in a Reflow (since
Reflow sets mPresContext).

#0  nsDebug::Assertion (
    aStr=0x29807560 "aPresContext is NULL in RegUnRegAccessKey!", 
    aExpr=0x2980754b "aPresContext", aFile=0x29807519 "nsFormControlFrame.cpp", 
    aLine=562) at nsDebug.cpp:184
#1  0x294fc477 in nsFormControlFrame::RegUnRegAccessKey (aPresContext=0x0, 
    aFrame=0x95dfd94, aDoReg=0) at nsFormControlFrame.cpp:562
#2  0x294fbc61 in nsFormControlFrame::~nsFormControlFrame (this=0x95dfd94, 
    __in_chrg=0) at nsFormControlFrame.cpp:129
#3  0x2951715d in nsGfxRadioControlFrame::~nsGfxRadioControlFrame (
    this=0x95dfd94, __in_chrg=3) at nsGfxRadioControlFrame.cpp:61
#4  0x293938a8 in nsFrame::Destroy (this=0x95dfd94, aPresContext=0x8350600)
    at nsFrame.cpp:425
#5  0x29386a9d in nsBlockFrame::DoRemoveFrame (this=0x93bd380, 
    aPresContext=0x8350600, aDeletedFrame=0x95dfd94) at nsBlockFrame.cpp:5496
#6  0x293866f2 in nsBlockFrame::RemoveFrame (this=0x93bd380, 
    aPresContext=0x8350600, aPresShell=@0x8917400, aListName=0x0, 
    aOldFrame=0x95dfd94) at nsBlockFrame.cpp:5395
#7  0x29503271 in nsFormFrame::RemoveFrame (this=0x93bd380, 
    aPresContext=0x8350600, aPresShell=@0x8917400, aListName=0x0, 
    aOldFrame=0x95dfd94) at nsFormFrame.cpp:364
#8  0x2939efe3 in FrameManager::RemoveFrame (this=0x8b1c480, 
    aPresContext=0x8350600, aPresShell=@0x8917400, aParentFrame=0x93bd380, 
    aListName=0x0, aOldFrame=0x95dfd94) at nsFrameManager.cpp:706
#9  0x2956342e in nsCSSFrameConstructor::ContentRemoved (this=0x8aed9c0, 
    aPresContext=0x8350600, aContainer=0x8d9d10c, aChild=0x934158c, 
    aIndexInContainer=0) at nsCSSFrameConstructor.cpp:9486
#10 0x296f4bbf in StyleSetImpl::ContentRemoved (this=0x8aed940, 
    aPresContext=0x8350600, aContainer=0x8d9d10c, aChild=0x934158c, 
    aIndexInContainer=0) at nsStyleSet.cpp:1113
#11 0x293d1ebc in PresShell::ContentRemoved (this=0x8917400, 
    aDocument=0x949da00, aContainer=0x8d9d10c, aChild=0x934158c, 
    aIndexInContainer=0) at nsPresShell.cpp:3470
#12 0x2968bbe9 in nsDocument::ContentRemoved (this=0x949da00, 
    aContainer=0x8d9d10c, aChild=0x934158c, aIndexInContainer=0)
    at nsDocument.cpp:1865
#13 0x294dd174 in nsHTMLDocument::ContentRemoved (this=0x949da00, 
    aContainer=0x8d9d10c, aChild=0x934158c, aIndexInContainer=0)
    at nsHTMLDocument.cpp:1240
#14 0x293fb698 in nsGenericHTMLContainerElement::RemoveChildAt (this=0x8d9d120, 
    aIndex=0, aNotify=1) at nsGenericHTMLElement.cpp:3531
#15 0x29432058 in nsHTMLFormElement::RemoveChildAt (this=0x8d9d100, aIndex=0, 
    aNotify=1) at nsHTMLFormElement.cpp:94
#16 0x294c82af in SinkContext::DemoteContainer (this=0x98f63c0, 
    aNode=@0xbfbfc744) at nsHTMLContentSink.cpp:1627
#17 0x294cc6f3 in HTMLContentSink::CloseForm (this=0x9314200, aNode=@0xbfbfc744)
    at nsHTMLContentSink.cpp:2895
#18 0x28b8d3d1 in CNavDTD::CloseForm (this=0x8a03c00, aNode=0xbfbfc744)
    at CNavDTD.cpp:2971
#19 0x28b8db3d in CNavDTD::CloseContainer (this=0x8a03c00, aNode=0xbfbfc744, 
    aTarget=eHTMLTag_form, aClosedByStartTag=0) at CNavDTD.cpp:3240
#20 0x28b8b1b8 in CNavDTD::HandleEndToken (this=0x8a03c00, aToken=0x86a97c0)
    at CNavDTD.cpp:1746
#21 0x28b88e4d in CNavDTD::HandleToken (this=0x8a03c00, aToken=0x86a97c0, 
    aParser=0x8d58900) at CNavDTD.cpp:773
#22 0x28b8856a in CNavDTD::BuildModel (this=0x8a03c00, aParser=0x8d58900, 
    aTokenizer=0x84b1d00, anObserver=0x0, aSink=0x9314200) at CNavDTD.cpp:499
#23 0x28b9f282 in nsParser::BuildModel (this=0x8d58900) at nsParser.cpp:1979
#24 0x28b9eff9 in nsParser::ResumeParse (this=0x8d58900, allowIteration=1, 
    aIsFinalChunk=0) at nsParser.cpp:1860
#25 0x28b9fe50 in nsParser::OnDataAvailable (this=0x8d58900, channel=0x94bd400, 
    aContext=0x0, pIStream=0x8f182c0, sourceOffset=0, aLength=138)
    at nsParser.cpp:2310
#26 0x289030d3 in ?? ()
   from /home/jesup/src/mozilla_work/mozilla/dist/bin/components/liburiloader.so
#27 0x288124d5 in nsHTTPFinalListener::OnDataAvailable (this=0x99db080, 
    aChannel=0x94bd400, aContext=0x0, aStream=0x8f182c0, aSourceOffset=0, 
    aCount=138) at nsHTTPResponseListener.cpp:1223
#28 0x287d3e50 in nsHTTPChunkConv::OnDataAvailable (this=0x937f000, 
aChannel=0x94Quit
) at nsHTTPChunkConv.cpp:211
#29 0x2881086f in nsHTTPServerListener::OnDataAvailable (this=0x9a01180, 
    channel=0x941f804, context=0x94bd400, i_pStream=0x9a01a8c, 
    i_SourceOffset=10342, i_Length=6445) at nsHTTPResponseListener.cpp:551
#30 0x287a2158 in nsOnDataAvailableEvent::HandleEvent (this=0x8f182e0)
    at nsAsyncStreamListener.cpp:400
#31 0x287a1311 in nsStreamListenerEvent::HandlePLEvent (aEvent=0x8f18300)
    at nsAsyncStreamListener.cpp:97
#32 0x2817f071 in PL_HandleEvent (self=0x8f18300) at plevent.c:587
#33 0x2817ef00 in PL_ProcessPendingEvents (self=0x81b9900) at plevent.c:528
#34 0x28180e5e in nsEventQueueImpl::ProcessPendingEvents (this=0x81b9740)
    at nsEventQueue.cpp:356
#35 0x290039b3 in ?? ()
   from
/home/jesup/src/mozilla_work/mozilla/dist/bin/components/libwidget_gtk.so
#36 0x290035b5 in ?? ()
   from
/home/jesup/src/mozilla_work/mozilla/dist/bin/components/libwidget_gtk.so
#37 0x28dff5aa in ?? () from /usr/local/lib/libglib12.so.3
#38 0x28e00d17 in ?? () from /usr/local/lib/libglib12.so.3
#39 0x28e0131f in ?? () from /usr/local/lib/libglib12.so.3
#40 0x28e014a1 in ?? () from /usr/local/lib/libglib12.so.3
#41 0x28d356f3 in ?? () from /usr/X11R6/lib/libgtk12.so.2
#42 0x29004125 in ?? ()
   from
/home/jesup/src/mozilla_work/mozilla/dist/bin/components/libwidget_gtk.so
#43 0x2849879e in ?? ()
   from
/home/jesup/src/mozilla_work/mozilla/dist/bin/components/libnsappshell.so
#44 0x80533c8 in main1 (argc=1, argv=0xbfbfd33c, nativeApp=0x0)
    at nsAppRunner.cpp:913
#45 0x8053b21 in main (argc=1, argv=0xbfbfd33c) at nsAppRunner.cpp:1093
(gdb) up
#2  0x294fbc61 in nsFormControlFrame::~nsFormControlFrame (this=0x95dfd94, 
    __in_chrg=0) at nsFormControlFrame.cpp:129
129       RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this),
PR_FALSE);
(gdb) p mPresContext
$1 = (nsIPresContext *) 0x0
(gdb) p *this
$2 = {
  <nsLeafFrame> = {
    <nsFrame> = {
      <nsIFrame> = {
        <nsISupports> = {
          _vptr$ = 0x298ca340
        }, <No data fields>}, 
      <nsIFrameDebug> = {
        <nsISupports> = {
          _vptr$ = 0x298ca300
        }, <No data fields>}, 
      members of nsFrame: 
      mRect = {
        x = 0, 
        y = 0, 
        width = 0, 
        height = 0
      }, 
      mContent = 0x934158c, 
      mStyleContext = 0x99b0900, 
      mParent = 0x93bd380, 
      mNextSibling = 0x95dfe10, 
      mState = 1062
    }, <No data fields>}, 
  <nsIFormControlFrame> = {
    <nsISupports> = {
      _vptr$ = 0x298ca2a0
    }, <No data fields>}, 
  members of nsFormControlFrame: 
  mWidgetSize = {
    width = 0, 
    height = 0
  }, 
  mDidInit = 0, 
  mLastClickPoint = {
    x = 0, 
    y = 0
  }, 
  mFormFrame = 0x0, 
  mSuggestedWidth = -1, 
  mSuggestedHeight = -1, 
  mPresContext = 0x0, 
  mCacheSize = {
    width = -1, 
    height = -1
  }, 
  mCachedMaxElementSize = {
    width = -1, 
    height = -1
  }
}
(gdb) up
#3  0x2951715d in nsGfxRadioControlFrame::~nsGfxRadioControlFrame (
    this=0x95dfd94, __in_chrg=3) at nsGfxRadioControlFrame.cpp:61
61        NS_IF_RELEASE(mRadioButtonFaceStyle);
(gdb) p *this
$3 = {
  <nsFormControlFrame> = {
    <nsLeafFrame> = {
      <nsFrame> = {
        <nsIFrame> = {
          <nsISupports> = {
            _vptr$ = 0x298ca340
          }, <No data fields>}, 
        <nsIFrameDebug> = {
          <nsISupports> = {
            _vptr$ = 0x298ca300
          }, <No data fields>}, 
        members of nsFrame: 
        mRect = {
          x = 0, 
          y = 0, 
          width = 0, 
          height = 0
        }, 
        mContent = 0x934158c, 
        mStyleContext = 0x99b0900, 
        mParent = 0x93bd380, 
        mNextSibling = 0x95dfe10, 
        mState = 1062
      }, <No data fields>}, 
    <nsIFormControlFrame> = {
      <nsISupports> = {
        _vptr$ = 0x298ca2a0
      }, <No data fields>}, 
    members of nsFormControlFrame: 
    mWidgetSize = {
      width = 0, 
      height = 0
    }, 
    mDidInit = 0, 
    mLastClickPoint = {
      x = 0, 
      y = 0
    }, 
    mFormFrame = 0x0, 
    mSuggestedWidth = -1, 
    mSuggestedHeight = -1, 
    mPresContext = 0x0, 
    mCacheSize = {
      width = -1, 
      height = -1
    }, 
    mCachedMaxElementSize = {
      width = -1, 
      height = -1
    }
  }, 
  <nsIStatefulFrame> = {
    <nsISupports> = {
      _vptr$ = 0x298cb1c0
    }, <No data fields>}, 
  <nsIRadioControlFrame> = {
    <nsISupports> = {
      _vptr$ = 0x298cb1a4
    }, <No data fields>}, 
  members of nsGfxRadioControlFrame: 
  mChecked = 0, 
  mRadioButtonFaceStyle = 0x0, 
  mRestoredChecked = 0, 
  mIsRestored = 0
}
I saved the page and added it as an attachment.  Note: I got about a dozen of
the assertions before the page finished loading.
This needs to be plused, radiobuttons aren't unregistering themselvers 
correctly. This may be causing some leaking.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Keywords: footprint, mlk, nsbeta3
Summary: Assertion: aPresContext is NULL in RegUnRegAccessKey → [FIX]Assertion: aPresContext is NULL in RegUnRegAccessKey
Whiteboard: Fix in hand
This bug should cover all the form control frames that have the unreg in the 
destructor instead of the Destroy method. The change is very simple, you just 
move it to the Destroy method and use the aPresContext the is passed in.
Marking nsbeta3+
Whiteboard: Fix in hand → [nsbeta3+]Fix in hand
Setting milestone to M19
Target Milestone: --- → M19
fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Randell, could you verify with the latest build?  Thanks. -ckritzer
Keywords: verifyme
Verified FreeBSD 20000907xx
Status: RESOLVED → VERIFIED
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: