flori/amatch — Issue #6: Segfault with String#pair_distance_similar
Author: seamusabshere
Created: 2012-02-23 21:35:02+00:00
State: open

(this was previously reported by me in #3, but that issue is more focused on a Jaro-Winkler bug. apologies for spamming it before)

I'm finding this very hard to reproduce.

I've seen it in production on Heroku Celadon Cedar.

https://gist.github.com/8bfe1132e31ba97a3102
https://gist.github.com/8b4e3a1cd1da5472ffa4

Here's one approximation of what my app is doing, but of course it doesn't segfault:

require 'faker'
require 'fuzzy_match'
require 'amatch'
FuzzyMatch.engine = :amatch

haystack = []
1000.times {
haystack << Faker::Company.name
}

1000.times {
fuzzy_match = FuzzyMatch.new(haystack)
needle = Faker::Company.name
match = fuzzy_match.find needle
puts [needle, match].join(' => ')
}