ruby-ncurses broken in bionic

Bug #1775673 reported by Jean Michel
48
This bug affects 6 people
Affects Status Importance Assigned to Milestone
ruby-ncurses (Ubuntu)
Invalid
Undecided
Unassigned
Bionic
Fix Released
Undecided
Iain Parris
tpp (Ubuntu)
Invalid
Undecided
Unassigned
Bionic
Invalid
Undecided
Unassigned

Bug Description

[Impact]

ruby-ncurses is broken and unusable in Bionic.

Any program which depends on ruby-ncurses will crash at runtime with a LoadError.

[Test Case]

$ sudo apt install ruby-ncurses
$ ruby -e 'require "ncurses"'

With ruby-ncurses 1.4.9-1build3 (Bionic), this will always immediately crash with a LoadError (... "ncursesw_bin.so: undefined symbol: set_menu_win" ...)

[Regression Potential]

ruby-ncurses is broken and unusable in Bionic, so no greater regression is possible for Bionic.

The proposed patch changes ruby-ncurses only, to link against libmenuw instead of libmenu. As a linking change only for this one package, this should be very low risk for creating a regression in any other package.

Care will be required in choosing a version string for a fixed version, to ensure that while greater than Bionic's existing 1.4.9-1build3, it is also less than in Focal (1.4.9-1build5), to avoid creating an upgrade issue.

[Other Info]

The bug is only present in Ubuntu Bionic. It is not present in upstream Debian, nor in any other supported Ubuntu release (Xenial, Eoan, Focal, Groovy).

Examples of packages that have a dependency on ruby-ncurses (and are therefore currently unusable in Bionic): sup-mail, tpp.

tags: added: bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ruby-ncurses (Ubuntu):
status: New → Confirmed
Axel Beckert (xtaran)
Changed in tpp (Ubuntu):
status: New → Confirmed
Revision history for this message
Georg Müller (georgmueller) wrote :

The attached patch also links against libmenuw, which provides set_menu_win.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch for ruby-ncurses to also link libmenuw" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Iain Parris (ipv2) wrote :

This ruby-ncurses bug causes sup-mail to crash in Ubuntu 18.04 with the following error:

Traceback (most recent call last):
 5: from /usr/bin/sup-mail:6:in `<main>'
 4: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
 3: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
 2: from /usr/lib/ruby/vendor_ruby/ncursesw.rb:23:in `<top (required)>'
 1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': /usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0/ncursesw_bin.so: undefined symbol: set_menu_win - /usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0/ncursesw_bin.so (LoadError)

Workaround: manually build and install gem "ncursesw".

# See: https://github.com/sup-heliotrope/sup/issues/550#issuecomment-643757988
sudo apt install \
    build-essential \
    patch \
    ruby-dev \
    zlib1g-dev \
    liblzma-dev \
    libncurses5-dev \
    lib32ncurses5-dev \
    libncursesw5-dev
sudo gem install ncursesw

# Verify that ncursesw is functioning
ruby -e "require 'ncurses'" && echo "fixed"

Note that this Ubuntu bug is likely inherited from Debian Bug #892181 (ruby-ncurses fails to load with Ruby 2.5): https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=892181

The Debian bug was filed on 2018-03-06, at approximately the time that the Ubuntu 18.04 cut of Debian packages would have been taken. However, the upstream Debian bug is now fixed, as of 2018-06-13.

Revision history for this message
Iain Parris (ipv2) wrote :

This is a debdiff for Ubuntu 18.04 (bionic) applicable to ruby-ncurses 1.4.9-1build3. I built this in pbuilder and it builds successfully. I installed it, the patch works as intended.

To reproduce the bug (100% reproducible), install package ruby-ncurses on bionic, then:
    ruby -e 'require "ncurses"'
    # Original 1.4.9-1build3: LoadError (... "ncursesw_bin.so: undefined symbol: set_menu_win" ...)
    # After this debdiff: success

Bug is only present in bionic (i.e., no patch required on xenial, eoan, focal; no patch required on Debian).

Credit to Georg Müller for key idea in the patch (link against libmenuw). (Comment above, <https://bugs.launchpad.net/ubuntu/+source/ruby-ncurses/+bug/1775673/comments/2>)

Revision history for this message
Iain Parris (ipv2) wrote :
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for the patch and the steps to reproduce the bug Iain! I played with it and it indeed fixes the package and now I can "require 'ncurses'" in Bionic.

To get it ready for the SRU we need to fix a couple of things in your patch:

* The version string. You used 1.4.9-1ubuntu1 but this version is greater than what we have in Focal (1.4.9-1build5) and it'd cause issues during the upgrade. We should use this version string: 1.4.9-1build3ubuntu0.18.04.1 (it's a not common version string but it will avoid an upgrade issue).

