Dyld: could not load inserted library

Hi,

we use the * Developer Edition * Version 7.2.1 (build 14109).
Since some time we have the problem that our iOS-Builds fails when it comes to compile the Storyboards.
Some of them fail completly with the following messages:

dyld: could not load inserted library '/Users/Shared/Jenkins/Home/workspace/xxx/libinterceptor.dylib' because no suitable image found.  Did find:
	/Users/Shared/Jenkins/Home/workspace/xxx/libinterceptor.dylib: mach-o, but not built for iOS simulator

2019-08-26 13:57:40.014 ibtoold[14988:1419812] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEInterfaceBuilder/IDEInterfaceBuilder-14490.70/InterfaceBuilderKit/Utilities/IBAbstractInterfaceBuilderPlatformToolManager.m:428
Details:  Failed to attach to IBAgent-iOS with error: Error Domain=com.apple.InterfaceBuilder Code=-1 "Encountered an error communicating with IBAgent-iOS." UserInfo={NSLocalizedFailureReason=IBAgent-iOS (14996) failed to launch and exited with status 6, NSUnderlyingError=0x7ff6d48417e0 {Error Domain=com.apple.InterfaceBuilder Code=-1 "Failed to launch IBAgent-iOS via CoreSimulator spawn" UserInfo={NSLocalizedDescription=Failed to launch IBAgent-iOS via CoreSimulator spawn, NSUnderlyingError=0x7ff6d4841d00 {Error Domain=com.apple.InterfaceBuilder Code=-1 "Failed to handshake with platform tool" UserInfo={NSLocalizedFailureReason=Failed to open connection over FIFOs with platform tool, NSLocalizedDescription=Failed to handshake with platform tool, NSUnderlyingError=0x7ff6d4841cd0 {Error Domain=com.apple.InterfaceBuilder Code=-1 "" UserInfo=0x7ff6d48426d0 (not displayed)}}}}}, NSLocalizedRecoverySuggestion=Please check Console.app for crash reports for "IBAgent-iOS" for further information., NSLocalizedDescription=Encountered an error communicating with IBAgent-iOS.}
Object:   <IBCocoaTouchToolManager>
Method:   +_THREADSAFE_launchNewToolWithLaunchContext:executionContext:toolProxyClass:proxyDelegate:failureContext:requestingMethod:error:forReason:
Thread:   <NSThread: 0x7ff6cfd06140>{number = 1, name = main}
Please file a bug at https://bugreport.apple.com with this warning message and any useful information you can provide.
2019-08-26 13:57:40.017 ibtoold[14988:1419812] [MT] IBPlatformTool: *** Failed to launch tool with description <IBCocoaTouchPlatformToolDescription: 0x7ff6d5125d40> System content for IBCocoaTouchFramework-ElevenAndLater <IBScaleFactorDeviceTypeDescription: 0x7ff6d5125920> scaleFactor=2x: Encountered an error communicating with IBAgent-iOS. (Failure reason: IBAgent-iOS (14996) failed to launch and exited with status 6): Failed to launch IBAgent-iOS via CoreSimulator spawn: Failed to handshake with platform tool (Failure reason: Failed to open connection over FIFOs with platform tool): : Failed to open FIFOs for handshaking with platform tool (Failure reason: IBAgent-iOS exited before we could handshake)
/* com.apple.ibtool.errors */
/Users/Shared/Jenkins/Home/workspace/xxxx/StoryBoards/LaunchScreen.storyboard: error: Encountered an error communicating with IBAgent-iOS.
    Failure Reason: IBAgent-iOS (14996) failed to launch and exited with status 6
    Recovery Suggestion: Please check Console.app for crash reports for "IBAgent-iOS" for further information.
    Underlying Errors:
        Description: Failed to launch IBAgent-iOS via CoreSimulator spawn
        Underlying Errors:
            Description: Failed to handshake with platform tool
            Failure Reason: Failed to open connection over FIFOs with platform tool
            Underlying Errors:
                Description: 
                Recovery Suggestion: Try restarting your computer
                Underlying Errors:
                    Description: Failed to open FIFOs for handshaking with platform tool
                    Failure Reason: IBAgent-iOS exited before we could handshake

It fails only if we first get this error. otherwise it works fine.

dyld: could not load inserted library '/Users/Shared/Jenkins/Home/workspace/xxx/libinterceptor.dylib' because no suitable image found.  Did find:

/Users/Shared/Jenkins/Home/workspace/xxxr/libinterceptor.dylib: mach-o, but not built for iOS simulator**

So it seems, that only some Storyboards have the problem.

We have disabled CSR on that system and without the buildwrapper it works without a problem.

We use MacOS Mojave 10.14.5 and Xcode 10.3 triggered over our Jenkins with xcodebuild.
Is this a known problem?

Hi @flender,

I moved your post to a new topic. What version of SonarCFamily do you have installed? Could you repeat your test with SonarCFamily 6.3 and build-wrapper 6.3?

1 Like

@mpaladin
After consulting our Sonarqube-Admin it seems that we’re using a very old version of the SonarCFamily (5.1). After upgrading to 6.3 it looks like the build-wrapper is working correctly.
Now I got errors from the scanner. Here we’re using also a very old version (2.7). So I updated to version 4.0 and started the process again… still running.
If there are other errors I will open a new topic.

Thanks for you help!

Gerd

