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-2635] Crash with Xcode 8 Swift compiler #45240

Closed
swift-ci opened this issue Sep 14, 2016 · 2 comments
Closed

[SR-2635] Crash with Xcode 8 Swift compiler #45240

swift-ci opened this issue Sep 14, 2016 · 2 comments
Assignees
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 regression swift 3.0 type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-2635
Radar rdar://problem/26845038
Original Reporter dltastudio (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Environment

Xcode 8, macOS 10.11.6

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 3.0Regression, CompilerCrash, TypeChecker
Assignee @rudkx
Priority Medium

md5: 7993579f4c48646b86c7931e437ec8c3

duplicates:

  • SR-1512 Assertion failure: "Already marked as a fixed binding" when implementing index(_:offsetBy:limit:)

relates to:

  • SR-2876 Subscript on Array(someString.characters) Crashes Compiler with Assert

Issue Description:

Attached Swift source code crash with Xcode 8 :

swift(3785,0x7fff74689000) malloc: *** error for object 0x7fab6bfda808: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
0 swift 0x000000010f22fb6d PrintStackTraceSignalHandler(void*) + 45
1 swift 0x000000010f22f5b6 SignalHandler(int) + 470
2 libsystem_platform.dylib 0x00007fff8319252a _sigtramp + 26
3 swift 0x000000010ce54a76 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 166
4 libsystem_c.dylib 0x00007fff8e1716df abort + 129
5 libsystem_malloc.dylib 0x00007fff8a2c3396 szone_error + 626
6 libsystem_malloc.dylib 0x00007fff8a2b9373 small_free_list_remove_ptr + 152
7 libsystem_malloc.dylib 0x00007fff8a2b7a7c szone_free_definite_size + 1790
8 swift 0x000000010cdc90d4 swift::constraints::ConstraintGraphNode::ConstraintGraphNode() + 132
9 swift 0x000000010cdca14c swift::constraints::ConstraintGraphScope::ConstraintGraphScope() + 172
10 swift 0x000000010ce6386d swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) + 24333
11 swift 0x000000010ce5a650 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) + 688
12 swift 0x000000010ce636b4 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) + 23892
13 swift 0x000000010ce5a650 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) + 688
14 swift 0x000000010ce59f92 swift::constraints::ConstraintSystem::solve(llvm::SmallVectorImplswift::constraints::Solution&, swift::FreeTypeVariableBinding) + 66
15 swift 0x000000010cea3e3b swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImplswift::constraints::Solution&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 1099
16 swift 0x000000010cea659f swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 703
17 swift 0x000000010cea8fdc swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 300
18 swift 0x000000010cea9903 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 579
19 swift 0x000000010ceb73a2 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 3938
20 swift 0x000000010ced2bf4 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 180
21 swift 0x000000010cf27579 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 425
22 swift 0x000000010cf2b84c swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 188
23 swift 0x000000010cede348 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1848
24 swift 0x000000010cb948ef swift::CompilerInstance::performSema() + 5199
25 swift 0x000000010c64100d performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 2765
26 swift 0x000000010c63e265 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 17029
27 swift 0x000000010c5fb82d main + 8685
28 libdyld.dylib 0x00007fff8481e5ad start + 1
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/TypeBasics/main.swift -target x86_64-apple-macosx10.10 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -I /Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Products/Debug -F /Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Products/Debug -enable-testing -g -module-cache-path /Users/dscreve/Library/Developer/Xcode/DerivedData/ModuleCache -serialize-debugging-options -Xcc -I/Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Intermediates/TypeBasics.build/Debug/TypeBasics.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Intermediates/TypeBasics.build/Debug/TypeBasics.build/TypeBasics-generated-files.hmap -Xcc -I/Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Intermediates/TypeBasics.build/Debug/TypeBasics.build/TypeBasics-own-target-headers.hmap -Xcc -I/Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Intermediates/TypeBasics.build/Debug/TypeBasics.build/TypeBasics-all-target-headers.hmap -Xcc -iquote -Xcc /Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Intermediates/TypeBasics.build/Debug/TypeBasics.build/TypeBasics-project-headers.hmap -Xcc -I/Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Products/Debug/include -Xcc -I/Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Intermediates/TypeBasics.build/Debug/TypeBasics.build/DerivedSources/x86_64 -Xcc -I/Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Intermediates/TypeBasics.build/Debug/TypeBasics.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics -emit-module-doc-path /Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Intermediates/TypeBasics.build/Debug/TypeBasics.build/Objects-normal/x86_64/main
partial.swiftdoc -Onone -module-name TypeBasics -emit-module-path /Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Intermediates/TypeBasics.build/Debug/TypeBasics.build/Objects-normal/x86_64/main
partial.swiftmodule -serialize-diagnostics-path /Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Intermediates/TypeBasics.build/Debug/TypeBasics.build/Objects-normal/x86_64/main.dia -emit-dependencies-path /Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Intermediates/TypeBasics.build/Debug/TypeBasics.build/Objects-normal/x86_64/main.d -emit-reference-dependencies-path /Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Intermediates/TypeBasics.build/Debug/TypeBasics.build/Objects-normal/x86_64/main.swiftdeps -o /Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/Build/Intermediates/TypeBasics.build/Debug/TypeBasics.build/Objects-normal/x86_64/main.o

  1. While type-checking declaration 0x7fab6bdebb90 at /Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/TypeBasics/main.swift:16:1
  2. While type-checking expression at [/Users/dscreve/Documents/Formation/SWIFT-3.0.0/exemples/TypeBasics/TypeBasics/main.swift:16:29 - line:16:58] RangeText="Array(constante.characters)[0]"
@belkadan
Copy link
Contributor

In a +Asserts build:

Assertion failed: (!adjacency.FixedBinding && "Already marked as a fixed binding?"), function addFixedBinding, file /Volumes/Data/swift-public/swift/lib/Sema/ConstraintGraph.cpp, line 207.
Stack dump:
0.  Program arguments: /Volumes/Data/swift-public/build/ninja/swift-macosx-x86_64/bin/swift -frontend -interpret - -target x86_64-apple-macosx10.9 -enable-objc-interop -sdk /Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -color-diagnostics -module-name main 
1.  While type-checking declaration 0x7fe16a316570 at <stdin>:16:1
2.  While type-checking expression at [<stdin>:16:29 - line:16:58] RangeText="Array(constante.characters)[0]"

@rudkx
Copy link
Member

rudkx commented Sep 15, 2016

It's the

Array(constante.characters)[0]

We've gotten other reports of this.

@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
This issue was closed.
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 regression swift 3.0 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

4 participants