ipc.py generated negativ hashes when DISPLAY is four or more digits

Bug #1851509 reported by Pantelis Birokas on 2019-11-06
This bug affects 3 people
Affects Status Importance Assigned to Milestone

Bug Description

Hi *,

I notice that sometimes I am not able to start terminator. I receive an error like this:

$ terminator
Traceback (most recent call last):
  File "/usr/bin/terminator", line 83, in <module>
    from terminatorlib import ipc
  File "/usr/share/terminator/terminatorlib/ipc.py", line 31, in <module>
    class DBusService(Borg, dbus.service.Object):
  File "/usr/share/terminator/terminatorlib/ipc.py", line 62, in DBusService
    @dbus.service.method(BUS_NAME, in_signature='a{ss}')
  File "/usr/lib/python2.7/dist-packages/dbus/decorators.py", line 155, in method
ValueError: Invalid interface or error name 'net.tenshu.Terminator2-0x7d8b25b989078ac2': contains invalid character '-'

The variable BUS_NAME comes from ipc.py line 26 and 27:
DISPLAY = hex(hash(Gdk.get_display().partition('.')[0]))

The problems occurs when the DISPAY is higher that 999.

$ python2
Python 2.7.15+ (default, Oct 7 2019, 17:39:04)
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import Gdk
>>> Gdk.get_display()
>>> hex(hash(Gdk.get_display().partition('.')[0]))
>>> hex(hash(':999'))
>>> hex(hash(':1000'))

This happend sometimes when connection via NX or Citrix to an Ubuntu system. Than I am getting a DISPLAY number 1000+.

System information
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic

$ uname -r

$ terminator -v
terminator 1.91

Using XFCE desktop flavour

Not using any config file for Terminator

Also tried to download an run terminator from lp:terminator, got the same result.

Pantelis Birokas (pbirokas) wrote :
Egmont Koblinger (egmont-gmail) wrote :

Could you please test hellodeargrandma's python3 branch from bug #1662544? That one uses a different hashing method.

Pantelis Birokas (pbirokas) wrote :

I tested it with the python3 branch and the hashes calculated looks better.
Was not able to create negativ hashes anymore.

Thanks for the link, I will try to create an patch and provide it to our clients.

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

Other bug subscribers