By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.
Bug 569 - regression: javascript breakage, apparently in regexes
Summary: regression: javascript breakage, apparently in regexes
Status: RESOLVED FIXED
Alias: None
Product: TDE
Classification: Unclassified
Component: tdelibs (show other bugs)
Version: R14.0.0 [Trinity]
Hardware: i386 Debian Squeeze
: P1 blocker
Assignee: Timothy Pearson
URL:
Depends on:
Blocks:
 
Reported: 2011-10-29 05:42 CDT by Nick Leverton
Modified: 2012-10-19 15:36 CDT (History)
3 users (show)

See Also:
Compiler Version:
TDE Version String:
Application Version:
Application Name:


Attachments
Enable pcre support in kdelibs (1.89 KB, patch)
2011-12-21 00:15 CST, Timothy Pearson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Leverton 2011-10-29 05:42:23 CDT
Simple way to demonstrate this: open http://www.tv-guide.co.uk/ .  This site uses AJAX so is not a minimal case, sorry, but should demonstrate the problem quickly.

Hovering over any of the programme titles should cause a box to appear with the programme details.  This works in 3.5.12 but doesn't in 3.5.13.  The latter reports a Javascript console error on loading the page:

Error: http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js: SyntaxError: Invalid regular expression
Error: http://i.g8.tv/_ui/js/hover_menu5.js: ReferenceError: Can't find variable: $

.xsession-errors also contains a KJS regex failure:

KJS: regcomp failed with 'Invalid preceding regular expression'


You can get the non-obfuscated version of the script by accessing jquery.js rather than jquery.min.js, if it's needed.  There are a number of regex calls in that script and I'm not sure which one is failing.
Comment 1 Nick Leverton 2011-10-29 05:44:33 CDT
Oops, wrong URL, should be http://www.tvguide.co.uk/   Apologies.
Comment 2 Nick Leverton 2011-10-31 09:16:16 CDT
Three other sites where JS has stopped working in 3.5.13, all tested against a 3.5.12 VM.  I'm trying to instrument the code to find out what sort of regex is breaking, as simple ones seem OK.  I suspect it may involve UTF strings.

Trinity Bugzilla: http://bugs.trinitydesktop.org/show_bug.cgi?id=569
3.5.12 is OK with no errors, 3.5.13 reports JS regex errors, and the collapse/expand comments links no longer work (first four of a long list of error messages follow).

Error: http://bugs.trinitydesktop.org/js/yui/yahoo-dom-event/yahoo-dom-event.js: SyntaxError: Invalid regular expression
Error: http://bugs.trinitydesktop.org/show_bug.cgi?id=569: TypeError: Attempted to access 'onDOMReady' property on undefined object (result of expression YAHOO.util.Event.onDOMReady)
Error: http://bugs.trinitydesktop.org/show_bug.cgi?id=569: TypeError: Attempted to access 'removeClass' property on undefined object (result of expression YAHOO.util.Dom.removeClass)
Error: http://bugs.trinitydesktop.org/show_bug.cgi?id=569: TypeError: Attempted to access 'getX' property on undefined object (result of expression YAHOO.util.Dom.getX)


Youtube, http://www.youtube.com/watch?v=BYzJ7ElwPWs&hd=1
3.5.12 is OK with no errors.  3.5.13: "Show more" link doesn't work, JS console reports errors (again first four of a long list)
Error: http://s.ytimg.com/yt/jsbin/www-core-vfleHrebX.js: SyntaxError: Invalid regular expression
Error: http://www.youtube.com/watch?v=BYzJ7ElwPWs&hd=1: TypeError: Value undefined (result of expression yt.setConfig) is not an object. Cannot be called.
Error: http://www.youtube.com/watch?v=BYzJ7ElwPWs&hd=1: TypeError: Value undefined (result of expression yt.setConfig) is not an object. Cannot be called.
Error: http://www.youtube.com/watch?v=BYzJ7ElwPWs&hd=1: TypeError: Value undefined (result of expression yt.setMsg) is not an object. Cannot be called.
Error: http://www.youtube.com/watch?v=BYzJ7ElwPWs&hd=1: TypeError: Value undefined (result of expression yt.setConfig) is not an object. Cannot be called.
Error: http://www.youtube.com/watch?v=BYzJ7ElwPWs&hd=1: TypeError: Attempted to access 'subscribe' property on undefined object (result of expression yt.pubsub.subscribe)


