Calling webpage EXC_BAD_ACCESS / KERN_INVALID_ADDRESS failed in Safari

I have a web application that launches what seems like an iOS8 bug in Safari, and I'm looking for clues on what setting and how to get around it.

The error is characterized by a โ€œProblem with this web page, therefore it was reloadedโ€, which appears at the top of the page after the user has spent enough time navigating in Safari. Something seems to be crashing behind the scenes, and Safari is just doing fine graceful recovery. Reading the crash log showed this:

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x00000000 Triggered by Thread: 0 Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 JavaScriptCore 0x2d4291d4 0x2d24a000 + 1962452 1 JavaScriptCore 0x2d50e166 0x2d24a000 + 2900326 2 JavaScriptCore 0x2d2bc88c 0x2d24a000 + 469132 ... 

Research hinted that instances of translate3d and keyframe could be to blame for CSS files. Although getting rid of them seemed to make the mistake less likely to be repeated, the error still exists. Likewise, reducing the size of a (very, very large) CSS file associated with pages that are most likely to cause an error would help, but would not make it go away.

My company is processing a bunch of mobile-optimized commerce-oriented web applications, and this is the only problem that seems to fix this error; I have no idea what makes this particular application such an angry little special snowflake, but I would like to figure it out and fix it. Does anyone have any ideas on what might cause the error and how can we get around it?

+8
javascript css safari mobile-safari ios8
source share
3 answers

I had the same problem as described. In my case, a crash occurred when the part of the application that controlled several DOM elements (i.e. Element.style.width ...) was completed. Upon completion, these elements were intentionally removed from the DOM. After that, it crashed without any JS errors. With an attempt and an error, I highlighted which parts of the code are responsible for this, and in my case, commenting out all the lines of element.style. *, The problem is solved - the application no longer crashes. This problem was only related to mobile safari (iOS 7 and 8), other browsers worked fine.

The wild hunch is that maybe something strange happens during garbage collection and is related to the DOM elements that JS controls.

+2
source share

Review applicable JavaScript and CSS lines for possible syntax violations. A good IDE editor should highlight potential issues in order to facilitate this effort. Also check out the generated HTML page source for poorly formed pages. Problems with the page format can create erratic behavior for some browsers, but do not show any problems for others.

Another diagnostic procedure you should try is to disable or comment on various sections of JavaScript code and / or CSS lines to try to isolate the location of the problem. Take out large sections, as it is possible to have a function page that does not cause an error. Then include or not comment on the lines until the error returns. Repeat this process until the problem area is highlighted for correction.

Also consider changing the sequence in which CSS definitions are made in a very "very" CSS file. This can lead to different behavior on the page, which can either fix the problem or help show the cause of the problem.

+1
source share

I have the same problem with safari on iOS 8.1.3.

Actually the browser is a little crazy. I have an extra download button in my application that is connected to download the next 20 entries. Sometimes, when you open the page and click on the link, the safari crashes with the message "There is a problem with this web page, therefore it has been reloaded."

After a failure and reboot, it will crash every time. But when it works, it is also stable.

Finally, I solved the problem by limiting the number of loaded records to 10, so that perhaps I could do something using memory.

Also, this problem arose in a number of other places, such as loading images or just loading some data through ajax.

What is more fun is that iOS never has chrome, which actually uses the webview component.

I'm not sure that this will help you, but it is not only your application, so if the apple does not work together and does not release a stable browser, we can try to bypass some of its limitations.

+1
source share

All Articles