We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Swift 4.2 branch Swift 4.1 Linux f1cd7d250550 4.4.0-34-generic #53~14.04.1-Ubuntu SMP Wed Jul 27 16:56:40 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
md5: 2166b60cd42a75ea294989318f1cd5a9
Issue Description:
With this code on linux:
import Foundation let xmlString = """ <?xml version="1.0" encoding="UTF-8"?> <document> </document> """ let data = xmlString.data(using: .utf8)! let document = try XMLDocument(data: data, options: .nodePreserveAll) print(document)
Running fails:
$ swift foo.swift #​0 0x00000000040df5b4 PrintStackTraceSignalHandler(void*) (/usr/bin/swift+0x40df5b4) #​1 0x00000000040df8f6 SignalHandler(int) (/usr/bin/swift+0x40df8f6) #​2 0x00007efd23f50390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390) #​3 0x00007efd13af8657 $S10Foundation11XMLDocumentC4data7optionsAcA4DataV_AA7XMLNodeC7OptionsVtKcfcTf4xnn_n (/usr/lib/swift/linux/libFoundation.so+0x717657) #​4 0x00007efd13af1590 $S10Foundation11XMLDocumentC4data7optionsAcA4DataV_AA7XMLNodeC7OptionsVtKcfC (/usr/lib/swift/linux/libFoundation.so+0x710590) #​5 0x00007efd2437f10a #​6 0x000000000103233e llvm::MCJIT::runFunction(llvm::Function*, llvm::ArrayRef<llvm::GenericValue>) (/usr/bin/swift+0x103233e) #​7 0x0000000001036462 llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, char const* const*) (/usr/bin/swift+0x1036462) #​8 0x00000000004f6ca2 swift::RunImmediately(swift::CompilerInstance&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, swift::IRGenOptions&, swift::SILOptions const&) (/usr/bin/swift+0x4f6ca2) #​9 0x00000000004dd337 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) (/usr/bin/swift+0x4dd337) #​10 0x00000000004d87fc swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/usr/bin/swift+0x4d87fc) #​11 0x000000000048af42 main (/usr/bin/swift+0x48af42) #​12 0x00007efd2267a830 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20830) #​13 0x0000000000487e19 _start (/usr/bin/swift+0x487e19) Stack dump: 0. Program arguments: /usr/bin/swift -frontend -interpret foo.swift -disable-objc-interop -color-diagnostics -module-name foo Illegal instruction
If you attach lldb you see this:
$ swiftc foo.swift $ lldb foo (lldb) target create "foo" Current executable set to 'foo' (x86_64). (lldb) r Process 575 launched: '//foo' (x86_64) Process 575 stopped * thread #​1, name = 'foo', stop reason = signal SIGILL: illegal instruction operand frame #​0: 0x00007ffff735a657 libFoundation.so`function signature specialization <Arg[0] = Exploded> of Foundation.XMLDocument.init(data: Foundation.Data, options: Foundation.XMLNode.Options) throws -> Foundation.XMLDocument + 391 libFoundation.so`function signature specialization <Arg[0] = Exploded> of Foundation.XMLDocument.init(data: Foundation.Data, options: Foundation.XMLNode.Options) throws -> Foundation.XMLDocument: -> 0x7ffff735a657 <+391>: ud2 0x7ffff735a659: nopl (%rax) libFoundation.so`function signature specialization <Arg[0] = Exploded> of Foundation.XMLDocument.init(xmlString: Swift.String, options: Foundation.XMLNode.Options) throws -> Foundation.XMLDocument: 0x7ffff735a660 <+0>: pushq %rbp 0x7ffff735a661 <+1>: movq %rsp, %rbp Target 0: (//foo) stopped. (lldb) dis ... 0x7ffff735a651 <+385>: popq %r14 0x7ffff735a653 <+387>: popq %r15 0x7ffff735a655 <+389>: popq %rbp 0x7ffff735a656 <+390>: retq -> 0x7ffff735a657 <+391>: ud2
The text was updated successfully, but these errors were encountered:
@millenomi, does this look familiar?
Sorry, something went wrong.
Looks like an overflow converting the options to an Int32.
#1551
This has been resolved in master branch:
master
$ ~/swift-DEVELOPMENT-SNAPSHOT-2018-07-31-a-ubuntu16.04/usr/bin/swift Welcome to Swift version 4.2-dev (LLVM a4d539e482, Clang 773ac0251a, Swift d558aebcd8). Type :help for assistance. 1> import Foundation 2. 3. let xmlString = """ 4. <?xml version="1.0" encoding="UTF-8"?> 5. <document> 6. </document> 7. """ 8. 9. let data = xmlString.data(using: .utf8)! 10. let document = try XMLDocument(data: data, options: .nodePreserveAll) 11. print(document) <?xml version="1.0" encoding="utf-8"?> <document> </document>
spevans
No branches or pull requests
Environment
Swift 4.2 branch
Swift 4.1
Linux f1cd7d250550 4.4.0-34-generic #53~14.04.1-Ubuntu SMP Wed Jul 27 16:56:40 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Additional Detail from JIRA
md5: 2166b60cd42a75ea294989318f1cd5a9
Issue Description:
With this code on linux:
Running fails:
If you attach lldb you see this:
The text was updated successfully, but these errors were encountered: