-
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
malloc: *** error for object 0x700002a96090 #2032
Comments
@Mladen-K Can you provide a sample project? That configuration is not even valid:
After fixing the configuration (replacing tabs for spaces and removing the empty |
There may indeed be a problem with case sensitivity somewhere in the code. Let me explain : I have a similar issue here on my machine, where Then I cloned the SwiftLint repo, and noticed the default arguments for debugging are I re-ran swiftlint on the original folder using Then i realised i had recently renamed my repo folder to lowercase. I strongly suspect it's linked |
I also have a crash stack if anyone is interested. It's a crash in the SourceKittenFramework, in JSONOutput.swift:33, deep in |
@jerome-noel, do you think this might be related to #2091? (Maybe the old, cached paths are now in the wrong case?) Is your file system case‐sensitive? Does the problem go away if you delete the cache? (Unless you have specified a custom location, it would be at |
I think it is related to #2091 indeed |
I was able to reproduce it as well. // this crashes when options contains [.sortedKeys]
let prettyJSONData = try JSONSerialization.data(withJSONObject: object, options: options) |
Actually, I could isolate it on a playground: //: Playground - noun: a place where people can play
import Cocoa
let k1 = "[\"/Users/marcelofabri/SwiftLint/source\",[[\"block_based_kvo\",\"warning\"],[\"class_delegate_protocol\",\"warning\"],[\"closing_brace\",\"warning\"],[\"closure_parameter_position\",\"warning\"],[\"colon\",\"warning, flexible_right_spacing: false, apply_to_dictionaries: true\"],[\"comma\",\"warning\"],[\"compiler_protocol_init\",\"warning\"],[\"control_statement\",\"warning\"],[\"custom_rules\",\"\"],[\"cyclomatic_complexity\",\"warning: 10, error: 20, ignores_case_statements: false\"],[\"discarded_notification_center_observer\",\"warning\"],[\"discouraged_direct_init\",\"warning, types: [\"Bundle\", \"Bundle.init\", \"UIDevice\", \"UIDevice.init\"]\"],[\"dynamic_inline\",\"error\"],[\"empty_enum_arguments\",\"warning\"],[\"empty_parameters\",\"warning\"],[\"empty_parentheses_with_trailing_closure\",\"warning\"],[\"fallthrough\",\"warning\"],[\"file_length\",\"warning: 400, error: 1000ignore_comment_only_lines: false\"],[\"for_where\",\"warning\"],[\"force_cast\",\"error\"],[\"force_try\",\"error\"],[\"function_body_length\",\"warning: 40, error: 100\"],[\"function_parameter_count\",\"warning: 5, error: 8\"],[\"generic_type_name\",\"(min_length) w/e: 1/0, (max_length) w/e: 20/1000, excluded: [], allowed_symbols: [], validates_start_with_lowercase: true\"],[\"identifier_name\",\"(min_length) w/e: 3/2, (max_length) w/e: 40/60, excluded: [], allowed_symbols: [], validates_start_with_lowercase: true\"],[\"implicit_getter\",\"warning\"],[\"is_disjoint\",\"warning\"],[\"large_tuple\",\"warning: 2, error: 3\"],[\"leading_whitespace\",\"warning\"],[\"legacy_cggeometry_functions\",\"warning\"],[\"legacy_constant\",\"warning\"],[\"legacy_constructor\",\"warning\"],[\"legacy_nsgeometry_functions\",\"warning\"],[\"line_length\",\"warning: 120, error: 200, ignores urls: false, ignores function declarations: false, ignores comments: false\"],[\"mark\",\"warning\"],[\"multiple_closures_with_trailing_closure\",\"warning\"],[\"nesting\",\"(type_level) w: 1, (statement_level) w: 5\"],[\"notification_center_detachment\",\"warning\"],[\"opening_brace\",\"warning\"],[\"operator_whitespace\",\"warning\"],[\"private_over_fileprivate\",\"warning, validate_extensions: false\"],[\"private_unit_test\",\"[\"private_unit_test\",\"\",\"Unit test marked `private` will not be run by XCTest.\",\"XCTestCase\",\"\",\"warning\"]\"],[\"protocol_property_accessors_order\",\"warning\"],[\"redundant_discardable_let\",\"warning\"],[\"redundant_optional_initialization\",\"warning\"],[\"redundant_string_enum_value\",\"warning\"],[\"redundant_void_return\",\"warning\"],[\"return_arrow_whitespace\",\"warning\"],[\"shorthand_operator\",\"error\"],[\"statement_position\",\"(statement_mode) default, (severity) warning\"],[\"superfluous_disable_command\",\"error\"],[\"switch_case_alignment\",\"warning\"],[\"syntactic_sugar\",\"warning\"],[\"todo\",\"warning\"],[\"trailing_comma\",\"warning, mandatory_comma: false\"],[\"trailing_newline\",\"warning\"],[\"trailing_semicolon\",\"warning\"],[\"trailing_whitespace\",\"warning, ignores_empty_lines: false, ignores_comments: true\"],[\"type_body_length\",\"warning: 200, error: 350\"],[\"type_name\",\"(min_length) w/e: 3/0, (max_length) w/e: 40/1000, excluded: [], allowed_symbols: [], validates_start_with_lowercase: true\"],[\"unneeded_break_in_switch\",\"warning\"],[\"unused_closure_parameter\",\"warning\"],[\"unused_enumerated\",\"warning\"],[\"unused_optional_binding\",\"warning, ignore_optional_try: false\"],[\"valid_ibinspectable\",\"warning\"],[\"vertical_parameter_alignment\",\"warning\"],[\"vertical_whitespace\",\"warning, max_empty_lines: 1\"],[\"void_return\",\"warning\"],[\"weak_delegate\",\"warning\"],[\"xctfail_message\",\"warning\"]]]"
let k2 = "[\"/Users/marcelofabri/SwiftLint/Source\",[[\"block_based_kvo\",\"warning\"],[\"class_delegate_protocol\",\"warning\"],[\"closing_brace\",\"warning\"],[\"closure_parameter_position\",\"warning\"],[\"colon\",\"warning, flexible_right_spacing: false, apply_to_dictionaries: true\"],[\"comma\",\"warning\"],[\"compiler_protocol_init\",\"warning\"],[\"control_statement\",\"warning\"],[\"custom_rules\",\"\"],[\"cyclomatic_complexity\",\"warning: 10, error: 20, ignores_case_statements: false\"],[\"discarded_notification_center_observer\",\"warning\"],[\"discouraged_direct_init\",\"warning, types: [\"Bundle\", \"Bundle.init\", \"UIDevice\", \"UIDevice.init\"]\"],[\"dynamic_inline\",\"error\"],[\"empty_enum_arguments\",\"warning\"],[\"empty_parameters\",\"warning\"],[\"empty_parentheses_with_trailing_closure\",\"warning\"],[\"fallthrough\",\"warning\"],[\"file_length\",\"warning: 400, error: 1000ignore_comment_only_lines: false\"],[\"for_where\",\"warning\"],[\"force_cast\",\"error\"],[\"force_try\",\"error\"],[\"function_body_length\",\"warning: 40, error: 100\"],[\"function_parameter_count\",\"warning: 5, error: 8\"],[\"generic_type_name\",\"(min_length) w/e: 1/0, (max_length) w/e: 20/1000, excluded: [], allowed_symbols: [], validates_start_with_lowercase: true\"],[\"identifier_name\",\"(min_length) w/e: 3/2, (max_length) w/e: 40/60, excluded: [], allowed_symbols: [], validates_start_with_lowercase: true\"],[\"implicit_getter\",\"warning\"],[\"is_disjoint\",\"warning\"],[\"large_tuple\",\"warning: 2, error: 3\"],[\"leading_whitespace\",\"warning\"],[\"legacy_cggeometry_functions\",\"warning\"],[\"legacy_constant\",\"warning\"],[\"legacy_constructor\",\"warning\"],[\"legacy_nsgeometry_functions\",\"warning\"],[\"line_length\",\"warning: 120, error: 200, ignores urls: false, ignores function declarations: false, ignores comments: false\"],[\"mark\",\"warning\"],[\"multiple_closures_with_trailing_closure\",\"warning\"],[\"nesting\",\"(type_level) w: 1, (statement_level) w: 5\"],[\"notification_center_detachment\",\"warning\"],[\"opening_brace\",\"warning\"],[\"operator_whitespace\",\"warning\"],[\"private_over_fileprivate\",\"warning, validate_extensions: false\"],[\"private_unit_test\",\"[\"private_unit_test\",\"\",\"Unit test marked `private` will not be run by XCTest.\",\"XCTestCase\",\"\",\"warning\"]\"],[\"protocol_property_accessors_order\",\"warning\"],[\"redundant_discardable_let\",\"warning\"],[\"redundant_optional_initialization\",\"warning\"],[\"redundant_string_enum_value\",\"warning\"],[\"redundant_void_return\",\"warning\"],[\"return_arrow_whitespace\",\"warning\"],[\"shorthand_operator\",\"error\"],[\"statement_position\",\"(statement_mode) default, (severity) warning\"],[\"superfluous_disable_command\",\"error\"],[\"switch_case_alignment\",\"warning\"],[\"syntactic_sugar\",\"warning\"],[\"todo\",\"warning\"],[\"trailing_comma\",\"warning, mandatory_comma: false\"],[\"trailing_newline\",\"warning\"],[\"trailing_semicolon\",\"warning\"],[\"trailing_whitespace\",\"warning, ignores_empty_lines: false, ignores_comments: true\"],[\"type_body_length\",\"warning: 200, error: 350\"],[\"type_name\",\"(min_length) w/e: 3/0, (max_length) w/e: 40/1000, excluded: [], allowed_symbols: [], validates_start_with_lowercase: true\"],[\"unneeded_break_in_switch\",\"warning\"],[\"unused_closure_parameter\",\"warning\"],[\"unused_enumerated\",\"warning\"],[\"unused_optional_binding\",\"warning, ignore_optional_try: false\"],[\"valid_ibinspectable\",\"warning\"],[\"vertical_parameter_alignment\",\"warning\"],[\"vertical_whitespace\",\"warning, max_empty_lines: 1\"],[\"void_return\",\"warning\"],[\"weak_delegate\",\"warning\"],[\"xctfail_message\",\"warning\"]]]"
let dict = [k1: "test", k2: "test2"]
let data = try? JSONSerialization.data(withJSONObject: dict, options: [.prettyPrinted, .sortedKeys]) |
New Issue Checklist
Bug Report
Complete output when running SwiftLint, including the stack trace and command used
Environment
Error is present when root project directory name contains dashes - My-Swift-Project
When dashes are removed - MySwiftProject, linter is not returning error.
The text was updated successfully, but these errors were encountered: