GDB fails with java.lang.UnsatisfiedLinkError: no spawner in java.library.path

45 views
Skip to first unread message

Alexandre Braganca

unread,
Jul 14, 2022, 12:12:18 PM7/14/22
to mbeddr-discuss
Hello everyone.
 
I am starting to use mbeddr.

I tried to install mbeddr (both 2018.2 and the latest 2021.2.5) and everything seems to work with the exception of debug.

I know of the gdb issue on Mac. I installed with brew and executed the code sign process.

I am able to generate the C and binary code from mbeddr. I am able to execute the code from mbeddr and also from a terminal. I am able to debug the binary from a terminal by using gdb. However if I try to debug from mbeddr I always get an exception: java.lang.UnsatisfiedLinkError: no spawner in java.library.path

My Mac OS is version 12.4.

I already tried with java 1.8 and java 11. 

This is the stack trace:

java.lang.UnsatisfiedLinkError: no spawner in java.library.path: [/Users/alexandrebraganca/Library/Java/Extensions, /Library/Java/Extensions, /Network/Library/Java/Extensions, /System/Library/Java/Extensions, /usr/lib/java, .]

   at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2670)

   at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)

   at java.base/java.lang.System.loadLibrary(System.java:1873)

   at org.eclipse.cdt.utils.spawner.ProcessFactory.<init>(ProcessFactory.java:39)

   at org.eclipse.cdt.utils.spawner.ProcessFactory.getFactory(ProcessFactory.java:51)

   at org.eclipse.cdt.debug.mi.core.MIProcessAdapter.createGDBProcess(MIProcessAdapter.java:116)

   at org.eclipse.cdt.debug.mi.core.MIProcessAdapter.getGDBProcess(MIProcessAdapter.java:51)

   at org.eclipse.cdt.debug.mi.core.MIProcessAdapter.<init>(MIProcessAdapter.java:38)

   at org.eclipse.cdt.debug.mi.core.MIPlugin.createCSession(MIPlugin.java:230)

   at org.eclipse.cdt.debug.mi.core.MIPlugin.createCSession(MIPlugin.java:168)

   at com.mbeddr.core.debugger.gdb.plugin.DebuggerBackendProvider_extension$1.createSession(DebuggerBackendProvider_extension.java:30)

   at com.mbeddr.core.debug.debugger.WSessionWrapperImpl.createSession(WSessionWrapperImpl.java:30)

   at com.mbeddr.core.debug.debugger.WSessionWaitingAttachedState.attach(WSessionWaitingAttachedState.java:34)

   at com.mbeddr.core.debug.debugger.WSessionImpl.attach(WSessionImpl.java:18)

   at com.mbeddr.core.debug.debugger.MSessionImpl.attach(MSessionImpl.java:58)

   at com.mbeddr.core.debug.debugger.MEDebugSessionWaitingAttachState.attach(MEDebugSessionWaitingAttachState.java:41)

   at com.mbeddr.core.debug.debugger.MIDebugSession.attach(MIDebugSession.java:197)

   at com.mbeddr.core.debug.debugger.MIDebugSessionCreator$1.run(MIDebugSessionCreator.java:42)

   at jetbrains.mps.smodel.ActionDispatcher.dispatch(ActionDispatcher.java:99)

   at jetbrains.mps.smodel.ActionDispatcher.lambda$wrap$0(ActionDispatcher.java:136)

   at jetbrains.mps.smodel.LockRunnable.run(LockRunnable.java:60)

   at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:828)

   at jetbrains.mps.smodel.WorkbenchModelAccess.runReadAction(WorkbenchModelAccess.java:85)

   at com.mbeddr.core.debug.debugger.MIDebugSessionCreator.startSession(MIDebugSessionCreator.java:40)

   at jetbrains.mps.debugger.api.runner.MPSDebugRunner.createContentDescriptor(MPSDebugRunner.java:61)

   at jetbrains.mps.debugger.api.runner.MPSDebugRunner.doExecute(MPSDebugRunner.java:46)

   at com.intellij.execution.runners.GenericProgramRunner$execute$1.invoke(GenericProgramRunner.kt:20)

   at com.intellij.execution.runners.GenericProgramRunner$execute$1.invoke(GenericProgramRunner.kt:13)

   at com.intellij.execution.impl.ExecutionManagerImpl$startRunProfile$1.invoke(ExecutionManagerImpl.kt:171)

   at com.intellij.execution.impl.ExecutionManagerImpl$startRunProfile$1.invoke(ExecutionManagerImpl.kt:70)

   at com.intellij.execution.impl.ExecutionManagerImpl$doStartRunProfile$startRunnable$1.run(ExecutionManagerImpl.kt:232)

   at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214)

   at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)

   at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196)

   at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)

   at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:350)

   at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)

   at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:133)

   at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)

   at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:189)

   at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)

   at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)

   at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)

   at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)

   at java.base/java.security.AccessController.doPrivileged(Native Method)

   at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)

   at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)

   at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:885)

   at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:754)

   at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:441)

   at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)

   at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:440)

   at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)

   at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:486)

   at com.intellij.ide.IdeEventQueue.flushQueue(IdeEventQueue.java:927)

   at jetbrains.mps.ide.make.WorkbenchMakeService$3$1.run(WorkbenchMakeService.java:241)

   at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214)

   at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)

   at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196)

   at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)

   at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:350)

   at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)

   at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:133)

   at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)

   at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:189)

   at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)

   at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)

   at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)

   at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)

   at java.base/java.security.AccessController.doPrivileged(Native Method)

   at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)

   at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)

   at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:885)

   at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:754)

   at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:441)

   at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)

   at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:440)

   at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)

   at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:486)

   at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)

   at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)

   at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)

   at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)

   at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)

   at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)


