Subj : Re: Spidermonkey string.split To : Mike McIntosh From : Phil Schwartau Date : Thu Jan 23 2003 04:27 pm Hi Mike, This looks like a known bug, reported on Windows-only: http://bugzilla.mozilla.org/show_bug.cgi?id=163323 "Mozilla and xpcshell crash on string.split(/\b\W+(\b|$)/g) [@ str_split]" If you have an account at Bugzilla (easily obtained at http://bugzilla.mozilla.org/createaccount.cgi), you can cc yourself on this to follow progress on the problem - Phil Mike McIntosh wrote: > Hi, > > I seem to have a problem with regular expression _only_ in Win32 release > mode. I have built the js32.dll via the Visual C++ IDE using js.mdp. > > Sample script is :- > ============= > > var strXT = "82.50US1.90XF"; > var arx = strXT.split(/(\d*\.?\d{2}?)/g); > > ================== > > In debug mode, arx contains 5 elements "", "82.50", "US", "1.90" and "XF". > > When I run release mode version I get an exception in jsstr.c at line 1834 > (the js_NewStringCopy) > > for (num = 0; num < cx->regExpStatics.parenCount; num++) { > if (limited && len >= limit) > break; > parsub = REGEXP_PAREN_SUBSTRING(&cx->regExpStatics, > num); > sub = js_NewStringCopyN(cx, parsub->chars, > parsub->length, > 0); > if (!sub) > return JS_FALSE; > > Looking at the cx->regExpStatics variable, it seems to contain > parenCount=58259372 which seems strange. After executing the > REGEXP_PAREN_SUBSTRING line.parsub seems to have value FFFFFFB8. > > If I build the release version with optimisation off, I don't get the > problem. > > Can anyone else reproduce this or have I just got a screwed up build?. > > Btw, I am on Visual C++ v6.0 with SP5 applied. > > Regards, > Mike > > .