RFR: 8301737: java/rmi/server/UnicastRemoteObject/serialFilter/FilterUROTest.java fail with -Xcomp [v2]

SUN Guoyun duke at openjdk.org
Tue Feb 7 02:47:43 UTC 2023


On Mon, 6 Feb 2023 15:35:30 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> Please add @bug 8301737
> 
> It is not going to be obvious why a larger code cashe is needed (and only for aarch64).
> 
The error message in the .jtr file is `java.rmi.NoSuchObjectException: no such object in table`, which corresponding source code is as follows:
<pre><code class="java">
// src/java.rmi/share/classes/sun/rmi/transport/Transport.java
176             if (target == null || (impl = target.getImpl()) == null) {          // target is null
177                 throw new NoSuchObjectException("no such object in table");     
178             }  
</code></pre>

why target is null with `-Xcomp`? then you see the other source code:

<pre><code class="java">
// src/java.rmi//share/classes/sun/rmi/transport/ObjectTable.java
346     private static class Reaper implements Runnable {                           
347                                                                                 
348         public void run() {                                                     
349             try {                                                               
350                 do {                                                            
351                     // wait for next cleared weak reference                     
352                     WeakRef weakImpl = (WeakRef) reapQueue.remove();   // Monitor GC here  
353                                                                                 
354                     synchronized (tableLock) {                                  
355                         Target target = implTable.get(weakImpl);                
356                         if (target != null) {                                   
357                             if (!target.isEmpty()) {                            
358                                 throw new Error(                                
359                                     "object with known references collected");  
360                             } else if (target.isPermanent()) {                  
361                                 throw new Error("permanent object collected");  
362                             }                                                   
363                             removeTarget(target);             // target will be removed after GC. which happen before getTarget()
364                         }                                                       
365                     }                                                           
366                 } while (!Thread.interrupted());                                
367             } catch (InterruptedException e) {                                  
368                 // pass away if interrupted                                     
369             }                                                                   
370         }                                                                       
371     } 

So I used `-Xlog:gc` to find that the trigger gc is caused by insufficient codecache. 
</code></pre>

> Can you split the test runs so the original does not run on aarch64 and a new second run runs only on aarch64. For example,
> 
> ```
> /*
>  * @test
>  * @bug 8301737
>  * @summary Check that objects are exported with ObjectInputFilters via UnicastRemoteObject
>  * @requires os.arch != "aarch64"
>  * @run testng/othervm FilterUROTest
>  */
> 
> /*
>  * @test
>  * @summary Check that objects are exported with ObjectInputFilters via UnicastRemoteObject
>  * @requires os.arch == "aarch64"
>  * @run testng/othervm -XX:ReservedCodeCacheSize=512m FilterUROTest
>  */
> ```
This bug only for LoongArch64 architecture, x86_64 and AArch64 is ok. Perhaps the number of instructions under the LoongArch64 architecture is higher than in aarch64/x86_64. I'm not sure if the s390/risc-v/ppc architecture has the same problem, so I`m only use `@requires os.arch == "loongarch64" `?

-------------

PR: https://git.openjdk.org/jdk/pull/12399


More information about the core-libs-dev mailing list