[
https://issues.apache.org/jira/browse/HTTPCLIENT-1812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15852901#comment-15852901
]
Harald Brennich commented on HTTPCLIENT-1812:
---------------------------------------------
1. Evidently Java code should not be able to crash the JVM. But
CloseableHttpClient.execute under certain conditions seems to be able to do so.
2. After modifying the applications source code from
CloseableHttpClient client =
HttpClients.custom().setConnectionManager(connManager).build();
to
clientBuilder = HttpClients.custom();
clientBuilder.setConnectionManager(connManager);
...
CloseableHttpClient client = clientBuilder.build();
the SIGSEGV disappears, but the qually mysterious OutOfMemory Exception appears.
3. The execute works only after specifying a suitable useragent via
clientBuilder = HttpClients.custom();
clientBuilder.setConnectionManager(connManager);
. if (!useragent.isEmpty()) clientBuilder.setUserAgent(
useragent);
This gives me the impression .that the client can not handle the server
response in the case when no useragent was specified. Maybe because the
response does not conform to HTTP protocol, but even in this case some other
exception should be thrown.
> CloseableHttpClient.execute generates SIGSEGV in jvm
> ----------------------------------------------------
>
> Key: HTTPCLIENT-1812
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1812
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient (classic)
> Affects Versions: 4.5.2, 4.5.3
> Environment: openjdk version "1.8.0_121"
> OpenJDK Runtime Environment (IcedTea 3.3.0) (suse-6.4-x86_64)
> OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
> Reporter: Harald Brennich
> Attachments: hs_error.log
>
>
> I am using HttpComponents to read a specific web page. This worked fine until
> yesterday (02/03/2017). Now, on executing a request to the URI
> http://www.timeanddate.com/astronomy/germany/munich, the JVM reports a
> SIGSEGV. See attachment.for version 4.53. Version 4.5.2 was similar.
> On slightly modifying the calling java code by instantiating the
> HttpClientBuilder before building the CloseableHttpClient, instead of
> sigsegving an exception is thrown:
> "
> java.lang.OutOfMemoryError: Java heap space
> sun.security.ec.ECKeyPairGenerator.generateECKeyPair(Native Method)
>
> sun.security.ec.ECKeyPairGenerator.generateKeyPair(ECKeyPairGenerator.java:126)
>
> java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:704)
> sun.security.ssl.ECDHCrypt.<init>(ECDHCrypt.java:78)
>
> sun.security.ssl.ClientHandshaker.serverKeyExchange(ClientHandshaker.java:717)
>
> sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:278)
> sun.security.ssl.Handshaker.processLoop(Handshaker.java:913)
> sun.security.ssl.Handshaker.process_record(Handshaker.java:849)
> sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1033)
>
> sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1342)
> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1369)
> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1353)
>
> org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396)
>
> org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355)
>
> org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
>
> org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
>
> org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
>
> org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
>
> org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
> org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
>
> org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
>
> org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
>
> org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
>
> org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
> "
> Finally, on setting the user agent (via HttpClientBuilder.setUserAgent) to
> "Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0" the
> CloseableHttpClient.execute works again (as it did previously)
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]