Bug 165897
Summary: | XMLHttpRequest timeout in 60 second in Safari on iOS 10 and above | ||
---|---|---|---|
Product: | WebKit | Reporter: | Rahul Tiwari <rahult001> |
Component: | Page Loading | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Major | CC: | achristensen, ap, beidson, youennf |
Priority: | P2 | ||
Version: | Safari 10 | ||
Hardware: | iPhone / iPad | ||
OS: | iOS 10 |
Rahul Tiwari
ajax request time out in 60 second in Safari on iOS 10 and above.
the attached url calls a php script that sleeps 60 seconds. It works fine (display alert window and say 'done') in firefox, and will not work in Safari (blank alert window).
Below is the slightly modified script.
test.php?duration=59 will be fine
test.php?duration=60 will be failed.
test.php
------
<script src="javascripts/prototype.js" type="text/javascript"></script>
<script>
var myAjax = new Ajax.Request(
'http://devel.charmm-gui.org/sleep.php',
{
method: 'get',
parameters: 'duration=<?=$_GET['duration']?>',
onComplete: showResponse
});
function showResponse(oReq) {
alert(oReq.responseText);
}
</script>
----
sleep.php
----
<?
sleep($_GET['duration']);
echo 'done';
----
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Brady Eidson
Youenn, didn't we fix this in an iOS update? Or has that not yet shipped?
youenn fablet
It is probably a duplicate of bug 163814 which landed early October.
I don't know whether that shipped yet though.
Alexey Proskuryakov
Seems like the fix should have shipped in iOS 10.2 this week. Could you please re-test?
Alexey Proskuryakov
There was another related fix just two days ago, which obviously hasn't shipped yet, see bug 165821.
Rahul Tiwari
I had checked it in iOS 10.2(Build 14U593) and it still exists.
Alex Christensen
Could you test to see if https://trac.webkit.org/changeset/209776 fixed your issue? See https://webkit.org/blog/3457/building-webkit-for-ios-simulator/ for instructions to check Webkit changes on iOS. It should work with Xcode newer than 6.1.1, too.
Rahul Tiwari
I am trying to test if https://trac.webkit.org/changeset/209776 fixed the issue.
But while building WebKit for iOS Simulator by running -
Tools/Scripts/build-webkit --ios-simulator
Getting below error -
Check dependencies
Base.xcconfig line 23: Unable to find included file "../../../../Internal/Configurations/HaveInternalSDK.xcconfig"
Base.xcconfig line 23: Unable to find included file "../../../../Internal/Configurations/HaveInternalSDK.xcconfig"
OS X deployment target '10.11' for architecture 'x86_64' and variant 'normal' is greater than the maximum value '10.10' for the OS X 10.10 SDK.
Ld /Users/vgarg/AppleWebkit/webkit/WebKitBuild/Release/LayoutTestRelay normal x86_64
cd /Users/vgarg/AppleWebkit/webkit/Tools/LayoutTestRelay
export MACOSX_DEPLOYMENT_TARGET=10.11
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -L/Users/vgarg/AppleWebkit/webkit/WebKitBuild/Release -F/Users/vgarg/AppleWebkit/webkit/WebKitBuild/Release -F/Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks -filelist /Users/vgarg/AppleWebkit/webkit/WebKitBuild/LayoutTestRelay.build/Release/LayoutTestRelay.build/Objects-normal/x86_64/LayoutTestRelay.LinkFileList -Xlinker -rpath -Xlinker /Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks -mmacosx-version-min=10.11 -framework CoreSimulator -framework AppKit -fobjc-arc -fobjc-link-runtime -Xlinker -dependency_info -Xlinker /Users/vgarg/AppleWebkit/webkit/WebKitBuild/LayoutTestRelay.build/Release/LayoutTestRelay.build/Objects-normal/x86_64/LayoutTestRelay_dependency_info.dat -o /Users/vgarg/AppleWebkit/webkit/WebKitBuild/Release/LayoutTestRelay
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_SimServiceContext", referenced from:
objc-class-ref in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld /Users/vgarg/AppleWebkit/webkit/WebKitBuild/Release/LayoutTestRelay normal x86_64
(1 failure)
Died at Tools/Scripts/build-webkit line 205.
Alex Christensen
I'm not terribly familiar with that code, but if you open Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj and play with the #defines in CoreSimulatorSPI.h or main.m. We should fix this, but it probably won't cause any problems for you for this purpose to just comment out any code necessary to get it compiling. You're not going to use LayoutTestRelay to verify this.
Rahul Tiwari
I tried to comment out #defines in CoreSimulatorSPI.h and tried few other workarounds as well but unfortunately could not get the build successful for command - Tools/Scripts/build-webkit --ios-simulator
I have a limited knowledge of C/Objective C as so far have been mostly working with Java/J2EE related technologies. It would be great if somebody else can verify if https://trac.webkit.org/changeset/209776 fixed the issue or help me over to get this build running.
Also which version of Safari/iOS would be containing the fix(https://trac.webkit.org/changeset/209776) ?
Brady Eidson
(In reply to comment #9)
> I tried to comment out #defines in CoreSimulatorSPI.h and tried few other
> workarounds as well but unfortunately could not get the build successful for
> command - Tools/Scripts/build-webkit --ios-simulator
>
> I have a limited knowledge of C/Objective C as so far have been mostly
> working with Java/J2EE related technologies. It would be great if somebody
> else can verify if https://trac.webkit.org/changeset/209776 fixed the issue
> or help me over to get this build running.
>
> Also which version of Safari/iOS would be containing the
> fix(https://trac.webkit.org/changeset/209776) ?
That fix has shipped in Safari Technology Preview on macOS
Rahul Tiwari
(In reply to comment #10)
> (In reply to comment #9)
> > I tried to comment out #defines in CoreSimulatorSPI.h and tried few other
> > workarounds as well but unfortunately could not get the build successful for
> > command - Tools/Scripts/build-webkit --ios-simulator
> >
> > I have a limited knowledge of C/Objective C as so far have been mostly
> > working with Java/J2EE related technologies. It would be great if somebody
> > else can verify if https://trac.webkit.org/changeset/209776 fixed the issue
> > or help me over to get this build running.
> >
> > Also which version of Safari/iOS would be containing the
> > fix(https://trac.webkit.org/changeset/209776) ?
>
> That fix has shipped in Safari Technology Preview on macOS
Hey Brady
I had raised this issue for Safari on iOS. When will this be shipped on iOS ?
Brady Eidson
(In reply to comment #11)
> (In reply to comment #10)
> > (In reply to comment #9)
> > > I tried to comment out #defines in CoreSimulatorSPI.h and tried few other
> > > workarounds as well but unfortunately could not get the build successful for
> > > command - Tools/Scripts/build-webkit --ios-simulator
> > >
> > > I have a limited knowledge of C/Objective C as so far have been mostly
> > > working with Java/J2EE related technologies. It would be great if somebody
> > > else can verify if https://trac.webkit.org/changeset/209776 fixed the issue
> > > or help me over to get this build running.
> > >
> > > Also which version of Safari/iOS would be containing the
> > > fix(https://trac.webkit.org/changeset/209776) ?
> >
> > That fix has shipped in Safari Technology Preview on macOS
>
> Hey Brady
> I had raised this issue for Safari on iOS. When will this be shipped on iOS ?
With my WebKit hat on, my reply is:
The WebKit open source project is not in charge of future product releases from any particular vendor.
With my Apple hat on, my reply is:
Apple generally doesn't comment on specific future product releases.
Also with my Apple hat on:
Safari Technology Preview is a glimpse of WebKit changes that Apple plans to ship in future Safari's on both macOS and iOS.
Rahul Tiwari
(In reply to comment #8)
> I'm not terribly familiar with that code, but if you open
> Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj and play with the #defines
> in CoreSimulatorSPI.h or main.m. We should fix this, but it probably won't
> cause any problems for you for this purpose to just comment out any code
> necessary to get it compiling. You're not going to use LayoutTestRelay to
> verify this.
I tried to comment out #defines in CoreSimulatorSPI.h and tried few other workarounds as well but unfortunately could not get the build successful for command - Tools/Scripts/build-webkit --ios-simulator
I have limited knowledge of C/Objective C as so far have been mostly working with Java/J2EE related technologies. It would be great if somebody else can verify if https://trac.webkit.org/changeset/209776 fixed the issue or help me over to get this build running.
Alex Christensen
Safari Technology Preview only exists on Mac and is not useful for verifying this iOS-specific change that fixed an iOS-specific problem.
To get the build working, comment out this code in Tools/Scripts/build-webkit:
if (willUseIOSSimulatorSDK()) {
(system("perl", "Tools/Scripts/build-layouttestrelay", argumentsForConfiguration()) == 0) or die;
}
Rahul Tiwari
As suggested i tried commenting out this code in Tools/Scripts/build-webkit -
if (willUseIOSSimulatorSDK()) {
(system("perl", "Tools/Scripts/build-layouttestrelay", argumentsForConfiguration()) == 0) or die;
}
This got me below error -
/AppleWebkit1/webkit/Source/WTF/wtf/Platform.h:592:5: error: 'TARGET_OS_IOS' is not defined, evaluates to 0 [-Werror,-Wundef]
#if TARGET_OS_IOS
To try to resolve this I added following line to platform.h -
#define TARGET_OS_IOS 1
This gave below error -
/AppleWebkit1/webkit/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h:162:12: error: cannot find interface declaration for 'CASpringAnimation'; did you mean
'CABasicAnimation'?
@interface CASpringAnimation (Private)
^~~~~~~~~~~~~~~~~
CABasicAnimation
To try to resolve this replaced below line in QuartzCoreSPI.h -
@interface CASpringAnimation (Private) with @interface CABasicAnimation (Private)
This gave below error -
/AppleWebkit1/webkit/Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm:60:23: error: property 'preferredFramesPerSecond' not found on object of type
'CADisplayLink *'
m_displayLink.preferredFramesPerSecond = 60;
^
1 error generated.
Can you please suggest how to resolve the above error and if we are moving in the right direction ?
Alex Christensen
Just comment out the line with preferredFramesPerSecond in it. I don't think it'll critically break anything. Definitely heading in the right direction.
Rahul Tiwari
(In reply to comment #16)
> Just comment out the line with preferredFramesPerSecond in it. I don't
> think it'll critically break anything. Definitely heading in the right
> direction.
Moving ahead tried below mentioned steps -
Error:
/AppleWebkit1/webkit/Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm:60:23: error: property 'preferredFramesPerSecond' not found on object of type
'CADisplayLink *'
m_displayLink.preferredFramesPerSecond = 60;
Action Taken:
Commented out preferredFramesPerSecond in the DisplayRefreshMonitorIOS.mm file.
Error:
Users/vgarg/AppleWebkit1/webkit/Source/WebCore/platform/gamepad/cocoa/GameControllerGamepad.mm:40:31: error: use of undeclared identifier 'GCControllerPlayerIndex'; did you mean
'GCControllerPlayerIndexUnset'?
controller.playerIndex = (GCControllerPlayerIndex)(GCControllerPlayerIndex1 + index);
^~~~~~~~~~~~~~~~~~~~~~~
GCControllerPlayerIndexUnset
Action Taken:
Commented out the above line.
Error:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h:74:29: note:
'kCGColorSpaceSRGB' has been explicitly marked unavailable here
CG_EXTERN const CFStringRef kCGColorSpaceSRGB
^
/Users/vgarg/AppleWebkit1/webkit/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:112:72: error: use of undeclared identifier 'kCGColorSpaceDisplayP3'; did you mean
'ColorSpaceDisplayP3'?
static CGColorSpaceRef displayP3Space = CGColorSpaceCreateWithName(kCGColorSpaceDisplayP3);
^~~~~~~~~~~~~~~~~~~~~~
ColorSpaceDisplayP3
Action Taken:
Replaced line “static CGColorSpaceRef displayP3Space = CGColorSpaceCreateWithName(kCGColorSpaceDisplayP3);” with “static CGColorSpaceRef displayP3Space = displayP3Space;”.
Error:
/Users/vgarg/AppleWebkit1/webkit/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:86:67: error: 'kCGColorSpaceSRGB' is unavailable: not available on iOS
static CGColorSpaceRef sRGBSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
Action Taken:
Commented out the method content and all the lines which were calling it.
Error:
/Users/vgarg/AppleWebkit1/webkit/Source/WebCore/html/HTMLInputElement.cpp:1985:12: error: no matching constructor for initialization of 'WTF::String'
return String { selectionDirection() };
How should we go about tackling the above error ?
Rahul Tiwari
As getting Webkit build running is taking a lot of time for us, can somebody else here test to verify if the fix (https://trac.webkit.org/changeset/209776) resolves the time out of 60 seconds in Safari on iOS 10 and above ?
This will make things faster.
Alexey Proskuryakov
I believe the fix should be available in iOS 10.3 public beta 1. Can you try that?