scinfu / SwiftSoup

SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)
https://scinfu.github.io/SwiftSoup/
MIT License
4.52k stars 345 forks source link

Swift Soup version 2 kept crashing recently with this stackTrace #181

Closed DineshKaturi444 closed 2 years ago

DineshKaturi444 commented 3 years ago

Crashed: com.apple.root.user-initiated-qos EXC_BAD_ACCESS KERN_INVALIDADDRESS 0x0000000000000000 specialized static Entities.codepointsForName(:)

Crashed: com.apple.root.user-initiated-qos 0 SwiftSoup 0x101f6d714 specialized static Entities.codepointsForName(:) + 4327626516 (:4327626516) 1 SwiftSoup 0x101fa4084 Tokeniser.consumeCharacterReference(::) + 187 (Tokeniser.swift:187) 2 SwiftSoup 0x101fa5898 TokeniserState.read(::) + 1601 (TokeniserState.swift:1601) 3 SwiftSoup 0x101f72bd0 HtmlTreeBuilder.parseFragment(:::::) + 46 (Tokeniser.swift:46) 4 SwiftSoup 0x101f8fe84 specialized static Parser.parseBodyFragment(::) + 120 (Parser.swift:120) 5 SwiftSoup 0x101f9def4 parseBodyFragment(_:) + 152 (SwiftSoup.swift:152)

vrjustin commented 3 years ago

Any thoughts on this? I'm getting the same thing starting ~ May 18, 2021.

jeffersonsetiawan commented 3 years ago

My guess is related to multiple thread want to write to the public static var multipoints in the Entities.swift.

As the Dictionary is not thread safe https://forums.swift.org/t/recommendation-for-thread-safe-dictionary/394