Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-8565] Infinite recursion crash: solveRec -> solveSimplified -> tryTypeVariableBindings ->solveRec #51083

Open
nathawes opened this issue Aug 17, 2018 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software type checker Area → compiler: Semantic analysis

Comments

@nathawes
Copy link
Collaborator

Previous ID SR-8565
Radar rdar://problem/42596313
Original Reporter @nathawes
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, TypeChecker
Assignee None
Priority Medium

md5: 9011be81645498e407f6ebdb285a536f

Issue Description:

Reproducer:

public protocol TransformType {
  associatedtype Object
}

infix operator >>>
public func >>> <Transform: TransformType>(left: Transform.Object?, right: Transform) {
  fatalError()
}

_ = [:] >>> nil
 1 libsystem_malloc.dylib         0x000024a7 tiny_malloc_from_free_list + 1260 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/libmalloc/libmalloc-166.200.46/src/magazine_tiny.c:1865)
   2 libsystem_malloc.dylib         0x0001bec5 tiny_malloc_should_clear + 273 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/libmalloc/libmalloc-166.200.46/src/magazine_tiny.c:1946)
   3 libsystem_malloc.dylib         0x00001f01 szone_malloc_should_clear + 66 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/libmalloc/libmalloc-166.200.46/src/magazine_malloc.c:246)
   4 libsystem_malloc.dylib         0x00003895 szone_realloc + 504 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/libmalloc/libmalloc-166.200.46/src/magazine_malloc.c:282)
   5 libsystem_malloc.dylib         0x0000364a malloc_zone_realloc + 111 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/libmalloc/libmalloc-166.200.46/src/malloc.c:1530)
   6 libsystem_malloc.dylib         0x0000353c realloc + 253 (/BuildRoot/Library/Caches/com.apple.xbs/Sources/libmalloc/libmalloc-166.200.46/src/malloc.c:1863)
>  7 swift                          0x0382b47d llvm::SmallVectorBase::grow_pod(void*, unsigned long, unsigned long) + 61
   8 swift                          0x00e96f55 swift::constraints::ConstraintGraph::gatherConstraints(swift::TypeVariableType*, llvm::SmallVectorImpl<swift::constraints::Constraint*>&, swift::constraints::ConstraintGraph::GatheringKind) + 277
   9 swift                          0x00e0b380 swift::constraints::ConstraintSystem::getPotentialBindings(swift::TypeVariableType*) + 288
  10 swift                          0x00e0a9ab swift::constraints::ConstraintSystem::determineBestBindings() + 203
  11 swift                          0x00e72ce4 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 52
  12 swift                          0x00e6f2bd swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 589
  13 swift                          0x00e6e3ec swift::constraints::ConstraintSystem::tryTypeVariableBindings(unsigned int, swift::TypeVariableType*, llvm::ArrayRef<swift::constraints::ConstraintSystem::PotentialBinding>, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 5116
  14 swift                          0x00e72d36 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 134
  15 swift                          0x00e6f2bd swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 589
  16 swift                          0x00e6e3ec swift::constraints::ConstraintSystem::tryTypeVariableBindings(unsigned int, swift::TypeVariableType*, llvm::ArrayRef<swift::constraints::ConstraintSystem::PotentialBinding>, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 5116
  17 swift                          0x00e72d36 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 134
  18 swift                          0x00e6f2bd swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 589
  19 swift                          0x00e6e3ec swift::constraints::ConstraintSystem::tryTypeVariableBindings(unsigned int, swift::TypeVariableType*, llvm::ArrayRef<swift::constraints::ConstraintSystem::PotentialBinding>, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 5116
  20 swift                          0x00e72d36 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 134
  21 swift                          0x00e6f2bd swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 589
  22 swift                          0x00e6e3ec swift::constraints::ConstraintSystem::tryTypeVariableBindings(unsigned int, swift::TypeVariableType*, llvm::ArrayRef<swift::constraints::ConstraintSystem::PotentialBinding>, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 5116
  23 swift                          0x00e72d36 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 134
  24 swift                          0x00e6f2bd swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 589
  25 swift                          0x00e6e3ec swift::constraints::ConstraintSystem::tryTypeVariableBindings(unsigned int, swift::TypeVariableType*, llvm::ArrayRef<swift::constraints::ConstraintSystem::PotentialBinding>, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 5116
...
@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants