Alexei Fedotov wrote:
As Mark said [1], the main difference in socket handling between jvms
is system call interruption. DRLVM sends termination signals to system
calls before stop the world garbage collection, hence they should be
restarted (i.e. any system call should be put in a loop).
Thanks!
[1] http://markmail.org/thread/kbs7bfcnkcfggyc4
Thanks Alexei!
after applying patch [1] I could pass HttpsURLConnectionTest. I'm not
sure whether it's the best way to resolve this, and I think we need to
find out a way that classlib can work with both drlvm and IBM vme
painless. I'm familiar with signals handling, is it possible to define
some macros to deal with the signals and retry system calls, and we can
add build options to select turn it on or off?
[1]
Index: modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
=====================================================================
--- modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
+++ modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
@@ -71,15 +71,20 @@ selectRead
my_pollfd.fd = hysocketP->sock;
my_pollfd.events = POLLIN | POLLPRI;
my_pollfd.revents = 0;
- result = poll (&my_pollfd, 1, timeout);
-
- if (result == 0)
- return HYPORT_ERROR_SOCKET_TIMEOUT;
- if (result == -1)
- return HYPORT_ERROR_SOCKET_OPFAILED;
+ while (1) {
+ result = poll (&my_pollfd, 1, timeout);
+ if (result == 0)
+ return HYPORT_ERROR_SOCKET_TIMEOUT;
- return result;
+ if (result == -1 && errno == EINTR) {
+ continue;
+ }
+ if (result == -1)
+ return HYPORT_ERROR_SOCKET_OPFAILED;
+
+ return result;
+ }
}
--
Best Regards,
Regis.