Bug 191835 - Safari 12.0.1 Page freezes with spinning beachball that seems related to javascript
Summary: Safari 12.0.1 Page freezes with spinning beachball that seems related to java...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 12
Hardware: Mac macOS 10.14
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-11-19 06:08 PST by Steve Alex
Modified: 2018-11-27 11:51 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Alex 2018-11-19 06:08:40 PST
Working on a Rails 5.1 application in development mode. While I have a little javascript in the application it appears tied to rails-ujs or jquery_ujs library and not my code.

This is very intermittent and usually will show up on a Rails CRUD delete link, which calls a ujs 'Confirm' alert. The delete link will be unresponsive and a spinning beach ball will come on and off.

Thinking I had a javascript error I tried to open the Develop: show web inspector or console and the links will be greyed out. Can't get into web inspector

I can reload the page and the beach ball will go away but the web inspector links are still greyed out. Clicking on the delete link will bring the beach ball back.

Closing the Safari window and opening a new window will fix everything for maybe days until the intermittent bug shows up.

I have also seen this happen on viewing a page on stackoverflow.com, but don't know if web inspectors links are greyed out before I went to the site.

I have not tried Chrome and see if happens there, but will. That would point to rails-ujs problem,  I did switch back to jquery_ujs for a bit and think I still had the problem.

Have not found any posts with a web search that looks related. Would be glad to provide any additional information if I can get any suggestions on where to look or what to try.
Comment 1 Alexey Proskuryakov 2018-11-19 21:25:50 PST
Could you please post detailed steps to reproduce the issue, with a link to a test page where this would happen?
Comment 2 Steve Alex 2018-11-21 06:09:18 PST
re:  you please post detailed steps to reproduce the issue, with a link to a test page where this would happen?

I wish I could reproduce the exact step, but I have not tracked it down and just seems intermittent.

It seems to happen more often though so you may be lucky.

http://icash.stevealex.us/reports

has a 'Test Destroy Button' that should bring up a Confirm alert'.  When it fails nothing happens. The button may work the first few times, but eventually fails.

Just browse around the site a little.  This is just a demo site so you can't hurt anything. oo to accounts and open a few ledgers and then go back to the reports page.

When it fails the delete button does nothing (actual all links on page fail and developer links greyed out.

I think I got chrome to fail once so it sounds like it just is an error in some javascript library. May not be a webkit bug, but you'll get blamed until we track it down.
Comment 3 Steve Alex 2018-11-21 06:55:52 PST
I did get Chrome to fail, At least it lets me see and error

Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH

It is not loading my .js file.  Safari seems to load it initially and some error occurs and I don't know what it is.
Comment 4 Alexey Proskuryakov 2018-11-21 19:56:14 PST
Thank you! The error you got from Chrome seems to indicate an external problem - either the server produces a malformed response, or some networking gear in between mangles it.

Since Chrome and Safari use entirely separate networking stack implementations, it is unlikely that the issue is on the browser side.

Searching the web for "net::ERR_CONTENT_LENGTH_MISMATCH" produces some useful looking info too.
Comment 5 Steve Alex 2018-11-22 04:39:00 PST
The error I got in chrome was on my demo server, a nginx proxy pass. I forgot to set:

proxy_buffering off;

and chrome had a problem with the buffer size (i guess) but safari didn't. Setting it to off got them both working.

My problem is mostly seen on Rail in development mode on my laptop and javascript is servered from the assets pipeline, no nginx or compiled assets.

It is still intermittent and is only caused by a rails 'Confirm' alert box.  I get it both with rails-us or jQuery_ujs (I've switch what one is used several times). Still can't fine a sequence of events when it happens.

I did have web inspector open once and looking at javascript events (I'm not proficient with web inspector) when I got the lock up, going to the web inspector page caused a beach ball and then it closed.

I'll continue to look for a sequence but when the problem pops up, whatever cause the develop web inspector 'Show Web Inspector" link to be grayed out must point to the problem in same way (busy? waiting to finish?). I see nothing unusual in Activity Monitor. Safari if fine (can go to other pages, tabs, etc), it's just my page with a delete link will not function, even if I reload it.
Comment 6 Steve Alex 2018-11-22 04:43:38 PST
I see that status was changed it invalid.

I still have the problem, just can't trace it.

I request to reopen it if I can find more information.

Thanks for your help.
Comment 8 Alexey Proskuryakov 2018-11-22 11:52:37 PST
Yes, re-opening since the networking error was unrelated. I couldn't reproduce, unfortunately.
Comment 9 Radar WebKit Bug Importer 2018-11-22 11:52:59 PST
<rdar://problem/46215084>
Comment 10 Steve Alex 2018-11-23 04:21:30 PST
I've found a reproducible sequence, at least on my MacBook Air. I don't have another box running safari 12.0.1.  This does not even require my code.

1 Open a new Safari window.

2 Go to URL: https://www.w3schools.com/js/tryit.asp?filename=tryjs_confirm

3 Click on the 'Try it' button and click Ok in the dialog

4 Using a bookmark go to another site ( I went DrudgeReport, don't think it matters)

5 Using the back arrow go back to the previous page (w3schools)

6 Try clicking on 'Try it' button. On my system will will fail. (Develop 'Show Web Inspector' links grayed out etc)


If I try this sequence with Web Inspector open, it will work, but the w3schools site will report a js error

The source list for Content Security Policy directive 'script-src' contains an invalid source: ''strict-dynamic''. It will be ignored.

The same sequence using my demo site will fail with my test destroy link, now on home page.
Comment 11 Alexey Proskuryakov 2018-11-27 11:51:07 PST
Thank you for the repro steps, that helps a lot!

Turns out that this is a bug outside WebKit, so Apple will need to fix it in some other code internally. The issue will be tracked as <rdar://problem/46215084> by Apple.