Closed rintaun closed 11 years ago
Provide backtrace please, I doubt this be related to assetpack directly as I there is segault issues in other ruby libs with 2.0.0 (psych & other basic libs).
https://gist.github.com/rintaun/5512860 That's from my actual application
https://gist.github.com/rintaun/5512891 is from a minimal application I wrote to reproduce this crash
Thanks, this part (sinatra/assetpack/buster_helpers.rb:8) is not very optimized as it calculate the full content hash on every request (I think), we should look into it.
# Returns the MD5 for all of the files concatenated together
def cache_buster_hash(*files)
content = files.sort.map { |f| File.read(f).to_s if f.is_a?(String) && File.file?(f) }.compact
Digest::MD5.hexdigest(content.join) if content.any? # culprit
end
Before we were using the files mtime but it's not as accurate. We should cache it in memory using an instance variable or add a manifest as suggested in #82
Without new informations available, Ill close this one as it seems to be a ruby-2.0.0-p0 specific bug that should be fixed in ruby-2.0.0-p195.
sinatra-assetpack seems to be causing a segmentation fault in ruby-2.0.0-p0 when the request rate is very high. It seems only to occur when there are > 1 files in a pack, and may be due to multi-threading.
The segfault seems to occur at random places in the code, but only occurs when the
js
helper is called in a view.I can provide instructions on reproducing and provide backtraces upon request, but they're somewhat long to just paste in this issue.