Skip to content

Clang -g crashes at link #88

@bprail

Description

@bprail

When compiling with -g, Clang 3.7+ crashes in the link step for non-trivial Contech-instrumented binaries.

Issue was seen last fall with rust - rust-lang/rust#28947; however, they brought in a fix for their local environment.
LLVM bug - http://llvm.1065342.n5.nabble.com/llvm-dev-CloneFunction-during-LTO-leads-to-seg-fault-td90858.html.

In a simple program, the debug issue is now at:
!dbg attachment points at wrong subprogram for function

!10 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 8, type: !11, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, variables: !13)
i8* (i8*)* @foo
  tail call void @llvm.dbg.value(metadata i8* %"Cast as void", i64 0, metadata !374, metadata !1035), !dbg !1038
!1038 = !DILocation(line: 695, column: 58, scope: !370)
!370 = distinct !DISubprogram(name: "__ctStoreMemOp", scope: !49, file: !49, line: 695, type: !371, isLocal: false, isDefinition: true, scopeLine: 696, flags: DIFlagPrototyped, isOptimized: true, variables: !373)
!370 = distinct !DISubprogram(name: "__ctStoreMemOp", scope: !49, file: !49, line: 695, type: !371, isLocal: false, isDefinition: true, scopeLine: 696, flags: DIFlagPrototyped, isOptimized: true, variables: !373)

Is the inlined code an issue with -flto, as the debug symbols are not updated in a proper manner?

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions