Skip to content

[SR-11086] Crash in REPL when redeclaring class with variable #4336

Open
@swift-ci

Description

@swift-ci
Previous ID SR-11086
Radar rdar://problem/52808651
Original Reporter aasimk (JIRA User)
Type Bug
Environment

Xcode 11 beta 3

Additional Detail from JIRA
Votes 0
Component/s Compiler, LLDB for Swift
Labels Bug
Assignee None
Priority Medium

md5: 4da831baa79eee189c7475de2db8544d

Issue Description:

This crash seems to be only occurring in the REPL due to allowing redeclaration of variables and classes

Steps to trigger crash

  1> class Foo {}
  2> let Foo = 0
  3> let foo: Foo = Foo()

Stack trace

0  lldb                     0x0000000103125da5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  lldb                     0x0000000103125417 llvm::sys::RunSignalHandlers() + 39
2  lldb                     0x00000001031263f8 SignalHandler(int) + 264
3  libsystem_platform.dylib 0x00007fff7b677b5d _sigtramp + 29
4  libsystem_platform.dylib 000000000000000000 _sigtramp + 2224587968
5  LLDB                     0x00000001041fff73 swift::TypeChecker::coercePatternToType(swift::Pattern*&, swift::TypeResolution, swift::Type, swift::TypeResolutionOptions, swift::TypeLoc) + 6035
6  LLDB                     0x00000001041fe3f6 swift::TypeChecker::typeCheckPattern(swift::Pattern*, swift::DeclContext*, swift::TypeResolutionOptions) + 710
7  LLDB                     0x00000001041d1bfd validatePatternBindingEntries(swift::TypeChecker&, swift::PatternBindingDecl*) + 621
8  LLDB                     0x00000001041cb265 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 1253
9  LLDB                     0x00000001041cad76 swift::TypeChecker::typeCheckDecl(swift::Decl*) + 38
10 LLDB                     0x00000001042396ee swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 1486
11 LLDB                     0x00000001042387f8 bool (anonymous namespace)::StmtChecker::typeCheckStmt<swift::BraceStmt>(swift::BraceStmt*&) + 136
12 LLDB                     0x00000001042388ee swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 174
13 LLDB                     0x00000001042551d6 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) + 950
14 LLDB                     0x0000000103631877 lldb_private::SwiftExpressionParser::Parse(lldb_private::DiagnosticManager&, unsigned int, unsigned int) + 407
15 LLDB                     0x000000010363e9cf lldb_private::SwiftUserExpression::Parse(lldb_private::DiagnosticManager&, lldb_private::ExecutionContext&, lldb_private::ExecutionPolicy, bool, bool) + 991
16 LLDB                     0x00000001033ee6a5 lldb_private::UserExpression::Evaluate(lldb_private::ExecutionContext&, lldb_private::EvaluateExpressionOptions const&, llvm::StringRef, llvm::StringRef, lldb_private::SharingPtr<lldb_private::ValueObject>&, lldb_private::Status&, unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, std::__1::shared_ptr<lldb_private::Module>*) + 1701
17 LLDB                     0x00000001033ec7c1 lldb_private::REPL::IOHandlerInputComplete(lldb_private::IOHandler&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 2129
18 LLDB                     0x0000000103361cc0 lldb_private::IOHandlerEditline::Run() + 368
19 LLDB                     0x000000010334909b lldb_private::Debugger::ExecuteIOHandlers() + 123
20 LLDB                     0x000000010334bae3 lldb_private::Debugger::IOHandlerThread(void*) + 19
21 LLDB                     0x00000001033f6287 lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) + 103
22 libsystem_pthread.dylib  0x00007fff7b6802eb _pthread_body + 126
23 libsystem_pthread.dylib  0x00007fff7b683249 _pthread_start + 66
24 libsystem_pthread.dylib  0x00007fff7b67f40d thread_start + 13
fish: 'swift' terminated by signal SIGSEGV (Address boundary error)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions