Bug 190518 - Safari crashes when viewing Construct HTML5 game in iframe
Summary: Safari crashes when viewing Construct HTML5 game in iframe
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 11
Hardware: iPhone / iPad iOS 12
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-12 05:22 PDT by Valera Popov
Modified: 2018-10-15 01:16 PDT (History)
5 users (show)

See Also:


Attachments
Safari crash logs and the webpage source (9.18 MB, application/zip)
2018-10-12 05:22 PDT, Valera Popov
no flags Details
New crash report (80.82 KB, text/plain)
2018-10-13 02:10 PDT, Valera Popov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Valera Popov 2018-10-12 05:22:56 PDT
Created attachment 352158 [details]
Safari crash logs and the webpage source

Safari crashes when viewing Construct HTML5 game (https://www.construct.net) in iframe. Viewing the same game NOT on iframe is ok. 
Here's the example of such game:
– No crash: http://valerypopoff.ru/construct/_crash_in_mob_safari/
– Crash: http://valerypopoff.ru/construct/_crash_in_mob_safari/index_iframe.html

Steps to Reproduce:
1. Open http://valerypopoff.ru/construct/_crash_in_mob_safari/index_iframe.html

Expected Results:
The webpage is shown

Actual Results:
Safari crashes with "This web page was reloaded because a problem occurred"

Configuration:
IPhone 6S
IOS 12.1, IOS 12.1

Attached safari crash logs and the webpage source.
Comment 1 Radar WebKit Bug Importer 2018-10-12 11:18:49 PDT
<rdar://problem/45231694>
Comment 2 Alexey Proskuryakov 2018-10-12 13:50:24 PDT
The included crash is for SafariViewService, which is not used by Safari (it's used by other apps via SFSafariViewController). Could you please check if it's the correct one?
Comment 3 Simon Fraser (smfr) 2018-10-12 15:55:58 PDT
The game is using too much memory; there's about 900MB used by WebGL (lots of textures?).
Comment 4 Simon Fraser (smfr) 2018-10-12 15:57:40 PDT
Also I see about the same memory use in the iframe and non-iframe cases.
Comment 5 Valera Popov 2018-10-13 02:10:13 PDT
Created attachment 352253 [details]
New crash report
Comment 6 Valera Popov 2018-10-13 02:18:18 PDT
(In reply to Alexey Proskuryakov from comment #2)
> The included crash is for SafariViewService, which is not used by Safari
> (it's used by other apps via SFSafariViewController). Could you please check
> if it's the correct one?

The thing is, I can't find Safari's crash report on my PC (\Users\<username>\AppData\Roaming\Apple Computer\Logs\CrashReporter\MobileDevice\<device name>). I can't find it on my Mac either (~/Library/Logs/CrashReporter/MobileDevice/). Though, I sync my iPhone properly and I can see files created, like, a minute ago in the CrashRepoprter folder. The closest thing to a Safari crash report is SafariViewService which I think is also legit because I opened the link that crashes in Telegram App first and then switched to Safari by tapping on the Safari icon.

I opened the crashing link again several times (Safari crashed again and again) and then synced one more time. Still, no Safari crash reports in the corresponding folder. But this time I found a new SafariViewService crash report ("New crash report" in the attachments) that has "https_ok-test.glitch.me" in it's Termination Description which is the address of a website where I initially published the game that makes Safari crash.

If you know how to retrieve Safari crash reports, please tell me and I'll do this.
Comment 7 Valera Popov 2018-10-13 02:30:57 PDT
(In reply to Simon Fraser (smfr) from comment #3)
> The game is using too much memory; there's about 900MB used by WebGL (lots
> of textures?).

That sounds about right. When I checked it was about 707MB. The game uses a lot of textures, right.

Does "too much memory" mean that it must be crashing? I thought it's just slow when there's not enough memory. Also it crashes on both iPhone 6s and iPhoneX.

(In reply to Simon Fraser (smfr) from comment #4)
> Also I see about the same memory use in the iframe and non-iframe cases.

Sure, this is the same game.
Comment 8 Simon Fraser (smfr) 2018-10-13 10:35:20 PDT
You have a limit of about 800MB for the entire web process, so web content has a max of maybe 600MB to play with. Go over that, and the OS will kill the process if other things need memory.
Comment 9 Valera Popov 2018-10-15 01:16:32 PDT
(In reply to Simon Fraser (smfr) from comment #8)
> You have a limit of about 800MB for the entire web process, so web content
> has a max of maybe 600MB to play with. Go over that, and the OS will kill
> the process if other things need memory.

I see. Thanks for the explanation. Not a bug then, right?