Skip to content

[SR-13263] Invalid Debug Information Generation #55703

Closed
@compnerd

Description

@compnerd
Previous ID SR-13263
Radar None
Original Reporter @compnerd
Type Bug

Attachment: Download

Additional Detail from JIRA
Votes 3
Component/s
Labels Bug
Assignee @adrian-prantl
Priority Medium

md5: 1cf1abd3137f286141ea88df6a315030

Issue Description:

lit test reproducer:

// RUN: %empty-directory(%t)
// RUN: %target-swiftc_driver -DM -emit-module -emit-module-path %t/M.swiftmodule %s -module-name M
// RUN: not --crash %target-swiftc_driver -O -g -I %t -c %s -o /dev/null

#if M
import _Differentiation

public struct S<T> {
  class C {}
  let c: C
  internal var b: Bool
}

extension S: AdditiveArithmetic {
  public static var zero: S { fatalError() }

  public static func == (_ lhs: S, _ rhs: S) -> Bool { fatalError() }
  public static func + (_ lhs: S, _ rhs: S) -> S { fatalError() }
  public static func - (_ lhs: S, _ rhs: S) -> S { fatalError() }
}

extension S: Differentiable {
  public typealias TangentVector = S
}

#else
import _Differentiation
import M

struct T: Differentiable {
  var u1: U
  var u2: U
}

struct U: Differentiable {
  var s: S<Float>
  var v: V
}

struct V: Differentiable {
  var s: S<Float>
}
#endif

Crash:

swift-frontend: swift-dev/llvm-project/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp:572: void llvm::DwarfExpression::addFragmentOffset(const llvm::DIExpression *): Assertion `FragmentOffset >= OffsetInBits && "overlapping or duplicate fragments"' failed.
Stack dump:
1.  Swift version 5.3-dev (LLVM 6d510c802af0d59, Swift 3e090b483352b3c)
2.  Running pass 'Function Pass Manager' on module '/dev/null'.
3.  Running pass 'X86 Assembly Printer' on function '@"$s4null1TV4move5alongyAC13TangentVectorV_tF"'

Metadata

Metadata

Assignees

Labels

IRGenLLVM IR generationassertion failureBug → crash: An assertion failurebugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwaredebug infoArea → compiler → IRGen: Debug information emissionswift 5.9

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions