[Webkit-unassigned] [Bug 236692] New: Webapp fails in iOS when using revokeObjectURL

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 15 23:31:04 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=236692

            Bug ID: 236692
           Summary: Webapp fails in iOS when using revokeObjectURL
           Product: WebKit
           Version: Safari 15
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Images
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: avner.moshkovitz at gmail.com
                CC: sabouhallawa at apple.com

I have a web app that loads images from a zip file, and displays them successively.  
The zip file can store many images.  
To prevent from running out of memory, the memory is managed, by cleaning the memory from previous images before showing the next image.  
This is done by:
- setting the *buffer* to null.
- revoking the object url and setting the *url* to null.

This approach works well on various OSs such as *Windows, Linux, and MacOS*.  
**But on iOS it fails**.  

In the example, a set of images from a zip file is displayed in a loop, to mimic a zip file with many images.  

Setting the variable *doDebugMemoryLeakOn_iOS_withRevoke* to true, activates the code


    URL.revokeObjectURL(fileInfo.url);


which causes the problem, after some time (after ~1100 images on my iPad Pro).  
The problem can be seen by running the program and selecting the zip file:   
https://cdn.jsdelivr.net/gh/avnermosh/example8_memoryLeakOn_iOS/example8_take2_3images.zip

(or any other zip file with several jpeg images - the linked zip file simply contains 3 images in size of 4032x3024)

At some point, the program fails with an error message: "The I/O read operation failed"

This happens on various *iOS* devices (e.g. *iPad*, *iPhone8*) with various *iOS* versions (*iOS 15.2, iOS 14.8.1*) when played in various browsers (e.g. *Safari, Chrome, Firefox*) after about 1000 images.  
It also happens in a native iOS app that uses *WKWebView*.  
I suspect that there may be a problem with the *WKWebView* browser engine, which is common to all these browsers.  

Note: several places commented on [adjusting the Safari settings](https://developer.apple.com/forums/thread/684843) e.g. *GPU Process: Canvas Rendering*  
This somewhat deferred the problem but at some point the error still occurs.  
After the problem occurs, there is no way to recover programatically, e.g. by retrying to read the zip file entry or skipping to the next zip entry.  
The only solution is to select the file again.  


Could this indicate a bug in *WKWebView*?  
How can this be fixed, or worked around?  

Thanks  


p.s. I also placed the question [on stackoverflow](https://stackoverflow.com/questions/71122643/webapp-fails-in-ios-when-using-revokeobjecturl) that describes the problem in details and shows a link to the online example that demonstrates the problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220216/87fd91c5/attachment.htm>


More information about the webkit-unassigned mailing list