I also always see the following two error messages in MPS:

- JetBrains MPS has failed to load the environment from '/bin/zsh'. Integration with tools that rely on environment variables may work incorrectly.

- Load error: undefined path variables, mbeddr.github.core.home is undefined.   

For the moment I am unable to fix this issue.
Did anyone already faced this problem?

Thanks in advance.

Alexandre Braganca

unread,
Jul 14, 2022, 3:34:47 PM7/14/22
to mbeddr-discuss
More information regarding my problem:
- If running mbeddr 2018.2 and trying to debug I get the message "Error running '(default) mbeddr.tutorial.main.plainC.PlainCDemo': debugger could not get session from debugger backend". But the binary contains debug information and I am able to debug using gdb. Mu gdb version in Mac is 12.1 (latest)
- I also tried mbeddr in a Windows VM (version 2018.2 with the setup executable). In this case I am able to debug programs but the debug windows never shows local variables. The gdb version is 7.6.1.

I checked the PATHs for the tools and everything seems okay. I must be doing something wrong...

Alexandre Braganca

unread,
Jul 15, 2022, 2:05:53 PM7/15/22
to mbeddr-discuss
Hello.

I made some research and found the following issue: https://github.com/mbeddr/mbeddr.core/issues/1588

It seems that debugging in Mac with latter versions of gdb is not supported in MacOS Sierra. Does anyone knows if this is still a problem in Mac OS Monterey? Is there a way to install gdb 7.6 in macOS Monterey?

Nonetheless I am still unable to see local variables when debugging with mbeddr 2018.2 in Windows...

Alexandre Braganca

unread,
Jul 30, 2022, 3:36:21 PM7/30/22
to mbeddr-discuss
Hello everyone.

Just an update on my problem, and a possible solution for it.

I was able to execute MPS in macOS Monterey in a way that it is able to load the environment: I executed it from a terminal, like this: open -a /Applications/MPS\ 2021.2.app

MPS is now able to use all installed tools (e.g., cbmc). However gdb is still a problem because I only managed to install version 12.1. I guess I need an older version.

Regards 
Reply all
Reply to author
Forward
0 new messages