Closed Bug 92718 Opened 23 years ago Closed 15 years ago

Crash in CountCharInReadable with nsDependentSubstring

Categories

(Core :: XPCOM, defect)

x86
Linux
defect
Not set
critical

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: c, Assigned: jag+mozilla)

Details

(Keywords: crash, Whiteboard: [needs a String guru to figure out if it's valid])

I see sometimes crashes in CountCharInReadable() when called with a
nsDependentSubstring. This patch solves my problem:

Index: nsReadableUtils.cpp
===================================================================
RCS file: /cvsroot/mozilla/string/src/nsReadableUtils.cpp,v
retrieving revision 1.22
diff -u -r1.22 nsReadableUtils.cpp
--- nsReadableUtils.cpp	2001/06/19 22:38:34	1.22
+++ nsReadableUtils.cpp	2001/07/29 03:09:33
@@ -832,6 +832,7 @@
   
   aStr.BeginReading(begin);
   aStr.EndReading(end);
+  end.normalize_forward();

   while (begin != end) {
     if (*begin == aChar) {
@@ -853,6 +854,7 @@

   aStr.BeginReading(begin);
   aStr.EndReading(end);
+  end.normalize_forward();

   while (begin != end) {
     if (*begin == aChar) {

I do not know if the real problem is somewhere else or if there should be a
begin.normalize_forward() too, but I haven't seen a crash since I applied this
patch.
Blocks: 57724
Keywords: crash, patch
I'm not sure if I should use nsDependentSubstring at all. I encountered
similar problems everywhere I use it and the comments say "NOT FOR USE BY
HUMANS (mostly)". So I don't use it any longer. Maybe this bug is invalid.
No longer blocks: 57724
Severity: blocker → normal
giving up ancient string bugs to the new string owner.  jag, you'll want to sort
through these and see which ones still apply and go with or against the
direction in which you intend strings evolve
Assignee: scc → jaggernaut
By the definitions on <http://bugzilla.mozilla.org/bug_status.html#severity> and
<http://bugzilla.mozilla.org/enter_bug.cgi?format=guided>, crashing and dataloss
bugs are of critical or possibly higher severity.  Only changing open bugs to
minimize unnecessary spam.  Keywords to trigger this would be crash, topcrash,
topcrash+, zt4newcrash, dataloss.
Severity: normal → critical
QA Contact: scc → string
Benjamin, can you determine whether this bug is valid?
Whiteboard: [needs a String guru to figure out if it's valid]
This bug was filed prior to the string rewrite of mozilla 1.6/1.7, so it's very unlikely to be useful.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → INCOMPLETE
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.