Skip to content

[SR-8315] SourceKit crashes with "Assertion `Loc.Value.getPointer() >= Buffer->getBuffer().begin() && Loc.Value.getPointer() <= Buffer->getBuffer().end() && "Location is not from the specified buffer"'" #50843

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

Closed
norio-nomura opened this issue Jul 19, 2018 · 5 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@norio-nomura
Copy link
Contributor

Previous ID SR-8315
Radar rdar://problem/42492793
Original Reporter @norio-nomura
Type Bug
Status Resolved
Resolution Done
Environment

swift-4.2-DEVELOPMENT-SNAPSHOT-2018-07-18-a
Xcode 10 beta 4

Additional Detail from JIRA
Votes 1
Component/s Source Tooling
Labels Bug
Assignee @rintaro
Priority Medium

md5: 5413265bfe8ed7e44759e32b7a5f0225

Issue Description:

Reproducing steps:

  1. docker run -it norionomura/swift:4220180718a

  2. git clone https://github.com/jpsim/SourceKitten.git

  3. cd SourceKitten

  4. curl -o request.yml https://gist.githubusercontent.com/norio-nomura/74ebf8dc1c903975fd383bfa8ef7d802/raw/4400081ae7e5def51503a3c2afe8606cbee9f5fd/request.yml

  5. swift run sourcekitten request --yaml request.yml

Actual log:

$ docker run -it norionomura/swift:4220180718a
Unable to find image 'norionomura/swift:4220180718a' locally
4220180718a: Pulling from norionomura/swift
Digest: sha256:1fc3cad1a913e758e03dea73082ddc9afe453a8a2f48ccc7f2913c36c466ed51
Status: Downloaded newer image for norionomura/swift:4220180718a
root@19854483d5d2:/# git clone https://github.com/jpsim/SourceKitten.git
Cloning into 'SourceKitten'...
remote: Counting objects: 10074, done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 10074 (delta 34), reused 23 (delta 10), pack-reused 10007
Receiving objects: 100% (10074/10074), 7.74 MiB | 1.32 MiB/s, done.
Resolving deltas: 100% (6486/6486), done.
Checking connectivity... done.
root@19854483d5d2:/# cd SourceKitten
root@19854483d5d2:/SourceKitten# curl -o request.yml https://gist.githubusercontent.com/norio-nomura/74ebf8dc1c903975fd383bfa8ef7d802/raw/4400081ae7e5def51503a3c2afe8606cbee9f5fd/request.yml
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   231  100   231    0     0    664      0 --:--:-- --:--:-- --:--:--   665
root@19854483d5d2:/SourceKitten# swift run sourcekitten request --yaml request.yml
Fetching https://github.com/jpsim/Yams.git
Fetching https://github.com/antitypical/Result.git
Fetching https://github.com/Quick/Quick.git
Fetching https://github.com/Quick/Nimble.git
Fetching https://github.com/drmohundro/SWXMLHash.git
Fetching https://github.com/Carthage/Commandant.git
Completed resolution in 10.02s
Cloning https://github.com/Quick/Nimble.git
Resolving https://github.com/Quick/Nimble.git at 7.1.1
Cloning https://github.com/jpsim/Yams.git
Resolving https://github.com/jpsim/Yams.git at 1.0.0
Cloning https://github.com/antitypical/Result.git
Resolving https://github.com/antitypical/Result.git at 3.2.4
Cloning https://github.com/drmohundro/SWXMLHash.git
Resolving https://github.com/drmohundro/SWXMLHash.git at 4.7.0
Cloning https://github.com/Carthage/Commandant.git
Resolving https://github.com/Carthage/Commandant.git at 0.13.0
Cloning https://github.com/Quick/Quick.git
Resolving https://github.com/Quick/Quick.git at 1.3.0
warning: PackageDescription API v3 is deprecated and will be removed in the future; used by package(s): Result
Compile SourceKit SourceKit.m
Compile Swift Module 'SWXMLHash' (3 sources)
/SourceKitten/.build/checkouts/SWXMLHash.git-106485390961933485/Source/SWXMLHash.swift:430:33: warning: conditional cast from 'Error' to 'NSError' always succeeds
        if let err = parseError as? NSError {
                                ^
Compile Swift Module 'Result' (2 sources)
Compile Clang_C Clang_C.m
Compile Swift Module 'Commandant' (9 sources)
Compile CYaml src/writer.c
Compile CYaml src/scanner.c
Compile CYaml src/reader.c
Compile CYaml src/parser.c
Compile CYaml src/emitter.c
Compile CYaml src/api.c
Compile Swift Module 'Yams' (16 sources)
Compile Swift Module 'SourceKittenFramework' (37 sources)
Compile Swift Module 'sourcekitten' (11 sources)
Linking ./.build/x86_64-unknown-linux/debug/sourcekitten
sourcekitten: /home/buildnode/jenkins/workspace/oss-swift-4.2-package-linux-ubuntu-16_04/swift/lib/Basic/SourceLoc.cpp:158: unsigned int swift::SourceManager::getLocOffsetInBuffer(swift::SourceLoc, unsigned int) const: Assertion `Loc.Value.getPointer() >= Buffer->getBuffer().begin() && Loc.Value.getPointer() <= Buffer->getBuffer().end() && "Location is not from the specified buffer"' failed.
Aborted
@norio-nomura
Copy link
Contributor Author

Same with Xcode 10 beta 4:

$ swift run sourcekitten request --yaml request.yml
Compile SourceKit SourceKit.m
Compile Clang_C Clang_C.m
Compile CYaml src/writer.c
Compile CYaml src/scanner.c
Compile Swift Module 'Result' (2 sources)
Compile Swift Module 'SWXMLHash' (3 sources)
Compile CYaml src/reader.c
Compile CYaml src/parser.c
Compile CYaml src/emitter.c
Compile CYaml src/api.c
Compile Swift Module 'Commandant' (9 sources)
Compile Swift Module 'Yams' (16 sources)
Compile Swift Module 'SourceKittenFramework' (38 sources)
Compile Swift Module 'sourcekitten' (11 sources)
Linking ./.build/x86_64-apple-macosx10.10/debug/sourcekitten
sourcekit: [1:connection-event-handler:3587: 0.0000] Connection interruptsourcekit: [1:updateSemanticEditorDelay:3587: 0.0016] disabling semantic editor for 10 secondssourcekit: [1:pingService:3587: 0.0017] pinging servicesourcekitten: connection to SourceKitService restored!
The operation couldnt be completed. (SourceKittenFramework.Request.Error error 0.)

@rintaro
Copy link
Mannequin

rintaro mannequin commented Jul 23, 2018

@swift-ci create

@rintaro
Copy link
Mannequin

rintaro mannequin commented Jul 23, 2018

master: #18144

@rintaro
Copy link
Mannequin

rintaro mannequin commented Jul 25, 2018

#18166

@norio-nomura
Copy link
Contributor Author

I confirmed that this issue has been resolved on swift-4.2-DEVELOPMENT-SNAPSHOT-2018-07-27-a.
Thanks! 😃

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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.
Projects
None yet
Development

No branches or pull requests

1 participant