PHPbbs uses AJAX from Yahoo and Google APIs for many functions and they no longer work, again this was clean on 3.5.12, again the first error reported is an invalid JS regex:

Error: http://www.partyvibe.com/forums/clientscript/yui/yuiloader-dom-event/yuiloader-dom-event.js,qv=417.pagespeed.ce.AGEBGqKOJH.js: SyntaxError: Invalid regular expression
Error: http://www.partyvibe.com/forums/clientscript/yui/connection/connection-min.js,qv=417.pagespeed.ce.FhCd5mku7f.js: TypeError: Value undefined (result of expression YAHOO.util.CustomEvent) is not an object. Cannot be used with new.
Error: http://www.partyvibe.com/forums/clientscript/vbulletin-core.js,qv=417.pagespeed.ce.CZG5KnuAvR.js: TypeError: Value undefined (result of expression YAHOO.util.CustomEvent) is not an object. Cannot be used with new.
Error: http://www.partyvibe.com/forums/clientscript/vbulletin_multi_quote.js,qv=417.pagespeed.ce.Xnnpkkfe5J.js: TypeError: Attempted to access 'subscribe' property on undefined object (result of expression vB_XHTML_Ready.subscribe)
Error: http://www.partyvibe.com/forums/clientscript/vbulletin-editor.js?v=417: TypeError: Attempted to access 'subscribe' property on undefined object (result of expression vB_XHTML_Ready.subscribe)
Error: http://www.partyvibe.com/forums/clientscript/vbulletin_quick_edit.js,qv=417.pagespeed.ce.C7-_IQElb4.js: TypeError: Attempted to access 'attachinfo' property on undefined object (result of expression vBulletin.attachinfo)
Error: http://www.partyvibe.com/forums/clientscript/vbulletin_ajax_taglist.js,qv=417.pagespeed.ce.6jvNRZKPxD.js: TypeError: Attempted to access 'subscribe' property on undefined object (result of expression vB_XHTML_Ready.subscribe)
Error: http://www.partyvibe.com/forums/clientscript/vbulletin_ajax_suggest.js?v=417: TypeError: Attempted to access property on null object (result of expression webkit_version[1])
Comment 3 Nick Leverton 2011-12-17 06:15:31 CST
I think the problem is that libkjs isn't finding libpcre and hence only allows non-perl-compatible regexes.  ldd shows a big difference between libkjs 3.5.12:

ldd /opt/trinity/lib/libkjs.so.1.2.0 | sort
        /lib/ld-linux.so.2 (0xb7844000)
        libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7520000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7502000)
        libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb7666000)
        libpcre.so.3 => /lib/libpcre.so.3 (0xb7782000)
        libpcreposix.so.3 => /usr/lib/libpcreposix.so.3 (0xb77b5000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb768c000)
        linux-gate.so.1 =>  (0xb7843000)

and 3.5.13:
        (snip 40 lines of library linkages which doesn't show libpcre)

libpcre-dev is definitely installed by the Debian build system, but apparently not being picked up by whatever is in place of ./configure nowadays.

The autoconf test is in kjs/configure.in.in.
Comment 4 Timothy Pearson 2011-12-17 13:25:34 CST
Raising priority to block R14.0 release as fix should be relatively simple.
Comment 5 Timothy Pearson 2011-12-21 00:15:32 CST
Created attachment 235 [details]
Enable pcre support in kdelibs
Comment 6 Nick Leverton 2011-12-24 12:19:23 CST
Fix confirmed - thanks so much for a brilliant Christmas present :-)
Comment 7 Nick Leverton 2011-12-26 10:47:46 CST
Only difference I can see is that we now pull in libpcre instead of libpcreposix.  However I think this is OK because

1) Javascript REs are a bastardised early version of PCREs and not POSIX REs.

2) KDE4 libkjs also uses plain libpcre

3) With the patch, I haven't yet found any regressions that are still regressed.

Thanks again,

Nick
Comment 8 Timothy Pearson 2012-01-08 03:09:26 CST
Committed to GIT in hash b911168.

Thanks for reporting and testing!