Closed JWAlberty closed 1 year ago
In xpath v1.2.2, Expr
object will be allows reused and replace re-create new object if it cached by the htmlquery
. https://github.com/antchfx/xpath/commit/dfece7e444f00ae3aea4086a84ba9afdc0b93783
You can disable htmlquery
caching temporarily via htmlquery.DisableSelectorCache = true
to sove it and waiting fix.
update htmlquery to the new version https://github.com/antchfx/htmlquery/releases/tag/v1.3.0
it appears positmap in
descendantQuery
somehow gets reused. I have not been able to find any global state that is the cause but I did manage to make a (unreliable) test case. If I set it to 100 goroutines it pretty reliably triggers it for me, though i've gotten it to trigger with as few as 20 goroutines. It only seems to happen with xpath 1.2.2 but going to htmlquery 1.2.5 seems to make it less likely to happen (though 1.2.5 htmlquery seems to cause hangs). I have never been able to reproduce it with xpath 1.2.1. Attaching testcase with 100 goroutines and a stack trace from a run with 30 (for brevity) Test case:stack trace: