Bug 88673 - REGRESSION: Cannot log in to webanketa.com
Summary: REGRESSION: Cannot log in to webanketa.com
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh Intel OS X 10.6
: P1 Major
Assignee: Nobody
URL: http://webanketa.com
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2012-06-08 11:04 PDT by Maxim
Modified: 2013-02-19 09:48 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim 2012-06-08 11:04:45 PDT
I can't log in into the site "webanketa.com" in normal mode with latest Safari 5.1.7
But if turn on debug mode, log in is successful. Looks like JS optimizations error. Similar problem was in Opera, when they are start to optimize JS code.

Under Windows this version Safari work without any problems.
Comment 1 Alexey Proskuryakov 2012-06-08 15:46:26 PDT
Can you please explain what "debug mode" is? Are you saying that you can log in only with Web Inspector open?

Did you try WebKit nightly builds from <http://nightly.webkit.org/>?
Comment 2 Maxim 2012-06-09 08:56:23 PDT
(In reply to comment #1)
> Can you please explain what "debug mode" is? Are you saying that you can log in only with Web Inspector open?
> 
> Did you try WebKit nightly builds from <http://nightly.webkit.org/>?

Yes, "debug mode" = "Show Web Inspector" / "Scripts" / "Enable Debugging". And yes, I can log in only in this mode.

I don't have access to MacOS system for testing => I can't test nightly build right now. It can take few days. Sorry. But if you can't repeat this problem and nightly build will be work under MacOS X 10.6, I'll test it.

thank you.
Comment 3 Maxim 2012-06-11 07:51:53 PDT
With nightly build of WebKit r119961 still can't log in. (but can in debugging mode )
Comment 4 Alexey Proskuryakov 2012-06-11 12:31:06 PDT
I can reproduce this.
Comment 5 Alexey Proskuryakov 2012-06-11 12:37:31 PDT
<rdar://problem/11639508>
Comment 6 Maxim 2012-09-13 08:42:35 PDT
similar reports:

https://discussions.apple.com/message/18001083#18001083

https://github.com/Caligatio/jsSHA/issues/3

5 month old bug with SHA-js libraries.
Any news about fix? :)
Comment 7 Alexey Proskuryakov 2012-09-13 09:32:34 PDT
You could help by providing an isolated test case, as minimal as possible.
Comment 8 Maxim 2012-09-13 15:57:45 PDT
(In reply to comment #7)
> You could help by providing an isolated test case, as minimal as possible.

Unfortunately I do not have access to Mac OS :( You can try to ask about it the authors of SHA-libraries. May be some one from them can help us?
Comment 9 Maxim 2012-09-13 16:07:37 PDT
comment from one of jsSHA users:
I did a bunch of debugging as well, and found that the error seems to sit in the rotr_64 function. Its a stupid simple function, but it appears to be a 64/32 bit issue. Safari can only run in 64 bit mode now, but when run in 32 bit mode on older versions of OS X, reports are that it works as expected. I will leave that with you.
Comment 10 Brian T 2012-10-18 14:52:38 PDT
jsSHA dev weighing in here

I just got contacted by a major company that happens to be a jsSHA reporting that iOS6 devices are also apparently having issues.  Unfortunately, much like Maxim, I don't have a 64-bit Mac device laying around to troubleshoot this on but I can tell you what OSes/Browsers *do* work:
 - Firefox on Win7 x64
 - Chrome on Win7 x64
 - IE9 on Win7 x64
 - IE9 x64 on Win7 x64
 - Firefox on Snow Leopard (32-bit)
 - Safari 5 on Snow Leopard (32-bit)
 - Chrome on Snow Leopard (32-bit)
 - Firefox on Linux x64
 - Chrome on Linux x64

I'm more than willing to commit time to helping solve this if someone can somehow donate time on an affected device.
Comment 11 Maxim 2012-11-22 01:49:25 PST
comment from one of jsSHA users:
I think I have found the problem. The rotr_64 function seems to mutate its argument. I do this:

rotr_64 = function (x, n) {
 x = new Int_64(x.highOrder, x.lowOrder);
 ...

and that seems to fix the problem.
Comment 12 Maxim 2012-11-23 13:11:54 PST
(In reply to comment #7)
> You could help by providing an isolated test case, as minimal as possible.

Looks like this is very hard task, because problem in JS optimizer. Any change of code fix this problem and can add another in another place.

Here one more comment of jsSHA users after test fix:
This is enough to fix the bug too:
  var foo = typeof x;

Or this:
  var foo = typeof n;

Or this:
  var foo = typeof 1;

...

Yes, the fix you pushed "works", but almost certainly not for the reason that you think it does. In particular, it has nothing to do with destructive changes to X, and it has nothing to do with undefined values in X. This is shown by the fact that you can "fix" the problem by adding (certain kinds of) dead code.
Comment 13 Maxim 2012-11-26 01:09:58 PST
(In reply to comment #7)
> You could help by providing an isolated test case, as minimal as possible.

http://www.flownet.com/ron/weird_bug.html
This page will output additional information when browser has problem.
Author: https://github.com/Caligatio/jsSHA/issues/3#issuecomment-10707633
Comment 14 Alexey Proskuryakov 2013-02-16 21:56:01 PST
> http://www.flownet.com/ron/weird_bug.html
> This page will output additional information when browser has problem.

This says "Dead code has not run" for me. Does it mean that the issue no longer occurs?
Comment 15 Maxim 2013-02-19 06:03:08 PST
(In reply to comment #14)
> Does it mean that the issue no longer occurs?

Dead code writed for "jsSHA" and this is just workaround - not a solution.
I use Paj's SHA-1 library ( http://pajhome.org.uk/crypt/md5/ ), which has no "Dead code" as workaround, and I can't test it on Mac :(
Need to test on Mac for confirm.
Comment 16 Alexey Proskuryakov 2013-02-19 08:47:27 PST
I have a Mac. What can I do to confirm whether the issue is fixed? The web site works, and the test provided in comment 13 is unclear to me.
Comment 17 Maxim 2013-02-19 09:08:16 PST
(In reply to comment #16)
> I have a Mac. What can I do to confirm whether the issue is fixed? The web site works, and the test provided in comment 13 is unclear to me.

If you can login into webanketa.com and test script output "Dead code has not run" - looks like problem was fixed. What version of Safari do you use?
Comment 18 Alexey Proskuryakov 2013-02-19 09:48:26 PST
Safari 6.0.2 on OS X 10.8.2.