Closed Bug 131918 Opened 24 years ago Closed 24 years ago

Infinite loop in nsEventStateManager::MoveFocusToCaret, tabbing to form controls

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P1)

x86
Windows 2000
defect

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: jrgmorrison, Assigned: aaronlev)

Details

(Keywords: regression)

Attachments

(2 files)

Infinite loop in nsEventStateManager::MoveFocusToCaret, tabbing to form controls Somehow, I've hit an infinite loop while doing some testing of form controls. (NOTE: this happens with either the current (c++) implementation of form controls or with the xbl-based form controls. It is independent of [XBLFC].) Steps to reproduce: 1) start browser and load the first attachment to this bug (simple form) 2) tab out of urlbar to first link, and tab again to first <select> 3) use the mouse to set the focus back in the urlbar 4) again, tab out of urlbar to first link, and tab again to first <select> 5) at this point, wait. In a few seconds, CPU will go to 100% The stack trace for the loop is below, and it is stuck in the 'do {} while ();' of MoveFocusToCaret, which starts at about line 4332 of nsEventStateManager.cpp Tested with win2k, cvs build pulled ~4pm 03/18 -> aaronl, since cvsblame has him as the author of that loop. nsEventStateManager::MoveFocusToCaret(nsEventStateManager * const 0x0158d9ce, int 0x00000000, int * 0x00000000) line 4332 nsEventStateManager::ShiftFocusInternal(nsEventStateManager * const 0x00000013, int 0x0158d810, nsIContent * 0x00000001) line 2776 nsEventStateManager::ShiftFocus(nsEventStateManager * const 0x025498c8, int 0x00000001, nsIContent * 0x00000000) line 2706 nsEventStateManager::PostHandleEvent(nsEventStateManager * const 0x01cdc2ae, nsIPresContext * 0x025498c8, nsEvent * 0x02534a58, nsIFrame * 0x0012fb44, nsEventStatus * 0x0259f5ec, nsIView * 0x0012fa14) line 1830 PresShell::HandleEventInternal(PresShell * const 0x00000013, nsEvent * 0x01cdc04c, nsIView * 0x025498c8, unsigned int 0x025a04d8, nsEventStatus * 0x00000001) line 6074 + 25 bytes PresShell::HandleEvent(PresShell * const 0x01e392a3, nsIView * 0x025498c8, nsGUIEvent * 0x025a04d8, nsEventStatus * 0x0012fb44, int 0x0012fa14, int &) line 5977 + 24 bytes nsViewManager::HandleEvent(nsViewManager * const 0x00000013, nsView * 0x01e313c4, nsGUIEvent * 0x02567cc8, int 0x0012fb44) line 2043 nsView::HandleEvent(nsView * const 0x00000013, nsViewManager * 0x01c4d6f8, nsGUIEvent * 0x0012fb44, int 0x00000000) line 306 nsViewManager::DispatchEvent(nsViewManager * const 0x01e31f2d, nsGUIEvent * 0x01c4d6f8, nsEventStatus * 0x3d888889) line 1857 + 29 bytes HandleEvent(nsGUIEvent * 0x0012fb44) line 83 nsWindow::DispatchEvent(nsWindow * const 0x02567d3c, nsGUIEvent * 0x0012fb44, nsEventStatus & nsEventStatus_eIgnore) line 865 + 3 bytes nsWindow::DispatchWindowEvent(nsWindow * const 0x00000013, nsGUIEvent * 0x00000000) line 886 nsWindow::DispatchKeyEvent(nsWindow * const 0x00000013, unsigned int 0x00000083, unsigned short 0x0000, unsigned int 0x00000009, long 0x00000000) line 2659 + 32 bytes nsWindow::OnChar(nsWindow * const 0x00000013, unsigned int 0x00000009, unsigned int 0x00000009, unsigned char 0x00) line 2807 + 20 bytes nsWindow::ProcessMessage(nsWindow * const 0x00000013, unsigned int 0x018a2575, unsigned int 0x00000102, long 0x00000009, long * 0x000f0001) line 4167 + 16 bytes nsWindow::WindowProc(HWND__ * 0x77e13eb0, unsigned int 0x00db03c2, unsigned int 0x00000000, long 0x00000009) line 1130 + 15 bytes USER32! 77e13eb0() nsAppShellService::Run(nsAppShellService * const 0x00f50110) line 309 main1(int 0x004020de, char * * 0x00000001, nsISupports * 0x00312c30) line 1350 + 10 bytes main(int 0x00000000, char * * 0x00313bb8) line 1698 + 23 bytes WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00400000, char * 0x001333fb, HINSTANCE__ * 0x00400000) line 1716 + 23 bytes MOZILLA! WinMainCRTStartup + 308 bytes
critical, nsbeta1, mozilla1.0, keywordroulette
Severity: normal → critical
Keywords: mozilla1.0, nsbeta1
slight correction to the steps to reproduce 4) hit tab to move out of the urlbar. This sets the focus ring for the content area. Hit tab again: this tab press drops you into the infinite loop.
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla1.0
Comment on attachment 75071 [details] [diff] [review] It was breaking out of the inner loop, but not making out of the outer loop. This sets a condition that will force it out of the outer loop as well. r=jgaunt
Attachment #75071 - Flags: review+
Comment on attachment 75071 [details] [diff] [review] It was breaking out of the inner loop, but not making out of the outer loop. This sets a condition that will force it out of the outer loop as well. sr=alecf
Attachment #75071 - Flags: superreview+
Comment on attachment 75071 [details] [diff] [review] It was breaking out of the inner loop, but not making out of the outer loop. This sets a condition that will force it out of the outer loop as well. a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #75071 - Flags: approval+
Keywords: nsbeta1 → nsbeta1+, regression
checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
vrfy'd fixed using 2002.03.26 comm bits on win2k (via Task Mgr)...and also checked mac 10.1.3 (CPU Monitor) and linux rh7.2 (top) for grins. didn't see a jump in CPU usage when going through jrgm's test.
Status: RESOLVED → VERIFIED
Component: Keyboard: Navigation → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: