Xcode 11.4: Invalid debug info found, debug info will be stripped

I have a new warning per every target after upgrading to Xcode 11.4:


Invalid debug info found, debug info will be stripped


This has never been the case for my code base before. Anything I can do to resolve these warning? Am I safe to release to the AppStore with these warnings?


For one of the targets detailed info is:


mismatched subprogram between llvm.dbg.label label and !dbg attachment
  call void @llvm.dbg.label(metadata !137) #2, !dbg !203
label %138
double (i8*)* @"\01__hidden#1918_"
!137 = !DILabel(scope: !138, name: "zulu_time", file: !10, line: 196)
!138 = distinct !DISubprogram(name: "parseTimezone", scope: !10, file: !10, line: 161, type: !139, scopeLine: 161, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !171, retainedNodes: !196)
!203 = !DILocation(line: 196, column: 1, scope: !100, inlinedAt: !101)
!100 = distinct !DISubprogram(name: "__hidden#1928_", scope: !10, file: !10, line: 161, type: !11, scopeLine: 161, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !6)
mismatched subprogram between llvm.dbg.label label and !dbg attachment
  call void @llvm.dbg.label(metadata !347), !dbg !371
label %55
i32 (i8*, ...)* @"\01__hidden#1920_"
!347 = !DILabel(scope: !348, name: "end_getDigits", file: !10, line: 140)
!348 = distinct !DISubprogram(name: "getDigits", scope: !10, file: !10, line: 109, type: !349, scopeLine: 109, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !171, retainedNodes: !351)
!371 = !DILocation(line: 140, column: 1, scope: !315)
!315 = distinct !DISubprogram(name: "__hidden#1922_", scope: !10, file: !10, line: 109, type: !11, scopeLine: 109, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !6)
DICompileUnit not listed in llvm.dbg.cu
!171 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "Apple clang version 11.0.3 (clang-1103.0.32.29)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !12, retainedTypes: !172, imports: !180, nameTableKind: None)
ld: warning: Invalid debug info found, debug info will be stripped
!dbg attachment points at wrong subprogram for function
!126 = distinct !DISubprogram(name: "__hidden#2776_", scope: !35, file: !35, line: 259, type: !36, scopeLine: 259, s: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !11)
double (%0*, i8*, %0*, i32)* @"\01__hidden#2776_"
  br i1 %41, label %42, label %90, !dbg !152, !llvm.loop !155
!156 = !DILocation(line: 283, column: 3, scope: !157)
!157 = distinct !DISubprogram(name: "__hidden#2776_", scope: !35, file: !35, line: 259, type: !36, scopeLine: 259, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !158)
!157 = distinct !DISubprogram(name: "__hidden#2776_", scope: !35, file: !35, line: 259, type: !36, scopeLine: 259, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !158)
ld: warning: Invalid debug info found, debug info will be stripped
mismatched subprogram between llvm.dbg.label label and !dbg attachment

Same for me. Got a lot of these.

Let me know if you solve it.

I created a bug for Apple for this, FB7640880.

We see a similar issue. Reported as FB7644250


'++crypto' is not a recognized feature for this target (ignoring feature)
'++crypto' is not a recognized feature for this target (ignoring feature)
'++crypto' is not a recognized feature for this target (ignoring feature)
'++crypto' is not a recognized feature for this target (ignoring feature)
!dbg attachment points at wrong subprogram for function
!55928 = distinct !DISubprogram(name: "__hidden#4184_", scope: !55112, file: !55112, line: 388, type: !19444, scopeLine: 388, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !16201)
%823* (%825*, i8*, i64)* @"\01__hidden#4184_"
  br i1 %36, label %41, label %37, !dbg !55955, !llvm.loop !55957
!55958 = !DILocation(line: 918, column: 5, scope: !55959, inlinedAt: !55961)
!55962 = distinct !DISubprogram(name: "__hidden#4184_", scope: !55112, file: !55112, line: 388, type: !19444, scopeLine: 388, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !55960)
!55962 = distinct !DISubprogram(name: "__hidden#4184_", scope: !55112, file: !55112, line: 388, type: !19444, scopeLine: 388, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !55960)
ld: warning: Invalid debug info found, debug info will be stripped

Yes, I have the same problem when build release for iOS

Is any one of you able to share a project that reproduced the issue?

Would you be able to share a project that reproduces the issue? You can just attach it to the FB. If you cannot share source code, I might be able to read something out of the bitcode object files, too.


thanks!

One additional question specifically for steipete: Does your file that you are getting the warning reported for also contain named labels?

We have the same problem too. We use the GoogleMobileAds framework and that gives this issue after the building process.


!dbg attachment points at wrong subprogram for function
!1288 = distinct !DISubprogram(name: "-[GADNativeAdViewMonitor handleTap:]", scope: !1, file: !1, line: 279, type: !1289, scopeLine: 279, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !1291)
void (%1*, i8*, %11*)* @"\01-[GADNativeAdViewMonitor handleTap:]"
  br i1 %303, label %304, label %293, !dbg !1499, !llvm.loop !1506
!1507 = !DILocation(line: 34, column: 3, scope: !1483)
!1483 = distinct !DISubprogram(name: "GADLowestCommonParentViewForViews", scope: !1, file: !1, line: 26, type: !1484, scopeLine: 28, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !1486)
!1483 = distinct !DISubprogram(name: "GADLowestCommonParentViewForViews", scope: !1, file: !1, line: 26, type: !1484, scopeLine: 28, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !1486)
ld: warning: ignoring invalid debug info in /Users/[censored]/Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework-Current/GoogleMobileAds.framework/GoogleMobileAds(GADNativeAdViewMonitor.o)
!dbg attachment points at wrong subprogram for function
!294 = distinct !DISubprogram(name: "GADIssueHandlerSignalHandler", scope: !3, file: !3, line: 514, type: !295, scopeLine: 514, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !299)
void (i32, %struct.__siginfo*, i8*)* @GADIssueHandlerSignalHandler
  br i1 %14, label %15, label %8, !dbg !959, !llvm.loop !968
!969 = !DILocation(line: 493, column: 3, scope: !951)
!951 = distinct !DILexicalBlock(scope: !952, file: !3, line: 493, column: 3)
!952 = distinct !DISubprogram(name: "GADIssueHandlerAttachDefaultSignalHandlers", scope: !3, file: !3, line: 492, type: !391, scopeLine: 492, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !953)
ld: warning: ignoring invalid debug info in /Users/[censored]/Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework-Current/GoogleMobileAds.framework/GoogleMobileAds(GADIssueHandler.o)
!dbg attachment points at wrong subprogram for function
!245 = distinct !DISubprogram(name: "-[GADCrashReporter storeEnvironmentInfo]", scope: !3, file: !3, line: 500, type: !246, scopeLine: 500, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !249)
void (%0*, i8*)* @"\01-[GADCrashReporter storeEnvironmentInfo]"
  br i1 %194, label %178, label %195, !dbg !920, !llvm.loop !938
!939 = !DILocation(line: 104, column: 3, scope: !788)
!788 = distinct !DILexicalBlock(scope: !772, file: !3, line: 104, column: 3)
!772 = distinct !DISubprogram(name: "GADIsDeveloperBuild", scope: !3, file: !3, line: 59, type: !387, scopeLine: 59, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !773)
ld: warning: ignoring invalid debug info in /Users/[censored]/Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework-Current/GoogleMobileAds.framework/GoogleMobileAds(GADCrashReporter.o)
!dbg attachment points at wrong subprogram for function
!55 = distinct !DISubprogram(name: "GADInflatedDataFromBytes", scope: !1, file: !1, line: 53, type: !56, scopeLine: 53, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !74)
%0* (i8*, i64)* @GADInflatedDataFromBytes
  br label %38, !dbg !188, !llvm.loop !207
!208 = !DILocation(line: 28, column: 3, scope: !151)
!151 = distinct !DISubprogram(name: "GADInflateStream", scope: !1, file: !1, line: 20, type: !152, scopeLine: 20, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !156)
!151 = distinct !DISubprogram(name: "GADInflateStream", scope: !1, file: !1, line: 20, type: !152, scopeLine: 20, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !156)
ld: warning: ignoring invalid debug info in /Users/[censored]/Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework-Current/GoogleMobileAds.framework/GoogleMobileAds(GADDataCompression.o)
!dbg attachment points at wrong subprogram for function
!1349 = distinct !DISubprogram(name: "__61-[GADSafeBrowsingMonitor observeNotificationName:usingBlock:]_block_invoke", scope: !3, file: !3, line: 184, type: !1350, scopeLine: 184, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !1352)
void (i8*, %15*)* @"__61-[GADSafeBrowsingMonitor observeNotificationName:usingBlock:]_block_invoke"
  i1 %44, label %54, label %36, !dbg !1410, !llvm.loop !1417
!1418 = !DILocation(line: 38, column: 3, scope: !1403)
!1403 = distinct !DILexicalBlock(scope: !1397, file: !3, line: 38, column: 3)
!1397 = distinct !DISubprogram(name: "GADEventContextHasAncestor", scope: !3, file: !3, line: 36, type: !1398, scopeLine: 37, fl-----ags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !1400)
ld: warning: ignoring invalid debug info in /Users/[censored]/Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework-Current/GoogleMobileAds.framework/GoogleMobileAds(GADSafeBrowsingMonitor.o)
!dbg attachment points at wrong subprogram for function
!277 = distinct !DISubprogram(name: "-[GADContent updateContentWithText:]", scope: !1, file: !1, line: 198, type: !278, scopeLine: 198, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !280)
void (%1*, i8*, %0*)* @"\01-[GADContent updateContentWithText:]"
  br i1 %210, label %169, label %164, !dbg !418, !llvm.loop !475
!476 = !DILocation(line: 114, column: 3, scope: !397)
!397 = distinct !DILexicalBlock(scope: !355, file: !1, line: 114, column: 3)
!355 = distinct !DISubprogram(name: "GADTokenComponentsWithString", scope: !1, file: !1, line: 108, type: !356, scopeLine: 108, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !358)
ld: warning: ignoring invalid debug info in /Users/[censored]/Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework-Current/GoogleMobileAds.framework/GoogleMobileAds(GADContent.o)
!dbg attachment points at wrong subprogram for function
!549 = distinct !DISubprogram(name: "GADNativeAdSignalForAdViewAndAssetViews", scope: !1, file: !1, line: 148, type: !550, scopeLine: 150, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !943)
%2* (%4*, %3*, %4*, %5*)* @GADNativeAdSignalForAdViewAndAssetViews
  br i1 %94, label %95, label %82, !dbg !1233, !llvm.loop !1244
!1245 = !DILocation(line: 34, column: 3, scope: !1224)
!1224 = distinct !DISubprogram(name: "GADScrollViewContainingView", scope: !1, file: !1, line: 32, type: !1225, scopeLine: 32, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !1227)
!1224 = distinct !DISubprogram(name: "GADScrollViewContainingView", scope: !1, file: !1, line: 32, type: !1225, scopeLine: 32, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !1227)
ld: warning: ignoring invalid debug info in /Users/[censored]/Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework-Current/GoogleMobileAds.framework/GoogleMobileAds(GADNativeAdSignalCollector.o)

Is /Users/[censored]/Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework-Current/GoogleMobileAds.framework/GoogleMobileAds.a a file that you compiled locally (perhaps indirectly via CocoaPods) or is this a static (.a) archive that was built with an earlier version of Xcode (perhaps because you/CocoaPods downloaded from some place else)?

The warning pops up in the linking stage. if we use LTO, it's printed once, else it's printed about 30 times.

There's no info as to what file it is being referenced to. Is there any logging available where we could get more data out of it?


The error is part of the PSPDFKit SDK - it's a huge project, sharing would be difficult. If there's anything else I can do to help, let me know.


Core definitely uses goto if you mean that as named labels.

This seems to be the case with Unity projects as well. I was using Unity 2019.2.21 and Xcode spits a lot of warning messages like so when I do an archive:

ld: warning: ignoring invalid debug info in /Users/[REDACTED]/Xcode Linker Issue/Build/Libraries/libiPhone-lib.a(artifacts_iOS_modules_Animation_0.o)

I would assume that Unity built their support libraries without Xcode 11.4 as 2019.2.21 is released before that.

The effect of this warning message is that Xcode would use a lot of RAM on my big Unity project, stop button does not work during linking, and the warning message would continue to roll in long after the archive is generated.


I have uploaded a Xcode project generated from an empty Unity project using the offending Unity version with my archive logs at Issue No. FB7650762.

Thanks!

Thank you very much for the reproducer! Upon analysis we could identify two separate issues, that both have the very similar symptoms.

First is the handling of label debug info in LLVM bitcode, which is the same issue that is being tracked by FB7640880, and needs to be resolved in Xcode itself. These are the errors referring to DILabel. The second however, can only be resolved by recompiling the Unity libraries with a newer version of clang. It looks like the library was produced by Xcode 9.2, which had an issue updating loop debug metadata during inlining. This issue has been resolved in newer versions opf clang. These are the errors referring to !llvm.loop.

Note that neither of these issues can affect the generated code, it only affects the quality of the debug information for the affected object files.

I've seen this as well in many of my projects. My projects use zero third-party anything (code is directly over the iOS SDK).


I see the warnings though only if there are any build errors. Once the build errors are fixed, the warnings also go away.


For example, in one such project, I mangled the name of an enum case. That enum type lives in IIMainTabBarController.swit. Compiling the project gives a single error in IIMainTabController.swift (only file that makes use of that enum). But it also generates a warning for my IIHint.swift file:


Could not read ... diagnostics signature

IIHint.dla


Perfoming a clean build, then building again produces the same exact error and warning.


Here's where it now gets "fun". I corrected the enum case, but mangled the name of a different case. Similar error of course in IIMainTabBarController, but now it warns me about IIStateRestorationManager.dla.


But... a clean build now, followed by a build, "moves" the single warning back to IIHint.dla.


Finally, renaming the case back to fix the error, also removes the warning.

Thanks for the investigation! 🙂

I think for the time being I'll get Xcode 11.3.1 back as that is the last version working for me while I wait for an update on both sides.

Xcode 11.4: Invalid debug info found, debug info will be stripped
 
 
Q