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-3437] RegularExpression display crashes REPL #4428

Closed
swift-ci opened this issue Dec 16, 2016 · 1 comment
Closed

[SR-3437] RegularExpression display crashes REPL #4428

swift-ci opened this issue Dec 16, 2016 · 1 comment

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-3437
Radar None
Original Reporter mgritter (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Swift version 3.0.2 (swift-3.0.2-RELEASE)
Target: x86_64-unknown-linux-gnu
on Ubuntu 16.04.1

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

md5: 10a8ec46ccc5c27d5f27652532cabaaa

Issue Description:

On Linux, I tried:

import Foundation
let r = RegularExpression( pattern:"\\[.*\\]", options:.caseInsensitive )

this resulted in a crash:

r: Foundation.RegularExpression = {
  Foundation.NSObject = {}
Segmentation fault (core dumped)

Backtrace:

#0 0x00007ffff45cea37 in std::_Function_handler<std::shared_ptr<lldb_private::SyntheticChildren> (lldb_private::ValueObject&, lldb::DynamicValueType, lldb_private::FormatManager&), lldb_private::SwiftLanguage::GetHardcodedSynthetics()::$_2::operator()() const::{lambda(lldb_private::ValueObject&, lldb::DynamicValueType, lldb_private::FormatManager&)#2}>::_M_invoke(std::_Any_data const&, lldb_private::ValueObject&, lldb::DynamicValueType&&, lldb_private::FormatManager&) ()
from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#1 0x00007ffff42eeab2 in lldb_private::LanguageCategory::GetHardcoded(lldb_private::FormatManager&, lldb_private::FormattersMatchData&, std::shared_ptr<lldb_private::SyntheticChildren>&) ()
from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#2 0x00007ffff42e9875 in lldb_private::FormatManager::GetSyntheticChildren(lldb_private::ValueObject&, lldb::DynamicValueType) () from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#3 0x00007ffff42e4160 in lldb_private::DataVisualization::GetSyntheticChildren(lldb_private::ValueObject&, lldb::DynamicValueType) ()
from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#4 0x00007ffff438f418 in lldb_private::ValueObject::UpdateFormatsIfNeeded() ()
from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#5 0x00007ffff438ec10 in lldb_private::ValueObject::UpdateValueIfNeeded(bool) ()
from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#6 0x00007ffff42fe805 in lldb_private::ValueObjectPrinter::GetMostSpecializedValue() ()
from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#7 0x00007ffff42fe64f in lldb_private::ValueObjectPrinter::PrintValueObject() ()
from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#8 0x00007ffff42fff9c in lldb_private::ValueObjectPrinter::PrintChild(lldb_private::SharingPtr<lldb_private::ValueObject>, lldb_private::DumpValueObjectOptions::PointerDepth const&) ()
from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#9 0x00007ffff43003e3 in lldb_private::ValueObjectPrinter::PrintChildren(bool, bool, lldb_private::DumpValueObjectOptions::PointerDepth const&) ()
from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#10 0x00007ffff42ff3b2 in lldb_private::ValueObjectPrinter::PrintChildrenIfNeeded(bool, bool) ()
from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#11 0x00007ffff42fe767 in lldb_private::ValueObjectPrinter::PrintValueObject() ()
from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#12 0x00007ffff4397aee in lldb_private::ValueObject::Dump(lldb_private::Stream&, lldb_private::DumpValueObjectOptions const&) () from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#13 0x00007ffff4731ce9 in lldb_private::SwiftREPL::PrintOneVariable(lldb_private::Debugger&, std::shared_ptr<lldb_private::StreamFile>&, lldb_private::SharingPtr<lldb_private::ValueObject>&, lldb_private::ExpressionVariable*) () from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#14 0x00007ffff43d6ffa in lldb_private::REPL::IOHandlerInputComplete(lldb_private::IOHandler&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) ()
from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#15 0x00007ffff4342bf7 in lldb_private::IOHandlerEditline::Run() ()
from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#16 0x00007ffff432c302 in lldb_private::Debugger::ExecuteIOHandlers() ()
from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#17 0x00007ffff432fdbf in lldb_private::Debugger::IOHandlerThread(void*) ()
from /home/ubuntu/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/../lib/liblldb.so.3.9.0
#18 0x00007ffff266c6ba in start_thread (arg=0x7fffda46e700) at pthread_create.c:333
#19 0x00007ffff18e782d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

@spevans
Copy link
Collaborator

spevans commented Oct 26, 2019

This has been fixed in 5.1 on Linux.

Note RegularExpression was renamed to NSRegularExpression sometime ago:

Welcome to Swift version 5.1 (swift-5.1-RELEASE).
Type :help for assistance.
  1> import Foundation
  2> let r = NSRegularExpression( pattern:"\\[.*\\]", options:.caseInsensitive )
r: NSRegularExpression = {
  Foundation.NSObject = {}
  _internal = {
    Foundation.NSObject = {}
    _cfinfo = {
      info = 65664
      pad = 0
    }
  }
}
  3> print(r)
<NSRegularExpression: 0x000000000061cbf0>
  4>   

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants