Closed
Bug 88746
Opened 24 years ago
Closed 24 years ago
Mozilla appears to hang because of bad charset in javascript.
Categories
(Core :: DOM: HTML Parser, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: Deinst, Assigned: harishd)
References
()
Details
Attachments
(6 files)
33 bytes,
text/plain
|
Details | |
615 bytes,
text/html
|
Details | |
615 bytes,
text/html
|
Details | |
1.01 KB,
text/html
|
Details | |
1.25 KB,
patch
|
Details | Diff | Splinter Review | |
1.18 KB,
patch
|
Details | Diff | Splinter Review |
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.2+)
Gecko/20010701
BuildID: 2001070108
Attempting to load the details on the debian woody freeze causes mozilla to
appear to never stop loading. Running in a debug build one sees that an
assertion is triggered in nsScriptLoader.cpp line 715 "Could not convert
external JavaScript to Unicode!". Tracing this back we see that the cause is the
following line in the generated html
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=">
which causes the nsDocument to have a charset of "> I am not sure whether this
is a parse error in the parser, or in nsDocument, but I do not know which
component nsDocument lives in, so parser has got it.
Reproducible: Always
Steps to Reproduce:
1. Load suggested URL
2. Wait
3.
Actual Results: White screen and loading behavior.
Expected Results: Interesting informative much awaited article.
Reporter | ||
Comment 1•24 years ago
|
||
Ok, it is at least partially the parser.
The code in nsParser::DetectMetaTag is the culprit in this case. Also, the code
in nsParser::DetectMetaTag seems strange,
do {
...
tagStart = tagEnd;
tagEnd = end;
} while (tagStart != end);
return PR_FALSE;
Is mozilla intentionally checking only the first meta tag? When I get time, I'll
see what happens with a malformed charset in other than the first meta tag.
Looking at the other end of this problem, shouldn't the javascript people do
something other than fall over dead in the presence of a charset that they don't
understand? UTF-8 or ISO-8859-1 seem to be popular guesses.
Reporter | ||
Comment 3•24 years ago
|
||
Please ignore my comments about the do while. It was 1:30 am. There is a bug
with parsing malformed <meta Content-Type tags though.
Reporter | ||
Comment 5•24 years ago
|
||
Reporter | ||
Comment 6•24 years ago
|
||
Reporter | ||
Comment 7•24 years ago
|
||
Reporter | ||
Comment 8•24 years ago
|
||
Reporter | ||
Comment 9•24 years ago
|
||
There are two bugs, and two testcases.
The first testcase appears to freeze because the charset was parsed as "> and
javascript fell over and died.
The second testcase does not appear tof freeze. This could be considered a good
thing, but it doesn't freeze because only the first meta tag was being parsed.
The bug causing only one meta tag to be parsed is fixed in the accompanying patch.
I have a fix for the stringTokenizer, but I want to ensure that it doesnt
destroy anything else.
Reporter | ||
Comment 10•24 years ago
|
||
Reporter | ||
Comment 11•24 years ago
|
||
Ok, the patch for the first bug does two things. It keeps the tokenizer from
reading past the end of the buffer, which I am prettty sure is correct, and it
ignores the trailing quote that is given to us by the tokenizer. It may be
better to have the tokenizer report the shorter length in the case that taget is
a quote, kSkipQuotes is true and the last character read is a quote. This is
the only place that it seems to matter, so that's where I fixed it. I'm going
to submit another bug about the behavior of the scriptLoader.
Assignee | ||
Comment 12•24 years ago
|
||
Reporter | ||
Comment 13•24 years ago
|
||
Ok, It is simple will and work I will grant you that. As somone who has to read
the code with little to no preparation the idea of pushing orselves past the end
of the buffer by mistaking a trailing quote for a leading one is a bit
unsettling though.
Comment 14•24 years ago
|
||
r/sr=vidur
Comment 15•24 years ago
|
||
Fix checked in to the TRUNK.
And by the way, this was r=heikki...
Assignee | ||
Comment 17•24 years ago
|
||
Marking FIXED.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 18•24 years ago
|
||
Verified on:
build: 2001-07-02-04-Trunk
platform: WinNT
The above url loads fine.
The browser does not load 1st test case and keeps trying.
The 2nd test case loads fine.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•