@mpaladin
Ok, even with sonar-scanner 4.0 I have the problem that it crashes on analyzing one .m-File.
Several others before worked fine:

13:13:25.101 ERROR: Exception in thread pool-3-thread-1
java.lang.IllegalStateException: exit code != 0
	at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:54)
	at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:25)
	at com.sonar.cpp.plugin.CFamilySensor.lambda$process$4(CFamilySensor.java:330)
	at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:53)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

13:13:26.127 INFO: ------------------------------------------------------------------------
13:13:26.127 INFO: EXECUTION FAILURE
13:13:26.127 INFO: ------------------------------------------------------------------------
13:13:26.128 INFO: Total time: 15:40.015s
13:13:26.186 INFO: Final Memory: 18M/77M
13:13:26.186 INFO: ------------------------------------------------------------------------
13:13:26.186 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: java.lang.IllegalStateException: exit code != 0
	at com.sonar.cpp.analyzer.AnalysisExecutor.submit(AnalysisExecutor.java:47)
	at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:317)
	at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:286)
	at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:205)
	at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
	at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:88)
	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:82)
	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:73)
	at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:88)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:182)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:312)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:307)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:281)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
	at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:81)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:132)
	at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: exit code != 0
	at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:54)
	at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:25)
	at com.sonar.cpp.plugin.CFamilySensor.lambda$process$4(CFamilySensor.java:330)
	at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:53)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source) 

I saw the same error in the thread java.lang.IllegalStateException while scanning C project with a reference to https://jira.sonarsource.com/browse/CPP-2126 , but I thought this should be fixed…

Do you need any further informations?

btw, on start of sonar-scanner I got the following warning:

12:57:46.147 INFO: Scanner configuration file: /Users/Shared/Jenkins/Home/tools/sonar-scanner-4.0.0/conf/sonar-scanner.properties
12:57:46.153 INFO: Project root configuration file: /Users/Shared/Jenkins/Home/workspace/xxx/sonar-project.properties
12:57:46.206 INFO: SonarQube Scanner 4.0.0.1744
12:57:46.206 INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
12:57:46.206 INFO: Mac OS X 10.14.5 x86_64
12:57:46.420 DEBUG: keyStore is : 
12:57:46.420 DEBUG: keyStore type is : pkcs12
12:57:46.420 DEBUG: keyStore provider is : 
12:57:46.420 DEBUG: init keystore
12:57:46.421 DEBUG: init keymanager of type SunX509
12:57:46.605 DEBUG: Create: /Users/Shared/Jenkins/.sonar/cache
12:57:46.607 INFO: User cache: /Users/Shared/Jenkins/.sonar/cache
12:57:46.607 DEBUG: Create: /Users/Shared/Jenkins/.sonar/cache/_tmp
12:57:46.697 DEBUG: Extract sonar-scanner-api-batch in temp...
12:57:46.704 DEBUG: Get bootstrap index...
12:57:46.704 DEBUG: Download: http://xxx/batch/index
12:57:46.794 DEBUG: Get bootstrap completed
12:57:46.913 DEBUG: Create isolated classloader...
12:57:46.928 DEBUG: Start temp cleaning...
12:57:46.977 DEBUG: Temp cleaning done
12:57:46.978 DEBUG: Execution getVersion
12:57:47.253 INFO: SonarQube server 7.2.1
12:57:47.253 INFO: Default locale: "de_DE", source code encoding: "UTF-8"
12:57:47.254 DEBUG: Work directory: /Users/Shared/Jenkins/Home/workspace/xxx/.scannerwork
12:57:47.256 DEBUG: Execution execute
12:57:48.210 INFO: Publish mode
12:57:49.491 INFO: Load global settings
12:57:50.124 DEBUG: GET 200 http://xxx/api/settings/values.protobuf | time=507ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/Users/Shared/Jenkins/.sonar/cache/b5c11a04ed6b964f01300ea40faa0a09/sonar-scanner-engine-shaded-developer-7.2.1-all.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Gerd

Hi @flender,

Could you please share the entire log? If you cannot do it publicly I can send you a PM where you can share it privately.

@mpaladin
The entire log is very big:
build-wrapper.log - 78,31 MB
build-wrapper-dump.json - 45.41
Zip of both files: 7,9 MB

Output log of jenkins: 84,2 MB.
Zipped: 4,4 MB
I put everything on a shared space and sent you a PM.

@mpaladin
It seems that i cannot send you a PM… so could you please…

Hi @flender,

thank you for the shared files, I was able to reproduce the issue, I created a ticket on our side CPP-2258, it will get released with SonarCFamily 6.4, normally in the upcoming weeks.

Hi @mpaladin

thank you very much for your help and the fix.
How can be informed if the release 6.4 comes out?

Gerd

Hi @flender,

you can subscribe to this page: https://www.sonarsource.com/resources/product-news/.

Hi @flender ,

FYI SonarCFamily 6.4 containing the bug fix you reported is available on the marketplace.

Hi Massimo,

even with SonarCFamily 6.4 and Sonar-Scanner 4.2 we get an error:

16:39:30.896 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: sonar.cfamily.reproducer
	at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:212)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:400)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:395)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:358)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)

I’ve upload the logs to the same place as before…

Hi @flender,

you may want to remove sonar.cfamily.reproducer property now.

Hi @mpaladin,

You’re right. That was the problem! It is now working!

Thanks again for you help!

1 Like