Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
segfault requiring 'mysql2' gem on bionic #7851
When attempting to install and require the mysql2 gem for use in a chef recipe, a segmentation fault occurs.
Linux 4.15.0-1018-gcp #19-Ubuntu SMP Thu Aug 16 13:38:55 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
I reproduced the issue easily using chef-shell & the embedded gem binaries:
See gist above
I worked around this issue by replacing the libssl & libcrypto libraries with the versions shipped with ubuntu
so i have no idea why this works with the irb shipped inside of chef but you're linking against the libssl in your system, not the one from the openssl that is shipped in embedded which ruby is linked against.
in general in order to do this you need to install the mysql libs into embedded/lib linked against the underlying embedded libs first. then you can install the gem against that mysql library.
that is an old RFC which has never been implemented in order to do that for everyone in omnibus-chef. nokogiri/libxml2/libxslt got done, but pg + mysql never got done.
probably going to wind up closing this because its not a bug in chef-client itself, its just a larger architectural issue inherent to omnibus builds.
no, that'd be worse.
ideally there would be a cookbook that would install it correctly, but looking around the mysql_chef_gem/mysql_chef_gem2 cookbooks it doesn't seem like i can find one that does the necessary magic to correctly install the mysql libs.