-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Segmentation fault with nested configs and autocorrect. #368
Comments
@scottrhoyt can you enable the option |
I'm getting the same behavior..
when remove use_nested_configs: true, autocorrect works correctly. I'm on OSX 10.10.5. |
@mlennon3 how can we reproduce that? What about your configuration makes this crash? Can you build & run SwiftLint from Xcode so that LLDB shows where this is crashing? Maybe if you shared the contents of your config files and their layout in the file system, we'd have more information to go on? |
I created a shell project called nestedLint, which is an xcodeproj, and has no swift files besides the ones provided by xcode (AppDelegate, etc). I have:
|
Hmm, I can't reproduce it like that:
|
Did you try |
Yes |
OK so if I do the steps you have done there, i get no segfault. If however, I don't mkdir topdir but instead create a project in Xcode called topdir, and do the rest as you have it written, I get segfault 11 |
Still no luck: $ cat .swiftlint.yml
use_nested_configs: true
$ cat LintSegFault/.swiftlint.yml
$ tree -a
.
├── .swiftlint.yml
├── LintSegFault
│ ├── .swiftlint.yml
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── Info.plist
│ └── ViewController.swift
└── LintSegFault.xcodeproj
├── project.pbxproj
└── project.xcworkspace
└── contents.xcworkspacedata
6 directories, 10 files
$ swiftlint autocorrect
swiftlint autocorrect
Loading configuration from '.swiftlint.yml'
Correcting Swift files in current working directory
Correcting 'AppDelegate.swift' (1/2)
/tmp/LintSegFault/LintSegFault/AppDelegate.swift:45 Corrected Trailing Newline
Correcting 'ViewController.swift' (2/2)
/tmp/LintSegFault/LintSegFault/ViewController.swift:24 Corrected Trailing Newline
Done correcting 2 files! |
Hm. Well I'm on XCode Version 7.2 (7C68)... |
|
OK here's a difference:
This is like more how we have our directories structured in our real app than the example you gave.. |
Aha! That last directory structure you shared was key in reproducing this:
Thanks for your help, I think we can take it from here. |
Great, thanks |
…rsion fix infinite recursion when using nested config files. Fixes #368
Not 100% sure on this one. Was getting a segmentation fault using
autocorrect
, and I removedenable_nesting_configs: true
and it went away. There might be something to investigate here.The text was updated successfully, but these errors were encountered: