FF 123.0 broke my GWT app
Categories
(Core :: JavaScript Engine: JIT, defect)
Tracking
()
People
(Reporter: horia.muntean, Assigned: anba)
References
(Regression)
Details
(Keywords: regression)
Attachments
(8 files)
94.52 KB,
image/png
|
Details | |
72.61 KB,
image/png
|
Details | |
46.77 KB,
image/png
|
Details | |
113.62 KB,
image/png
|
Details | |
65.20 KB,
image/png
|
Details | |
Bug 1882386: Correctly handle empty search string case when inlining String.p.lastIndexOf. r=jandem!
48 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1882386: Correctly handle empty search string case when inlining String.p.lastIndexOf. r=jandem!
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
Bug 1882386: Correctly handle empty search string case when inlining String.p.lastIndexOf. r=jandem!
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-release+
|
Details | Review |
Steps to reproduce:
I have a GWT (Google Web Toolkit) app that suddenly breaks after upgrading to FF 123.0; it worked with no problems until this version.
Actual results:
The NumberFormat code started to yield strage results breaking all numeric fields validations.
Expected results:
Work without issues. All other browsers - Edge, Opera, Chrome, Safari work with no issues.
I will attach a print-screen from a debug session where one can see the same function (java_lang_String_$endsWith__Ljava_lang_String_2Ljava_lang_String_2Z) being called twice with the same arguments ("10", "") but giving two different results (one call gotPositiveSuffix=true, gotNegativeSuffix=false).
The app itself is not available to the public but I can provide more private info if needed.
Comment 1•9 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Fenix::General' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Reporter | ||
Updated•9 months ago
|
Reporter | ||
Comment 2•9 months ago
|
||
Reporter | ||
Comment 3•9 months ago
|
||
I have added some log lines to "function java_lang_String_$endsWith__Ljava_lang_String_2Ljava_lang_String_2Z" which is the one that seems to produce the problem and I am posting the results below in an image (why-false.png). One can see that when the function is called with args "500" and "" it returns false (that is not correct); this is strange because if I run the return expression in the console I get true (which is correct).
For the reference, the modified function is
function java_lang_String_$endsWith__Ljava_lang_String_2Ljava_lang_String_2Z(this$static, suffix){
console.log(typeof this$static);
console.log(this$static);
console.log(suffix);
console.log(this$static.lastIndexOf(suffix) != -1 && this$static.lastIndexOf(suffix) == this$static.length - suffix.length);
return this$static.lastIndexOf(suffix) != -1 && this$static.lastIndexOf(suffix) == this$static.length - suffix.length;
}
I did try to see how it behave in a separate file and it returns correct results; so how is it possible that the same function yields different results with the same parameters when run in different context.
Comment 4•9 months ago
|
||
Sorry, i couldn't reproduce on Firefox 123.0
Step I'm using
- Create a demo application via
./gwt-2.11.0/webAppCreator -out test org.example.test
- Edit
src/org/example/client/test.java
, addimport com.google.gwt.i18n.client.NumberFormat;
and inonModuleLoad
function adddouble val = NumberFormat.getDecimalFormat().parse("10"); nameField.setText("GWT User: " + NumberFormat.getDecimalFormat().format(val));
afterfinal TextBox nameField = new TextBox();
- Edit
build.xml
add
<arg line="-optimize"/> <arg value="0"/> <arg line="-saveSource"/> <arg line="-XmethodNameDisplayMode"/> <arg value="FULL"/> <arg line="-style"/> <arg value="DETAILED"/>
in gwtc section ,just after<arg value="war"/>
- Package with
ant war
- Deploy generated war file into
Tomcat 9
. - Visit the url and debug
test-0.js
Reporter | ||
Comment 5•9 months ago
|
||
(In reply to jackyzy823 from comment #4)
Created attachment 9388052 [details]
image.pngSorry, i couldn't reproduce on Firefox 123.0
Step I'm using
- Create a demo application via
./gwt-2.11.0/webAppCreator -out test org.example.test
- Edit
src/org/example/client/test.java
, addimport com.google.gwt.i18n.client.NumberFormat;
and inonModuleLoad
function adddouble val = NumberFormat.getDecimalFormat().parse("10"); nameField.setText("GWT User: " + NumberFormat.getDecimalFormat().format(val));
afterfinal TextBox nameField = new TextBox();
- Edit
build.xml
add
<arg line="-optimize"/> <arg value="0"/> <arg line="-saveSource"/> <arg line="-XmethodNameDisplayMode"/> <arg value="FULL"/> <arg line="-style"/> <arg value="DETAILED"/>
in gwtc section ,just after<arg value="war"/>
- Package with
ant war
- Deploy generated war file into
Tomcat 9
.- Visit the url and debug
test-0.js
I tried your suggestion also with gwt-2.5.1 and can't reproduce it either in such a simple project; the generated javascript for the function is quite different in gwt-2.11.0 vs gwt-2.5.1 but is the same in the app with the problem and this simple one generated with gwt-2.5.1 yet in one environment it returns a different result when called with the same input;
Any suggestion about what can I do to advance with this issue would be appreciated.
The same project worked for years in all major browsers, only this last version of Firefox has this issue.
Reporter | ||
Comment 6•9 months ago
|
||
Reporter | ||
Comment 7•9 months ago
|
||
I was able to reproduce it with gwt-2.5.1 !
Follow the steps from above but call parse in a loop - probably some kind of optimization kicks in ?
for (int i = 0; i < 1000; i++) {
double val = NumberFormat.getDecimalFormat().parse("10");
nameField.setText("GWT User: " + NumberFormat.getDecimalFormat().format(val));
}
What I get in the browser console iss
This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”. blank
GET
http://127.0.0.1:3002/favicon.ico
[HTTP/1.1 404 Not Found 3ms]
This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”. 060F808CA325307F2BEBAC7BC2106E19.cache.html
Uncaught TypeError: stackMessage is undefined
handleError http://127.0.0.1:3002/___vscode_livepreview_injected_script:233
<anonymous> http://127.0.0.1:3002/___vscode_livepreview_injected_script:14
EventListener.handleEvent* http://127.0.0.1:3002/___vscode_livepreview_injected_script:14
___vscode_livepreview_injected_script:233:20
Uncaught
Object { java_lang_Throwable_detailMessage: "10 does not have either positive or negative affixes" }
060F808CA325307F2BEBAC7BC2106E19.cache.html:446:7
com_google_gwt_core_client_impl_Impl_entry__Lcom_google_gwt_core_client_JavaScriptObject_2Lcom_google_gwt_core_client_JavaScriptObject_2 http://127.0.0.1:3002/war/test/060F808CA325307F2BEBAC7BC2106E19.cache.html:446
gwtOnLoad http://127.0.0.1:3002/war/test/060F808CA325307F2BEBAC7BC2106E19.cache.html:7244
maybeStartModule http://127.0.0.1:3002/war/test/test.nocache.js:40
onScriptLoad http://127.0.0.1:3002/war/test/test.nocache.js:278
<anonymous> http://127.0.0.1:3002/war/test/060F808CA325307F2BEBAC7BC2106E19.cache.html:7252
I attached an screen shot (for-loop.png)
Reporter | ||
Comment 8•9 months ago
|
||
Reporter | ||
Comment 9•9 months ago
|
||
And I reproduced it with a plain html file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>String EndsWith Function Test</title>
<script>
function endsWith(text, suffix){
return text.lastIndexOf(suffix) != -1 && text.lastIndexOf(suffix) == text.length - suffix.length;
}
function callFunctionInLoop() {
for (let i = 0; i < 1000; i++) {
var res = endsWith("500", "");
console.log(res);
}
}
</script>
</head>
<body>
<button onclick="callFunctionInLoop()">Test EndsWith Function</button>
</body>
</html>
If one presses "Test EndsWith Function" button for the first time, one will get 11 true returns and 989 false returns !!! Next button pushes will make the function return only false.
Attached a screen shot (ff.png).
Updated•9 months ago
|
Comment 10•9 months ago
|
||
4:43.04 INFO: Last good revision: 1cd3cffeda1bbc916f13235acd07d9c70e6c5aca
4:43.04 INFO: First bad revision: a45a5a1a1c7f7ccf50275176de827f2a9f1c9776
4:43.04 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=1cd3cffeda1bbc916f13235acd07d9c70e6c5aca&tochange=a45a5a1a1c7f7ccf50275176de827f2a9f1c9776
Updated•9 months ago
|
Comment 11•9 months ago
|
||
:anba, since you are the author of the regressor, bug 1873042, could you take a look?
For more information, please visit BugBot documentation.
Assignee | ||
Updated•9 months ago
|
Assignee | ||
Comment 12•9 months ago
|
||
(In reply to horia.muntean from comment #9)
And I reproduced it with a plain html file:
Thanks for the reduced test case!
Assignee | ||
Comment 13•9 months ago
|
||
Updated•9 months ago
|
Comment 14•9 months ago
|
||
Set release status flags based on info from the regressing bug 1864323
Updated•9 months ago
|
Comment 15•9 months ago
|
||
Comment 16•9 months ago
|
||
André, would that be a safe uplift for our planned dot release on Tuesday or should we target 124? Thanks
Assignee | ||
Comment 17•9 months ago
|
||
(In reply to Pascal Chevrel:pascalc from comment #16)
André, would that be a safe uplift for our planned dot release on Tuesday or should we target 124? Thanks
Yes, I think this is safe enough for the dot release.
Comment 18•9 months ago
|
||
(In reply to André Bargull [:anba] from comment #17)
(In reply to Pascal Chevrel:pascalc from comment #16)
André, would that be a safe uplift for our planned dot release on Tuesday or should we target 124? Thanks
Yes, I think this is safe enough for the dot release.
Could you ask an uplift for beta and release please? We build the dot release on Monday. Thanks!
Assignee | ||
Comment 19•9 months ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D203248
Updated•9 months ago
|
Comment 20•9 months ago
|
||
Uplift Approval Request
- String changes made/needed: None
- Explanation of risk level: Low risk because it only changes the return value for the JIT code path of "lastIndexOf" when the search string is the empty string.
- Risk associated with taking this patch: Low risk
- Fix verified in Nightly: no
- Needs manual QE test: no
- Is Android affected?: yes
- Code covered by automated testing: yes
- Steps to reproduce for manual QE testing: None
- User impact if declined: Wrong result for String.prototype.lastIndexOf after JIT-inlining when the search string is the empty string.
Assignee | ||
Comment 21•9 months ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D203248
Updated•9 months ago
|
Comment 22•9 months ago
|
||
Uplift Approval Request
- Risk associated with taking this patch: Low risk
- Needs manual QE test: no
- Fix verified in Nightly: no
- Explanation of risk level: Low risk because it only changes the return value for the JIT code path of "lastIndexOf" when the search string is the empty string.
- String changes made/needed: None
- Code covered by automated testing: yes
- Steps to reproduce for manual QE testing: None
- Is Android affected?: yes
- User impact if declined: Wrong result for String.prototype.lastIndexOf after JIT-inlining when the search string is the empty string.
Comment 23•9 months ago
|
||
bugherder |
Updated•9 months ago
|
Updated•9 months ago
|
Comment 24•9 months ago
|
||
uplift |
Updated•9 months ago
|
Updated•9 months ago
|
Comment 25•9 months ago
|
||
uplift |
Reporter | ||
Comment 26•9 months ago
|
||
Hi,
I can confirm FF 123.0.1 fixed the issue, the GWT app works fine now.
Thanks!
Assignee | ||
Comment 27•9 months ago
|
||
(In reply to horia.muntean from comment #26)
Hi,
I can confirm FF 123.0.1 fixed the issue, the GWT app works fine now.
Thanks!
Thank you for confirming the update fixed this issue!
Description
•