* Closing bugs in the debian/changelog file. You used "Closes: #NNNN" but it will not close bugs filed in Launchpad (it'd close bugs in the Debian BTS). So you should use "LP: #NNNN".

What I mentioned above is mandatory if we want to land this fix. Below I'll mention something that is a suggestion and it is not a blocker (but good to have):

* Patch's headers. I'd add DEP-3 headers [1] at the top of your patch which means a short description, the author, when it was created, and whatever you think it might be useful. Something like this:

Description: Fixes LoadError "ncursesw_bin.so: undefined symbol: set_menu_win"
Author: Georg Müller <https://launchpad.net/~georgmueller>
Reviewed-By: Iain Parris <email address hidden>
Forwarded: not-needed
Ubuntu-Bug: LP#1775673, LP#1787763
Last-Updated: YYYY-MM-DD

With these headers in place you can cleanup your changelog entry and make it more simple, something on this line:

* Add patch to link against libmenuw (LP: #1775673, LP: ##1787763)

Let me know if you have any doubt or problem. I am willing to drive you through the whole process and get this fix landed in Bionic as soon as we can.

[1] https://dep-team.pages.debian.net/deps/dep3/

Revision history for this message
Iain Parris (ipv2) wrote :

Thank you very much for the detailed review, Lucas!

Everything that you wrote makes perfect sense, and I would like to say a special thank you for taking the time to explain the reasoning for the modifications so clearly. I am also very grateful to you for your kind offer to take me through the process, so that we can hopefully land the fix in bionic.

Please find attached an updated patch, incorporating all of your feedback (both mandatory and recommended):

* Version string "1.4.9-1build3ubuntu0.18.04.1" (so as not to interfere with upgrades)
* debian/changelog: Use "LP: #NNNN" instead of "Closes: #NNNN"
* Add DEP-3 headers and shorten changelog entry

I have followed DEP-3 as closely as I could, e.g., using a standard "Bug-Ubuntu" header. I have also, of course, additionally credited you via a second "Reviewed-By" header.

Like for my first attempt, I have built this in pbuilder and it builds successfully. I installed it, the patch functions as intended.

I'd like to request a review for the updated debdiff please (attached). (I'd of course be happy to make any further changes needed.)

Thank you again, Lucas.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Your patch looks much better now, thanks Iain! I made some small changes in your changelog and uploaded it to a PPA [1] for testing purposes:

* Changed the target to bionic instead of UNRELEASED
* Added "~ppa1" to the string version. With that if someone decides to install the package from the PPA will be able to upgrade to the version we will upload to the archive because '~ppa1' makes the version lesser than '1.4.9-1build3ubuntu0.18.04.1'. Keep in mind this change will be reverted when we upload it to the archive.
* Removed "LP: #1787763". Sorry for not catching this before but since the bug is marked as duplicated we do not need to close it via changelog.

Let me know if you agree with all these changes. With the PPA in place other people can use it to test it, and it will help us in the validation phase of the SRU process.

The next step is to edit the description of this bug to add the SRU bug template [2]. The SRU team will take a look at the description of this bug to evaluate our update. Could you please do that? If you have any question do not hesitate to ask here.

[1] https://launchpad.net/~lucaskanashiro/+archive/ubuntu/bionic-sru-ruby-ncurses
[2] https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template

Iain Parris (ipv2)
Changed in tpp (Ubuntu):
status: Confirmed → Invalid
Changed in ruby-ncurses (Ubuntu):
assignee: nobody → Iain Parris (ipv2)
status: Confirmed → In Progress
Revision history for this message
Iain Parris (ipv2) wrote :

Marked invalid for tpp. tpp has a dependency on ruby-ncurses, and the bug is in ruby-ncurses (not tpp itself).

summary: - ruby-ncurses is broken in ubuntu 18.04
+ ruby-ncurses broken in bionic
Iain Parris (ipv2)
description: updated
Iain Parris (ipv2)
description: updated
Revision history for this message
Iain Parris (ipv2) wrote :

Thanks very much again, Lucas!

* PPA: I confirm that your PPA's ruby-ncurses 1.4.9-1build3ubuntu0.18.04.1~ppa1 worked perfectly for me when installed.

* Changes: I agree completely with your recommended changes (target to "bionic", and remove "LP: #1787763"). Please find attached updated debdiff incorporating these changes, with version string "1.4.9-1build3ubuntu0.18.04.2"

* SRU Bug Template: Done - I've updated the description now, following the template to the best of my ability.

Questions please:

* I couldn't figure out how to update the LP "Affects", to mark specifically the Bionic version of ruby-ncurses as affected, i.e., to set "Affecting: ruby-ncurses (Ubuntu Bionic)" [1]. I may not have access to do this?

* I wasn't sure from [2] whether I should now subscribe "~ubuntu-sponsors" and/or "~ubuntu-sru" to the bug at this stage. What would you recommend please?

* Are any additional tags needed (perhaps verification-*), beyond existing tags "bionic" and "patch"?

[1] https://bugs.launchpad.net/ubuntu/bionic/+source/ruby-ncurses
[2] https://wiki.ubuntu.com/StableReleaseUpdates#Procedure

Changed in tpp (Ubuntu Bionic):
status: New → Invalid
Changed in ruby-ncurses (Ubuntu):
status: In Progress → Invalid
Changed in ruby-ncurses (Ubuntu Bionic):
status: New → In Progress
assignee: nobody → Iain Parris (ipv2)
Changed in ruby-ncurses (Ubuntu):
assignee: Iain Parris (ipv2) → nobody
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

First, you'd not need to bump the version to 1.4.9-1build3ubuntu0.18.04.2, we have not uploaded 1.4.9-1build3ubuntu0.18.04.1 yet. And the SRU bug template is good IMO, good job!

Answering your questions:

* I marked this bug as affecting bionic only, I am not sure if some special permission is needed to change those things.

* In this case you do not need to subscribe anything because I am your sponsor :) But in your future contributions you can subscribe ~ubuntu-sponsors to find someone willing to sponsor your upload.

* Not now. The SRU team will add verification-needed* tag and when we verify the fix we will drop it and add the verification-done* tag.

Thanks for taking the time to read the documentation! If you have more questions feel free to ask.

Now, I am going to upload your package to bionic-unapproved (the same version in the PPA without '~ppa1' in the version). The SRU team need to take action and to add this bug to their queue you need to subscribe ~ubuntu-sru, could you please do that? After that we need to wait for the SRU team.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

FYI uploaded:

$ dput ubuntu ruby-ncurses_1.4.9-1build3ubuntu0.18.04.1_source.changes
Checking signature on .changes
gpg: /home/kanashiro/packaging/ubuntu/ruby-ncurses/ruby-ncurses_1.4.9-1build3ubuntu0.18.04.1_source.changes: Valid signature from F823A2729883C97C
Checking signature on .dsc
gpg: /home/kanashiro/packaging/ubuntu/ruby-ncurses/ruby-ncurses_1.4.9-1build3ubuntu0.18.04.1.dsc: Valid signature from F823A2729883C97C
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading ruby-ncurses_1.4.9-1build3ubuntu0.18.04.1.dsc: done.
  Uploading ruby-ncurses_1.4.9-1build3ubuntu0.18.04.1.debian.tar.xz: done.
  Uploading ruby-ncurses_1.4.9-1build3ubuntu0.18.04.1_source.changes: done.
Successfully uploaded packages.

Revision history for this message
Iain Parris (ipv2) wrote :

Thank you very much again, Lucas!

I really appreciate your taking the time to guide me through this process. And thank you too for being my sponsor. :-)

I've deleted the redundant debdiff (sorry, I misunderstood earlier).

Thank you for marking the bug as Bionic only, and for uploading our package to bionic-unapproved.

I've subscribed the SRU Team (~ubuntu-sru) right now.

Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Jean, or anyone else affected,

Accepted ruby-ncurses into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ruby-ncurses/1.4.9-1build3ubuntu0.18.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ruby-ncurses (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Iain Parris (ipv2)
tags: added: verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Iain Parris (ipv2) wrote :

Thanks Robie!

The package in bionic-proposed fixed the bug for me. Tag changed to "verification-done-bionic".

SRU Verification process followed:
- Started with a fresh Bionic installation, all updates installed from bionic-updates and bionic-security
- Verified that ruby-ncurses package not installed
- Installed ruby-ncurses package (1.4.9-1build3)
- Reproduced bug by observing LoadError crash with: ruby -e 'require "ncurses"'
- Added bionic-proposed repository
- Installed proposed update to ruby-ncurses package (1.4.9-1build3ubuntu0.18.04.1)
- Verified no crash observed anymore, via same command: ruby -e 'require "ncurses"'
- Additionally installed a package that depends on ruby-ncurses (sup-mail), and confirmed that sup-mail now launches without crashing by running: sup-mail

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ruby-ncurses - 1.4.9-1build3ubuntu0.18.04.1

---------------
ruby-ncurses (1.4.9-1build3ubuntu0.18.04.1) bionic; urgency=high

  * Add patch to link against libmenuw (LP: #1775673)

 -- Iain Parris <email address hidden> Fri, 10 Jul 2020 23:12:18 +0100

Changed in ruby-ncurses (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for ruby-ncurses has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.