Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash of ModuleRegistry with Play and Macbook Air M1 - no suitable image found #981

Closed
don41382 opened this issue Apr 1, 2021 · 4 comments

Comments

@don41382
Copy link

don41382 commented Apr 1, 2021

My new Macbook M1 with arm compiled Java seems to crash with the ModuleRegistry.

  • MacBook: Macbook Air M1 8-Cores, 16 GB
  • MacOs: BigSur: 11.2.3
  • Play: 2.8.5 Scala
  • Kamon: core,bundle: 2:13:2.1.14
  • JDK: Tested with Bellsoft 11.0.10-librca and Zulu 11.0.10-zulu, build for arm
  • testcontainer: 1.15.2

Exception during boot-up from Play:

12:21:57.782 [warn] - [ModuleRegistry.scala:290] - Failed to create instance of module [Process Metrics]
java.lang.UnsatisfiedLinkError: xxx/Library/Caches/JNA/temp/jna17936470892884282181.tmp: dlopen(xxx/Library/Caches/JNA/temp/jna17936470892884282181.tmp, 1): no suitable image found.  Did find:
	xxx/Library/Caches/JNA/temp/jna17936470892884282181.tmp: no matching architecture in universal wrapper
	xxx/Library/Caches/JNA/temp/jna17936470892884282181.tmp: no matching architecture in universal wrapper
	at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
	at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
	at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
	at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2627)
	at java.base/java.lang.Runtime.load0(Runtime.java:768)
	at java.base/java.lang.System.load(System.java:1837)
	at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018)
	at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
	at com.sun.jna.Native.<clinit>(Native.java:195)
	at com.sun.jna.Structure.setAlignType(Structure.java:280)
	at com.sun.jna.Structure.<init>(Structure.java:197)
	at com.sun.jna.Structure.<init>(Structure.java:193)
	at com.sun.jna.Structure.<init>(Structure.java:180)
	at com.sun.jna.Structure.<init>(Structure.java:172)
	at com.sun.jna.platform.mac.SystemB$Timeval.<init>(SystemB.java:511)
	at oshi.software.os.mac.MacOperatingSystem.<clinit>(MacOperatingSystem.java:84)
	at oshi.SystemInfo.createOperatingSystem(SystemInfo.java:111)
	at oshi.util.Memoizer$1.get(Memoizer.java:87)
	at oshi.SystemInfo.getOperatingSystem(SystemInfo.java:100)
	at kamon.instrumentation.system.process.ProcessMetricsCollector$MetricsCollectionTask.<init>(ProcessMetricsCollector.scala:71)
	at kamon.instrumentation.system.process.ProcessMetricsCollector.<init>(ProcessMetricsCollector.scala:40)
	at kamon.instrumentation.system.process.ProcessMetricsCollector$Factory.create(ProcessMetricsCollector.scala:177)
	at kamon.module.ModuleRegistry.createModule(ModuleRegistry.scala:283)
	at kamon.module.ModuleRegistry.$anonfun$load$3(ModuleRegistry.scala:94)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
	at scala.Option.fold(Option.scala:263)
	at kamon.module.ModuleRegistry.$anonfun$load$2(ModuleRegistry.scala:97)
	at kamon.module.ModuleRegistry.$anonfun$load$2$adapted(ModuleRegistry.scala:90)
	at scala.collection.immutable.List.foreach(List.scala:333)
	at kamon.module.ModuleRegistry.load(ModuleRegistry.scala:90)
	at kamon.ModuleLoading.loadModules(ModuleLoading.scala:66)
	at kamon.ModuleLoading.loadModules$(ModuleLoading.scala:65)
	at kamon.Kamon$.loadModules(Kamon.scala:19)
	at kamon.instrumentation.play.GuiceModule$KamonLoader.<init>(GuiceModule.scala:40)
	at kamon.instrumentation.play.GuiceModule$KamonLoader$$FastClassByGuice$$e354cfac.newInstance(<generated>)
	at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
	at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
	at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:213)
	at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:111)
	at com.google.inject.Guice.createInjector(Guice.java:87)
	at com.google.inject.Guice.createInjector(Guice.java:78)
	at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:200)
	at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:155)
	at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
	at play.core.server.DevServerStart$$anon$1.$anonfun$reload$3(DevServerStart.scala:190)
	at play.utils.Threads$.withContextClassLoader(Threads.scala:22)
	at play.core.server.DevServerStart$$anon$1.reload(DevServerStart.scala:182)
	at play.core.server.DevServerStart$$anon$1.get(DevServerStart.scala:142)
	at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:302)
	at play.core.server.AkkaHttpServer.$anonfun$createServerBinding$1(AkkaHttpServer.scala:224)
	at kamon.instrumentation.akka.http.Http2BlueprintInterceptor$HandlerWithEndpoint.apply(AkkaHttpServerInstrumentation.scala:354)
	at kamon.instrumentation.akka.http.Http2BlueprintInterceptor$HandlerWithEndpoint.apply(AkkaHttpServerInstrumentation.scala:351)
	at akka.http.impl.engine.http2.Http2Ext.$anonfun$handleUpgradeRequests$1(Http2.scala:167)
	at akka.stream.impl.fusing.MapAsyncUnordered$$anon$31.onPush(Ops.scala:1404)
	at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:541)
	at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:423)
	at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:625)
	at akka.stream.impl.fusing.ActorGraphInterpreter$SimpleBoundaryEvent.execute(ActorGraphInterpreter.scala:56)
	at akka.stream.impl.fusing.ActorGraphInterpreter$SimpleBoundaryEvent.execute$(ActorGraphInterpreter.scala:52)
	at akka.stream.impl.fusing.ActorGraphInterpreter$BatchingActorInputBoundary$OnNext.execute(ActorGraphInterpreter.scala:95)
	at akka.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:600)
	at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:773)
	at akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:788)
	at akka.actor.Actor.aroundReceive(Actor.scala:537)
	at akka.actor.Actor.aroundReceive$(Actor.scala:535)
	at akka.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:691)
	at akka.actor.ActorCell.receiveMessage(ActorCell.scala:577)
	at akka.actor.ActorCell.invoke(ActorCell.scala:547)
	at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:270)
	at akka.dispatch.Mailbox.run(Mailbox.scala:231)
	at kamon.instrumentation.executor.ExecutorInstrumentation$InstrumentedForkJoinPool$TimingRunnable.run(ExecutorInstrumentation.scala:678)
	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
@SimunKaracic
Copy link
Contributor

We're gonna upgrade our oshi dependency in the next release, which should fix the issue. I didn't find this specific one on their repo, but there's been a whole slew of changes there to acomodate new M1's with ARM.
Until then, a workaround is to disable the offending module:
kamon.modules.process-metrics.enabled = false in your .conf file should do the trick!

I'll let you know when the release drops so you can try again, and if the issue persists, we'll open a bug at oshi

@don41382
Copy link
Author

don41382 commented Apr 1, 2021

Thanks man! And yes, it looks like oshi fixed the issue in their library:

oshi/oshi#1462 (comment)

@SimunKaracic
Copy link
Contributor

Fixed in 2.1.16!

@don41382
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants