Bug 266925 - devel/rubygem-google-protobuf: Use hidden symbols
Summary: devel/rubygem-google-protobuf: Use hidden symbols
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Matthias Fechner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-10 02:27 UTC by gwright
Modified: 2022-11-19 10:14 UTC (History)
5 users (show)

See Also:
eduardo: maintainer-feedback? (sunpoet)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gwright 2022-10-10 02:27:05 UTC
Hi,
After updating my gitlab-ce installation to 15.3.4, the situation described here (https://gitlab.com/gitlab-org/gitlab/-/issues/345693) began happening again.

I did a complete uninstall and reinstall of all packages (my gitlab-ce instance runs in a jail so deleting everything is easy).  Upon restarting gitlab, the problem still occurred. Any repo with a LICENSE file generated a 500 error.

I checked which packages were installed and found

root@gitlab:~ # pkg info | grep protob
protobuf-3.20.3,1              Data interchange format library
rubygem-google-protobuf-3.21.7 Ruby extension to Google Protocol Buffers
rubygem-google-protobuf319-3.19.6 Ruby extension to Google Protocol Buffers

I forced the deletion of rubygem-google-protobuf-3.21.7, but after that gitlab would not start because gitaly demanded version 3.21.  I hand edited the Gemfile in /usr/local/share/gitaly/ruby/ to use version 3.19.  Gitlab starts now and repositories with LICENSE files are now rendered on the web page.

Everything seems to be working but I'm sure that others will start seeing this problem soon.  Thank you for keeping Gitlab running on FreeBSD!
Comment 1 Guillaume Bibaut 2022-10-15 08:24:00 UTC
I also got this problem.
Using 3.19 instead of 3.21 seems to do the trick.
Comment 2 Matthias Fechner freebsd_committer freebsd_triage 2022-10-24 13:47:45 UTC
I will look into it, but please give me 3 weeks, I currently do not have hardware available I need.
Comment 3 Matthias Fechner freebsd_committer freebsd_triage 2022-10-26 04:23:12 UTC
Thanks to bofh@ I got a jail I can do tests.
I was now able to reproduce the problem and have a fix available.
I will commit it together with 15.4.2 upgrade which needs some more testing but is nearly finished.
Comment 4 Matthias Fechner freebsd_committer freebsd_triage 2022-10-28 14:32:46 UTC
The source of the problem is fixed by this review:
https://reviews.freebsd.org/D37140
Comment 5 gwright 2022-11-11 21:33:02 UTC
I followed the documented upgrade procedure from 15.3.4 to 15.4.4 and this
problem came back.  Browsing the repository web page of a project containing
a 'LICENSE' file generated an html 500 error.  Repos without a LICENSE file
display normally.

The workaround was to delete rubygem-google-protobufs-3.21.7; delete /usr/local/share/gitaly/ruby/Gemfile.lock; edit /usr/local/share/gitaly/ruby/Gemfile to allow using version 3.19.6 of google-protobufs; delete /usr/local/www/gitlab-ce/Gemfile.lock; edit /usr/local/www/gitlab-ce/Gemfile to allow using version 3.19.6 of google-protobufs as well.

After the above procedure and a restart, repository containing LICENSE files
again displayed in the GitLab web interface.

Have fixes for this problem not been included in rubygem-google-protobuf-3.21.7
yet?
Comment 6 Geoffrey Mainland 2022-11-11 21:42:47 UTC
I had the do the same when upgrading to 15.4.4. This fix *is not* yet in devel/rubygem-google-protobuf (it is awaiting maintainer feedback).

Thanks to Matthias for all his work. Hopefully this fix to devel/rubygem-google-protobuf is reviewed and merged soon.
Comment 7 commit-hook freebsd_committer freebsd_triage 2022-11-19 05:13:02 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b5673e0619b56126e2117ac98cbcbe2be24b959a

commit b5673e0619b56126e2117ac98cbcbe2be24b959a
Author:     Dan McGregor <dan.mcgregor@usask.ca>
AuthorDate: 2022-11-19 05:03:31 +0000
Commit:     Matthias Fechner <mfechner@FreeBSD.org>
CommitDate: 2022-11-19 05:12:24 +0000

    devel/rubygem-google-protobuf*: fix segfaults caused by public symbols

    If more than one version of this gem is installed it causes segfaults.
    The problem is reported also here:
    https://gitlab.com/gitlab-org/gitlab/-/issues/345693

    I created a merge request upstream for this patch:
    https://github.com/protocolbuffers/protobuf/pull/10832
    https://github.com/protocolbuffers/protobuf/pull/11029

    PR:             266925
    Approved by:    sunpoet (maintainer timeout)
    Differential Revision:  https://reviews.freebsd.org/D37140

 devel/rubygem-google-protobuf/Makefile                        |  1 +
 .../files/patch-ext_google_protobuf__c_extconf.rb (new)       | 11 +++++++++++
 devel/rubygem-google-protobuf319/Makefile                     |  1 +
 .../files/patch-ext_google_protobuf__c_extconf.rb (new)       | 11 +++++++++++
 4 files changed, 24 insertions(+)
Comment 8 Matthias Fechner freebsd_committer freebsd_triage 2022-11-19 05:16:02 UTC
Committed, thanks.
Comment 9 Po-Chuan Hsieh freebsd_committer freebsd_triage 2022-11-19 10:14:04 UTC
Thanks!