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
Segfault occurs as soon as requires sorted_set or rbtree #1334
Comments
@Watson1978 please let me know if you have any insight especially this is most likely involve C extension 🤷 |
Seems like it's suggesting this line and taking closer look @dlemstra Since you're very familiar with C code, any potential issue that you can share regarding how rbtree could interfere read? |
https://gist.github.com/Watson1978/0ec37694a363c64414b944ed47dd8373
hmm, I confirmed that your code causes SEGV within rbtree. |
If possible, it would be better to use something other than PDF, since processing JPEG instead of PDF does not seem to cause SEGV.
|
Thank you
💯 Shouldn't |
A simpler reproduction code would look like below. require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'rmagick', '~> 4.2.5'
gem 'sorted_set'
end
require 'rmagick'
require 'sorted_set'
Magick::Image.read('sample.pdf') |
I'm guessing there is something wrong with the alpine configuration or something, and the loaded C symbols are conflicting.... |
I'm curious would it be due to dict_first() from ghostscript vs dict_first() defined by rbtree |
At least, there is no way that can be solved with RMagick. (It stop using PDF or create a docker image with another OS instead of alpine) |
@Watson1978 I highly appreciated the gist above and I agreed with you that this is not related to rmagick. |
I think the rbtree and ghostscript libraries are not linked, so it is curious that the symbols conflict. |
Description
As soon as, I installed both
rmagick
andrbtree
orrmagick
withsorted_set
, segmentation fault would happen immediately with the single file rails setup below.Steps to Reproduce
docker pull ruby:2.7.6-alpine3.15
ordocker pull ruby:3.0.4-alpine3.15
ordocker pull ruby:3.1.2-alpine3.15
repro.rb
in containerapk add pkgconfig imagemagick imagemagick-dev imagemagick-libs
apk add sqlite sqlite-dev
apk add build-base gcc autoconf libffi-dev openssl-dev
ruby repro.rb
inside docker containerSystem Configuration
The text was updated successfully, but these errors were encountered: