[JBoss JIRA] (JGRP-1877) System.nanoTime() can be negative
by Bela Ban (JIRA)
[ https://issues.jboss.org/browse/JGRP-1877?page=com.atlassian.jira.plugin.... ]
Bela Ban edited comment on JGRP-1877 at 9/11/14 10:26 AM:
----------------------------------------------------------
Investigate:
* -Responses-
* -Promise-
* _Request (UnicastRequest, GroupRequest)_
* -MessageDispatcher / RpcDispatcher: sync RPCs-
* ExpiryCache
* -TimeService-
* Discovery: ping responses
was (Author: belaban):
Investigate:
* -Responses-
* -Promise-
* Request (UnicastRequest, GroupRequest)
* MessageDispatcher / RpcDispatcher: sync RPCs
* ExpiryCache
* TimeService
* Discovery: ping responses
> System.nanoTime() can be negative
> ---------------------------------
>
> Key: JGRP-1877
> URL: https://issues.jboss.org/browse/JGRP-1877
> Project: JGroups
> Issue Type: Bug
> Reporter: Bela Ban
> Assignee: Bela Ban
> Priority: Critical
> Fix For: 3.5.1, 3.6
>
>
> According to the javadoc, {{System.nanoTime()}} should only be used to measure _elapsed time_, but not compute a _target time in the future_, as {{nanoTime()}} might return a a time in the future.
> Code like the one below might fail:
> {code:title=Responses.waitFor()|borderStyle=solid}
> public boolean waitFor(long timeout) {
> long wait_time;
> final long target_time=System.nanoTime() + TimeUnit.NANOSECONDS.convert(timeout, TimeUnit.MILLISECONDS); // ns
> lock.lock();
> try {
> while(!done && (wait_time=target_time - System.nanoTime()) > 0) {
> try {
> cond.await(wait_time,TimeUnit.NANOSECONDS);
> }
> catch(InterruptedException e) {
> }
> }
> return done;
> }
> finally {
> lock.unlock();
> }
> }
> {code}
> When computing {{target_time}}, {{System.nanoTime()}} could return a negative value (numeric overflow) or a value in the future. In the first case, {{target_time}} could be negative, so the method would not block at all. In the latter case, {{target_time}} could be huge, so the method would block for a long time.
> Investigate all occurrences where we use {{nanoTime()}} to compute a time in the future, and see what impact a future value value could have. Possibly replace with {{System.currentTimeMillis()}} or the _time service_.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years
[JBoss JIRA] (WFLY-3834) Memory leak in org.xnio.ByteBufferSlicePool
by David Lloyd (JIRA)
[ https://issues.jboss.org/browse/WFLY-3834?page=com.atlassian.jira.plugin.... ]
David Lloyd updated WFLY-3834:
------------------------------
Workaround Description:
For a workaround, if this problem still occurs, set the following system property: {{-Djboss.remoting.pooled-buffers=false}}
This will use regular GC to manage buffers at a slight performance cost.
Workaround: Workaround Exists
> Memory leak in org.xnio.ByteBufferSlicePool
> -------------------------------------------
>
> Key: WFLY-3834
> URL: https://issues.jboss.org/browse/WFLY-3834
> Project: WildFly
> Issue Type: Bug
> Components: Domain Management
> Affects Versions: 8.1.0.Final
> Reporter: Sergey Lisovoy
> Assignee: David Lloyd
> Labels: memory_leak, memoryleak
>
> I have a simple thread that monitor remote wildfly process status. After some time it fail with OutOfMemory exception.
> I wrote simple exsample how to reproduce its error:
> {code:java}
> package ru.kamis.tests.xniomemoryleaks;
> import org.jboss.as.controller.client.ModelControllerClient;
> import org.jboss.as.controller.client.helpers.Operations;
> import org.jboss.dmr.ModelNode;
> public class OutOfMemoryDemo {
> public static void main(String[] args) throws Exception {
>
> for(int i=0; i<1000000; i++) {
> ModelControllerClient client = null;
> client = ModelControllerClient.Factory.create("localhost", 9990);
>
> ModelNode operation = Operations.createReadAttributeOperation(new ModelNode().setEmptyList(), "server-state");
> client.execute(operation);
>
> client.close();
>
> if(i % 1000 == 0) {
> System.out.println("Processed: " + i);
> }
> }
> }
> }
> {code}
> Program produces folowing output:
> {noformat}
> сен 09, 2014 2:33:20 PM org.xnio.Xnio <clinit>
> INFO: XNIO version 3.2.2.Final
> сен 09, 2014 2:33:20 PM org.xnio.nio.NioXnio <clinit>
> INFO: XNIO NIO Implementation Version 3.2.2.Final
> сен 09, 2014 2:33:20 PM org.jboss.remoting3.EndpointImpl <clinit>
> INFO: JBoss Remoting version 4.0.3.Final
> Processed: 0
> Processed: 1000
> Processed: 2000
> Processed: 3000
> Processed: 4000
> Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
> at java.lang.String.toCharArray(String.java:2746)
> at sun.net.www.ParseUtil.encodePath(ParseUtil.java:107)
> at sun.misc.URLClassPath$JarLoader.checkResource(URLClassPath.java:757)
> at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:842)
> at sun.misc.URLClassPath.getResource(URLClassPath.java:199)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:358)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
> at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:119)
> at org.jboss.as.protocol.ProtocolConnectionManager$EstablishingConnection.connect(ProtocolConnectionManager.java:256)
> at org.jboss.as.protocol.ProtocolConnectionManager.connect(ProtocolConnectionManager.java:70)
> at org.jboss.as.protocol.mgmt.FutureManagementChannel$Establishing.getChannel(FutureManagementChannel.java:204)
> at org.jboss.as.controller.client.impl.RemotingModelControllerClient.getOrCreateChannel(RemotingModelControllerClient.java:148)
> at org.jboss.as.controller.client.impl.RemotingModelControllerClient$1.getChannel(RemotingModelControllerClient.java:67)
> at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:117)
> at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:92)
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:236)
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:141)
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:127)
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:71)
> at ru.kamis.tests.xniomemoryleaks.OutOfMemoryDemo.main(OutOfMemoryDemo.java:15)
> Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: Java heap space
> Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: Java heap space
> Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: Java heap space
> Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: Java heap space
> Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: Java heap space
> Exception in thread "RMI TCP Connection(idle)" Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: Java heap space
> java.lang.OutOfMemoryError: Java heap space
> Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: Java heap space
> Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: Java heap space
> Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: Java heap space
> Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: Java heap space
> сен 09, 2014 2:35:20 PM org.jboss.as.controller.client.impl.RemotingModelControllerClient finalize
> WARN: JBAS010600: Closing leaked controller client
> JBAS010649: Allocation stack trace:
> at java.lang.Thread.getStackTrace(Thread.java:1589)
> at org.jboss.as.controller.client.impl.RemotingModelControllerClient.<init>(RemotingModelControllerClient.java:76)
> at org.jboss.as.controller.client.ModelControllerClient$Factory.create(ModelControllerClient.java:353)
> at org.jboss.as.controller.client.ModelControllerClient$Factory.create(ModelControllerClient.java:200)
> at ru.kamis.tests.xniomemoryleaks.OutOfMemoryDemo.main(OutOfMemoryDemo.java:12)
> Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: Java heap space
> Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: Java heap space
> Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: Java heap space
> {noformat}
> Used libraries:
> {code:xml}
> <dependency>
> <groupId>org.wildfly</groupId>
> <artifactId>wildfly-controller-client</artifactId>
> <version>8.1.0.Final</version>
> </dependency>
> {code}
> The same bug is reproduced on other xnio versions: 3.2.3.Final, 3.3.0.Beta2
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years
[JBoss JIRA] (WFLY-3849) logging improvement to WFLYSEC0015 (vault security exception)
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/WFLY-3849?page=com.atlassian.jira.plugin.... ]
RH Bugzilla Integration commented on WFLY-3849:
-----------------------------------------------
Ivo Studensky <istudens(a)redhat.com> changed the Status of [bug 1073603|https://bugzilla.redhat.com/show_bug.cgi?id=1073603] from NEW to ASSIGNED
> logging improvement to WFLYSEC0015 (vault security exception)
> -------------------------------------------------------------
>
> Key: WFLY-3849
> URL: https://issues.jboss.org/browse/WFLY-3849
> Project: WildFly
> Issue Type: Enhancement
> Components: Security
> Affects Versions: 9.0.0.Alpha1
> Reporter: Ivo Studensky
> Assignee: Ivo Studensky
>
> Description of problem (taken from bz1073603):
> Include which vault property resolution has failed in following error message:
> java.lang.SecurityException: JBAS013311: Security Exception
> at org.jboss.as.security.vault.RuntimeVaultReader.retrieveFromVault(RuntimeVaultReader.java:104)
> For example, this would be helpful:
> java.lang.SecurityException: JBAS013311: Security Exception (Error resolving vault property: ${VAULT:example:example:1}
> How reproducible:
> Using a vault property that doesn't exist will give this error message.
> Steps to Reproduce:
> 1. setup vault as normal
> 2. use a vault property that doesn't exist
> Actual results:
> Get:
> java.lang.SecurityException: JBAS013311: Security Exception
> at org.jboss.as.security.vault.RuntimeVaultReader.retrieveFromVault(RuntimeVaultReader.java:104)
> Expected results:
> log message that show the property that failed
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years
[JBoss JIRA] (WFLY-3849) logging improvement to WFLYSEC0015 (vault security exception)
by Ivo Studensky (JIRA)
Ivo Studensky created WFLY-3849:
-----------------------------------
Summary: logging improvement to WFLYSEC0015 (vault security exception)
Key: WFLY-3849
URL: https://issues.jboss.org/browse/WFLY-3849
Project: WildFly
Issue Type: Enhancement
Components: Security
Affects Versions: 9.0.0.Alpha1
Reporter: Ivo Studensky
Assignee: Ivo Studensky
Description of problem (taken from bz1073603):
Include which vault property resolution has failed in following error message:
java.lang.SecurityException: JBAS013311: Security Exception
at org.jboss.as.security.vault.RuntimeVaultReader.retrieveFromVault(RuntimeVaultReader.java:104)
For example, this would be helpful:
java.lang.SecurityException: JBAS013311: Security Exception (Error resolving vault property: ${VAULT:example:example:1}
How reproducible:
Using a vault property that doesn't exist will give this error message.
Steps to Reproduce:
1. setup vault as normal
2. use a vault property that doesn't exist
Actual results:
Get:
java.lang.SecurityException: JBAS013311: Security Exception
at org.jboss.as.security.vault.RuntimeVaultReader.retrieveFromVault(RuntimeVaultReader.java:104)
Expected results:
log message that show the property that failed
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years
[JBoss JIRA] (WFLY-3847) AS7BindingRegistry does not respect the SPI contract
by Jeff Mesnil (JIRA)
Jeff Mesnil created WFLY-3847:
---------------------------------
Summary: AS7BindingRegistry does not respect the SPI contract
Key: WFLY-3847
URL: https://issues.jboss.org/browse/WFLY-3847
Project: WildFly
Issue Type: Bug
Components: JMS
Affects Versions: 8.1.0.Final
Reporter: Jeff Mesnil
Assignee: Jeff Mesnil
Priority: Minor
Fix For: 9.0.0.Alpha1
The implementation of AS7BindingRegistry#lookup always return null.
This method is called by HornetQ when JNDI entries for its resources
are updated using its own management API.
We advise against using it in WildFly (and use WildFly own management API) but we must still respect the SPI contract for this method.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years