RFR: 8196136: AArch64: Correct register use in patch for JDK-8195685

Andrew Haley aph at redhat.com
Thu Jan 25 12:23:22 UTC 2018


On 25/01/18 11:24, Andrew Dinn wrote:
> JDK-8195685 introduced aarch64 patches to complete the interface lookup
> changes made in JDK-8174962. This included a patch to the generated
> itable stubs which employed r0 as a scratch register. Unfortunately,
> this causes problems in the very rare case where the stub fields an
> interface call with 7 arguments. r0 is used to hold the 7th argument in
> the stub call so the stub code corrupts the supplied argument. This
> manifested in the maven setup for jcstress tests.

OK, I've found the call so I can confirm the diagnosis.

  Interface method
  org.codehaus.plexus.component.configurator.converters.ConfigurationConverter.fromConfiguration(
   org.codehaus.plexus.component.configurator.converters.lookup.ConverterLookup,
   org.codehaus.plexus.configuration.PlexusConfiguration,
   java.lang.Class,
   java.lang.Class,
   java.lang.ClassLoader,
   org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator,
   org.codehaus.plexus.component.configurator.ConfigurationListener)

is called from

  org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(
   org.codehaus.plexus.configuration.PlexusConfiguration,
   java.lang.ClassLoader,
   org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator)

fromConfiguration has 8 args (7 + this) and the arg which gets
corrupted is indeed ComponentValueSetter.listener, Argument 8 in the
call.  I can see this in the debugger:

org.codehaus.plexus.component.configurator.converters.ComponentValueSetter
{0x00000007219346c0} - klass: 'org/codehaus/plexus/component/configurator/converters/ComponentValueSetter'
 - ---- fields (total size 8 words):
 - private final 'object' 'Ljava/lang/Object;' @12  a 'org/apache/maven/plugins/shade/resource/ManifestResourceTransformer'{0x00000007219346a0} (e43268d4 e4326922)
 - private final 'fieldName' 'Ljava/lang/String;' @16  "mainClass"{0x0000000721934910} (e4326922 dfce3c71)
 - private final 'lookup' 'Lorg/codehaus/plexus/component/configurator/converters/lookup/ConverterLookup;' @20  a 'org/codehaus/plexus/component/configurator/converters/lookup/DefaultConverterLookup'{0x00000006fe71e388} (dfce3c71 0)
 - private 'setter' 'Ljava/lang/reflect/Method;' @24  NULL (0 0)
 - private 'setterParamType' 'Ljava/lang/Class;' @28  NULL (0 0)
 - private 'setterTypeConverter' 'Lorg/codehaus/plexus/component/configurator/converters/ConfigurationConverter;' @32  NULL (0 0)
 - private 'setterTypeArguments' '[Ljava/lang/reflect/Type;' @36  NULL (0 e4326aa9)
 - private 'field' 'Ljava/lang/reflect/Field;' @40  a 'java/lang/reflect/Field'{0x0000000721935548} (e4326aa9 dfc08605)
 - private 'fieldType' 'Ljava/lang/Class;' @44  a 'java/lang/Class'{0x00000006fe043028} = 'java/lang/String' (dfc08605 dfce3c9a)
 - private 'fieldTypeConverter' 'Lorg/codehaus/plexus/component/configurator/converters/ConfigurationConverter;' @48  a 'org/codehaus/plexus/component/configurator/converters/basic/StringConverter'{0x00000006fe71e4d0} (dfce3c9a 0)
 - private 'fieldTypeArguments' '[Ljava/lang/reflect/Type;' @52  NULL (0 3f99b)
 - private final 'listener' 'Lorg/codehaus/plexus/component/configurator/ConfigurationListener;' @56
Program received signal SIGSEGV, Segmentation fault.

Good catch!

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the jdk-dev mailing list