[SRU] torbrowser-launcher crashed with move(self, int, int) in main(): argument 1 has unexpected type 'float'

Bug #1963286 reported by Adnan
84
This bug affects 14 people
Affects Status Importance Assigned to Milestone
torbrowser-launcher (Ubuntu)
Fix Released
Medium
Thomas Ward
Jammy
Fix Released
Medium
Unassigned
Kinetic
Fix Released
Medium
Thomas Ward

Bug Description

[Impact]

Since Ubuntu Jammy and Python 3.10, there has been a change to how Python does strict type-checking. As a result, Qt requirements and `gui.move` require data to be passed into functions as the expected datatype.

`gui.move` expects two int values, and not Floats. torbrowser-launcher used standard division and expected implicit type casting to happen which worked in prior Python versions. Instead, we now need to do integer division specifically for the values to pass into gui.move.

The patch for this was implied and suggested by people on upstream Git however Git has not accepted this patch in over a month.

Kinetic and Jammy are impacted. Uploads have been made containing the patch to fix this in both Kinetic and Jammy, however while Kinetic is just Accepted, the Jammy package needs SRU'd.

[Test Plan]

Reproduce crash:

 1. Install Kinetic or Jammy with Desktop/GUI
 2. Install torbrowser-launcher.
 3. Attempt to launch the launcher in GUI, it won't load and on command line has an unexpected type failure.

With the fixed packaging:

  Attempting to launch the GUI will Just Work

[Where problems could occur]

In this two line change originally proposed upstream by contributors and tested by multiple upstream users, it was confirmed this introduces no additional issues and only fixes the gui.move TypeError problem.

I do not foresee this causing any problems as this has been used for over a month by people manually patching the Launcher and it just working for them.

[Original Description]

...

ProblemType: Crash
DistroRelease: Ubuntu 22.04
Package: torbrowser-launcher 0.3.3-6ubuntu1
ProcVersionSignature: Ubuntu 5.15.0-18.18-generic 5.15.12
Uname: Linux 5.15.0-18-generic x86_64
ApportVersion: 2.20.11-0ubuntu78
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Thu Mar 3 17:43:33 2022
ExecutablePath: /usr/bin/torbrowser-launcher
InstallationDate: Installed on 2022-03-02 (0 days ago)
InstallationMedia: Ubuntu 18.04.6 LTS "Bionic Beaver" - Release amd64 (20210915)
InterpreterPath: /usr/bin/python3.10
ProcCmdline: /usr/bin/python3 /usr/bin/torbrowser-launcher
Python3Details: /usr/bin/python3.10, Python 3.10.2, python3-minimal, 3.10.1-0ubuntu1
PythonArgs: ['/usr/bin/torbrowser-launcher']
PythonDetails: N/A
SourcePackage: torbrowser-launcher
Title: torbrowser-launcher crashed with move(self, int, int) in main(): argument 1 has unexpected type 'float'
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo

Revision history for this message
Adnan (inter-ad18) wrote :
tags: removed: need-duplicate-check
Changed in torbrowser-launcher (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in torbrowser-launcher (Ubuntu):
status: New → Confirmed
tags: added: kinetic
Thomas Ward (teward)
Changed in torbrowser-launcher (Ubuntu Jammy):
status: New → Confirmed
importance: Undecided → Medium
Changed in torbrowser-launcher (Ubuntu Kinetic):
assignee: nobody → Thomas Ward (teward)
Changed in torbrowser-launcher (Ubuntu Jammy):
assignee: nobody → Thomas Ward (teward)
Thomas Ward (teward)
Changed in torbrowser-launcher (Ubuntu Kinetic):
status: Confirmed → In Progress
information type: Private → Public
Revision history for this message
Thomas Ward (teward) wrote :

Uploaded a patched package for this to Kinetic.

SRU for Jammy will be done shortly, and this bug will be the SRU.

description: updated
summary: - torbrowser-launcher crashed with move(self, int, int) in main():
+ [SRU] torbrowser-launcher crashed with move(self, int, int) in main():
argument 1 has unexpected type 'float'
Thomas Ward (teward)
description: updated
Changed in torbrowser-launcher (Ubuntu Jammy):
assignee: Thomas Ward (teward) → nobody
Changed in torbrowser-launcher (Ubuntu Kinetic):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package torbrowser-launcher - 0.3.3-6ubuntu1.22.10.1

---------------
torbrowser-launcher (0.3.3-6ubuntu1.22.10.1) kinetic; urgency=medium

  * d/p/u18-python-float-strict-check-fix.patch: Apply integer division fix
    proposed upstream to fix the strict type checking problem that Python 3.10
    introduced that prevents the Tor Browser GUI from functioning properly.
    (LP: #1963286)

 -- Thomas Ward <email address hidden> Mon, 29 Aug 2022 16:40:42 -0400

Changed in torbrowser-launcher (Ubuntu Kinetic):
status: Fix Committed → Fix Released
Revision history for this message
Robie Basak (racb) wrote :

20:21 <teward> anyone on the SRU team around to drop something into -proposed and review the SRU (first phase)? Trying to fix torbrowser-launcher in Universe since it's been broken since Jammy thanks to Python 3.10 Strict Type Checking in commands.
20:30 <rbasak> teward: isn't Browser window width/height really important for Tor users to remain anonymous?
20:30 <teward> rbasak: yes, but the problem here is that the system pre python3.10 was working on implicit type casting
20:31 <teward> i.e. if argument type is int, and given a float, it'll typecast it automatically.
20:31 <teward> rbasak: the change here is just to use integer division prior to passing it in (the system already divides height/width by 2 or such) so it's an int being passed in instead of a float
20:31 <teward> otherwise it's identical behavior where it'd be a lossy cast from float -> int
20:32 <teward> you're right it's important for the anonymity but the launcher itself can't execute with the strict type checking in place
20:32 <teward> so this was the (simplest) workaround that would work with the upstream code.
20:32 <teward> and it looksl ike upstream doens't care but packagers should.
20:34 <teward> my understanding of the code here is that it does basically the same thing - lossy conversion from a float to an int, retaining the same division/numbers in the launcher's init.
20:34 <teward> but doing so by explicitly doing integer division to return an integer object to pass into gui.move() instead of a float
20:34 <teward> in order to get around the strict type checking

Changed in torbrowser-launcher (Ubuntu Jammy):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Adnan, or anyone else affected,

Accepted torbrowser-launcher into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/torbrowser-launcher/0.3.3-6ubuntu1.22.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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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.

Revision history for this message
lazytownfan (lazytownfan) wrote :

I believe this package fixes the bug for me.

I am using package version 0.3.3-6ubuntu1.22.04.1.

The testing I did was launching Tor Browser and determining if it would launch properly. Since the application launched successfully with a subsequent DuckDuckGo web search, I consider the testing complete.

tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package torbrowser-launcher - 0.3.3-6ubuntu1.22.04.1

---------------
torbrowser-launcher (0.3.3-6ubuntu1.22.04.1) jammy; urgency=medium

  * d/p/u18-python-float-strict-check-fix.patch: Apply integer division fix
    proposed upstream to fix the strict type checking problem that Python 3.10
    introduced that prevents the Tor Browser GUI from functioning properly.
    (LP: #1963286)

 -- Thomas Ward <email address hidden> Mon, 29 Aug 2022 16:40:42 -0400

Changed in torbrowser-launcher (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for torbrowser-launcher 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.

Other bug subscribers

Remote bug watches

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