Closed Bug 728087 Opened 14 years ago Closed 6 years ago

Browser frequently hangs in nsContentEventHandler::OnQuerySelectedText while typing in textareas

Categories

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

12 Branch
x86
macOS
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: justdave, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0a2) Gecko/20120216 Firefox/12.0a2 Build ID: 20120216042010 Steps to reproduce: Typed a bunch of text in a textarea Actual results: It froze. It does this frequently lately. I always have to force-quit and restart the browser. 95% of the time session restore manages to recover what I'd been typing, thankfully. Expected results: It shouldn't freeze.
I can reproduce this in safe mode, too, fwiw.
And the stack trace in the process profile looks almost exactly the same every time...
That stack shows code related to Chinese/Japanese input methods (TSMEventToInputMethod etc.). Does the problem go away if you change your Mac Language & Text "Input Sources" settings?
Component: Untriaged → Widget: Cocoa
Product: Firefox → Core
QA Contact: untriaged → cocoa
> Typed a bunch of text in a textarea Please post a link or links to the pages this happened on, and let us know where the textareas are on the page(s). And let us know what your International pref panel settings are/were -- particularly what was selected under the Flags menu.
(In reply to Gavin Sharp (use gavin@gavinsharp.com for email) from comment #3) > That stack shows code related to Chinese/Japanese input methods > (TSMEventToInputMethod etc.). Does the problem go away if you change your > Mac Language & Text "Input Sources" settings? OK, now that's interesting. Yes, I do typically operate with the input method set to Japanese Kotoeri in Romaji mode. It's quicker to toggle in and out of the kana modes from there than to switch it back to English all the time. (In reply to Steven Michaud from comment #4) > Please post a link or links to the pages this happened on, and let us know > where the textareas are on the page(s). https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox the description/comment box http://www.zimbra.com/forums/ pick and topic and hit "quick reply" https://intranet.mozilla.org/forum same as above. > And let us know what your International pref panel settings are/were -- > particularly what was selected under the Flags menu. See above. And indeed, I switched it to US English for typing this comment, and managed to type this entire comment without it hanging. I suppose I should mention that I have not yet applied the 10.7.3 system update yet, and this all started when the train rolled to change Aurora from 11 to 12.
Actually, on bugzilla it seems to trigger more frequently in the summary box on the enter bug form, probably because of it scanning the field to do the find-as-you-type duplicate detection.
> https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox the > description/comment box http Just tested with this and the summary box on OS X 10.6.8, in today's mozilla-central nightly, with the Flags menu set to Romaji (i.e. half-width Romaji). I didn't have any problems. Later I'll try on OS X 10.7.3. (I typed random characters very quickly.)
(In reply to Steven Michaud from comment #7) > (I typed random characters very quickly.) I usually run into it when I pause a lot while I'm typing or try to go back and edit afterwards.
> try to go back and edit afterwards By using the backspace or arrow keys? Or by clicking in the right spot with the mouse?
hmm, good question, never really paid attention.
I tried again, on both OS X 10.6.8 and 10.7.3, using various editing maneuvers and typing more slowly. Once again I tested with today's mozilla-central nightly. I didn't see any problems. Until we get more information, this is likely to remain one of life's unsolved mysteries :-)
(Following up comment #11) Forgot to mention that I used the Romaji input method in all my tests.
> + 552 nsContentEventHandler::GetFlatTextOffsetOfRange(nsIContent*, nsINode*, int, unsigned int*) (in XUL) + 441,411,... [0x101575849,0x10157582b,...] > + 515 nsContentEventHandler::GetFlatTextOffsetOfRange(nsIContent*, nsINode*, int, unsigned int*) (in XUL) + 411 [0x10157582b] > + ! 515 nsContentIterator::Next() (in XUL) + 0,29,... [0x10142f750,0x10142f76d,...] > + 491 nsContentEventHandler::GetFlatTextOffsetOfRange(nsIContent*, nsINode*, int, unsigned int*) (in XUL) + 441 [0x101575849] > + ! 491 nsContentIterator::GetCurrentNode() (in XUL) + 0,12,... [0x10142edd0,0x10142eddc,...] > + 332 nsContentEventHandler::GetFlatTextOffsetOfRange(nsIContent*, nsINode*, int, unsigned int*) (in XUL) + 422 [0x101575836] > + 332 nsContentIterator::IsDone() (in XUL) + 0 [0x10142e790] I'm not sure how to read here. Is this history what are called?
If this stack means hanging in IsDone(), I have no idea. That sounds like something was broken already and we accessed it.
It's a process sample over a 5 second period of the program running during the hang. The numbers on the left indicate how many times the execution pointer was inside that function during a sample. The leftmost number on the very top line is how many total samples there were taken. Any row with the same number on the left as the top-most line probably indicates a function that was never left during the sample period. In this case that number is 1890. Rows with a number less than that are probably getting called more than once inside the sample period.
It'd be most useful to me if you did the following: 1) Create your own custom build of Firefox (either debug or opt, but with no symbols stripped). 2) Run it in gdb. 3) Do what it takes to hang. 4) Break in gdb and do "thread apply all bt". Then attach the results here.
(In reply to Steven Michaud from comment #16) > It'd be most useful to me if you did the following: > > 1) Create your own custom build of Firefox (either debug or opt, but > with no symbols stripped). I don't have a current Mozilla build environment available, is there somewhere I can get such a build?
> is there somewhere I can get such a build? As best I can tell the answer is "no". There do exist "mozilla-central-debug" nightlies. And you might want to try using one of those instead. But I suspect their symbols are stripped, and my STR from comment #16 will produce a log that contains mostly spurious symbol names. But this bug will go nowhere without further information. So please do try with a mozilla-central-debug nightly and attach the result of "thread apply all bt" here. I should be able to tell whether or not it contains spurious symbols.

Moving all keyboard/IME open bugs to DOM: UI Events & Focus Handling component.

Component: Widget: Cocoa → DOM: UI Events & Focus Handling

Around Gecko 57, we added a lot of optimization to ContentEventHandler, and there is a todo bug for it, but I'm not sure it's reasonable for use (implementation cost vs. merit for the users) and probably, it does not improve this case.

justdave: Could you retest this with latest Nightly with Gecko profiler addon or mark this as WFM?

Flags: needinfo?(justdave)
Priority: -- → P5

Have not run into this in years, and I still use the JP IME regularly. It obviously got fixed at some point, perhaps unknowningly.

Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(justdave)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: