Closed Bug 122083 Opened 23 years ago Closed 23 years ago

Typing "vi " or "v " into URL bar and pressing enter freezes Mozilla

Categories

(Core :: XPCOM, defect)

x86
All
defect
Not set
critical

Tracking

()

RESOLVED FIXED

People

(Reporter: jplauril, Assigned: jag+mozilla)

References

()

Details

(Keywords: hang)

Attachments

(2 files)

When you type "vi " or "v " in the URL bar and press Enter the browser freezes
and consumes all available CPU. Turning Internet Keywords or autocompletion on
or off has no effect. I wasn't able to find any other words that hang the
browser. Other single letters than v and other two-letter words beginning with
v work as expected (I tried them all).

In particular, the word "emacs" works just fine ;)

The bug exists at least in Mozilla 0.9.7 (I tried all the words only on 0.9.7),
0.9.6 and the most recent nightly build. I tried removing my .mozilla directory
and my .netscape directory and thus restarting with the default configuration,
but the bug remained.
This also happens under Windows 98, on builds 2001122106 (0.9.7)
and 2002010204 (with SVG and MathML). CHanging OS to all.

Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Also on Linux 2002012505, 0.9.8 branch. Show yourself, vi-hater ;)
Keywords: hang
Whoo, there it goes! Confirmed 2002012605-0.9.8/WinNT4.

Man, this is a great Stupid Mozilla Trick ;-)
...and because the url popup was active, X had grabbed the cursor. I had to
change to a different VC and kill mozilla-bin to get mozilla to exit.

/me avoid making a snide remark about vi's FAQ being "how do I quit"

Oh. Oops. Too late. ;)
OK, debugging from the console gives me:

###!!! ASSERTION: not a UTF8 string: 'Error', file
/home/bbaetz/src/mozilla/string/obsolete/nsString2.h, line 682
###!!! Break: at file /home/bbaetz/src/mozilla/string/obsolete/nsString2.h, line 682
###!!! ASSERTION: calculator calculated incorrect length: 'count == mLength',
file /home/bbaetz/src/mozilla/string/obsolete/nsString2.cpp, line 1556
###!!! Break: at file /home/bbaetz/src/mozilla/string/obsolete/nsString2.cpp,
line 1556

I managed to ctrl-c, and change threads from gdb. The backtrace was pointing
into js land, and (I'm not quite sure why the entire assertion string didn't
show. I could have lost it in the scrollback, which only lasts til I change to
another VC)

I lost the top of the stack, but it SetCapacity with a very very large argument
(ie several million) was at the top, and below the string code was just generic
xpconnect stuff.

ccing jag, although I'm not sure that this is a strings thing.
Attached file win2k stack trace
The problem lies here:

nsDefaultURIFixup.cpp:

if (uriString.EqualsIgnoreCase("view-source:", 12))
{
  ...
  tempString = Substring(uriString, 12, uriString.Length() - 12);
}

with uriString = "vi"

For some odd reason, this matches.

[some time passes]

Actually, it's not odd... The StrCompareXtoY are broken, and it looks like they
have been broken for a good while. Have a fix.
Assignee: hewitt → jaggernaut
Component: URL Bar → String
Is this low risk enough and therefore could land on the 0.9.8 branch?
Comment on attachment 66738 [details] [diff] [review]
Fix TranslateCompareResult to address the situation where sourceStr, destStr or both are shorter than aCount

doh! sr=alecf
Attachment #66738 - Flags: superreview+
I think so.
Keywords: mozilla0.9.8
confirmed on HP-UX, mozilla build 2001122723
Comment on attachment 66738 [details] [diff] [review]
Fix TranslateCompareResult to address the situation where sourceStr, destStr or both are shorter than aCount

r=dbradley

Looks good to me. I couldn't find any holes in the logic now.
Attachment #66738 - Flags: review+
a=asa (on behalf of drivers) for checkin to 0.9.8
Checked in to trunk and branch.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: