naver/ngrinder

java.lang.UnsatisfiedLinkError occurs to run ngrinder agent on M1 Pro mac book.

heegu78 opened this issue ยท 3 comments

1. Describe the bug ๐Ÿž

โ— DO NOT ASK QUESTION HERE PLEASE USE DISCUSSION INSTEAD.

A clear and concise description of what the bug is.

2. Reproduction steps

  1. Go to the directory where the ngrinder agent is installed.
  2. run as './run_agent.sh'
  3. See error
heegu@heegubook ngrinder-agent % ./run_agent.sh
2022-08-01 14:08:05,542 INFO  agent config: NGRINDER_AGENT_HOME : /Users/heegu/.ngrinder_agent
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/heegu/Library/Caches/JNA/temp/jna4357353381305728823.tmp: dlopen(/Users/heegu/Library/Caches/JNA/temp/jna4357353381305728823.tmp, 0x0001): tried: '/Users/heegu/Library/Caches/JNA/temp/jna4357353381305728823.tmp' (fat file, but missing compatible architecture (have (i386,x86_64), need (arm64e)))
	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 org.ngrinder.common.util.SystemInfoUtils.<clinit>(SystemInfoUtils.java:59)
	at org.ngrinder.NGrinderAgentStarter.checkDuplicatedRun(NGrinderAgentStarter.java:280)
	at org.ngrinder.NGrinderAgentStarter.main(NGrinderAgentStarter.java:208)
heegu@heegubook ngrinder-agent %

3. Environment

  • Controller
    • OS: Mac Monterey (12.5(21G72) MacBook Pro(16ํ˜•, 2021๋…„ ๋ชจ๋ธ))
    • Browser: Chrome latest
    • JDK version: OpenJDK Runtime Environment Zulu11.54+25-CA (build 11.0.14.1+1-LTS)
    • Controller version: nGrinder v3.5.5-p1
  • Agent
    • OS: Mac Monterey (12.5(21G72) MacBook Pro(16ํ˜•, 2021๋…„ ๋ชจ๋ธ))
    • JDK version: OpenJDK Runtime Environment Zulu11.54+25-CA (build 11.0.14.1+1-LTS)
    • Agent version: nGrinder v3.5.5-p1

4. Screenshots

If necessary, add screenshots to help explain your problem.

-- my solution
I found a similar subject on github.
https://stackoverflow.com/questions/71252965/java-lang-unsatisfiedlinkerror-when-starting-the-play-project

So, I deleted the two files jna-5.6.0.jar and jna-platform-5.6.0.jar and added the jna-5.12.1.jar and jna-platform-5.12.1.jar files.

So, I checked that it was running normally as shown below.
Please modify the jna library to use the upgraded one when building.

heegu@heegubook ngrinder-agent % ./run_agent.sh
2022-08-01 14:19:14,968 INFO  agent config: NGRINDER_AGENT_HOME : /Users/heegu/.ngrinder_agent
2022-08-01 14:19:15,610 INFO  starter: ***************************************************
2022-08-01 14:19:15,610 INFO  starter:    Start nGrinder Agent ...
2022-08-01 14:19:15,610 INFO  starter: ***************************************************
2022-08-01 14:19:15,610 INFO  starter: JVM server mode is disabled.
2022-08-01 14:19:15,747 INFO  starter: connecting to controller 127.0.0.1:16001
2022-08-01 14:19:15,779 INFO  agent controller daemon: The agent controller daemon is started.
2022-08-01 14:19:15,811 INFO  agent controller: Connected to agent controller server at /127.
0.0.1:16001
2022-08-01 14:19:15,811 INFO  agent controller: Waiting for agent controller server signal

java 2022-08-01 14-34-15

Hi, @ heegu78

Thank you for reporting the issue. This issue is fixed by #882. We didn't aware of this issue but, after bumping up Oshi, the JNA version we depends on also bumped up.

So, next release will not have this issue. Please waiting for next release or you can build the .war yourself with develop branch that already fixed this issue. Or the workaround you suggested would be good also.

@imbyungjun we didn't release the version include #882. did it?

Close this issue because the fixed version 3.5.6 is released.