Bug#960230: thunderbird: Thunderbird doesn't run if DEBUG variable is exported

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#960230: thunderbird: Thunderbird doesn't run if DEBUG variable is exported

Carles Pina i Estany-2
Package: thunderbird
Version: 1:68.8.0-1~deb10u1
Severity: important
Tags: patch

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
     In a system we had "export DEBUG=1" (not related to Thunderbird,
     for other reasons)

   * What exactly did you do (or not do) that was effective (or
     ineffective)?
     After investigating reading /usr/bin/thunderbird :
     "unset DEBUG" fixed the problem

   * What was the outcome of this action?
     Exporting DEBUG=1 makes "thunderbird" launcher to not launch
     Thunderbird (and to not say anything)

   * What outcome did you expect instead?
     Thunderbird to work, and if it doesn't work should indicate why
     not.

   * Possible solutions:
   -In the beginning of /usr/bin/thunderbird: perhaps do "unset DEBUG DEBUGGER" (and other variables?)

   -Perhaps rename all the variables into THUNDERBIRD_DEBUGGER,
   THUNDERBIRD_DEBUG, THUNDERBIRD_SHOW_BACKUP, etc. to avoid "generic
   names" to conflict?

   -At the end of the file if ${DEBUG} == 1 but ${DEBUGGER} == "": it
   exits the launcher without launching and without saying anything: say
   something? (it would have solved the problem but it would have been
   easier to fix it)

   -Assume that this was a user problem and we should not have had
   DEBUG=1 set everywhere :-)


-- System Information:
Debian Release: 10.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-8-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=ca_ES.UTF-8, LC_CTYPE=ca_ES.UTF-8 (charmap=UTF-8), LANGUAGE=ca_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages thunderbird depends on:
ii  debianutils               4.8.6.1
ii  fontconfig                2.13.1-2
ii  libatk1.0-0               2.30.0-2
ii  libc6                     2.28-10
ii  libcairo-gobject2         1.16.0-4
ii  libcairo2                 1.16.0-4
ii  libdbus-1-3               1.12.16-1
ii  libdbus-glib-1-2          0.110-4
ii  libevent-2.1-6            2.1.8-stable-4
ii  libffi6                   3.2.1-9
ii  libfontconfig1            2.13.1-2
ii  libfreetype6              2.9.1-3+deb10u1
ii  libgcc1                   1:8.3.0-6
ii  libgdk-pixbuf2.0-0        2.38.1+dfsg-1
ii  libglib2.0-0              2.58.3-2+deb10u2
ii  libgtk-3-0                3.24.5-1
ii  libgtk2.0-0               2.24.32-3
ii  libjsoncpp1               1.7.4-3
ii  libpango-1.0-0            1.42.4-7~deb10u1
ii  libstartup-notification0  0.12-6
ii  libstdc++6                8.3.0-6
ii  libvpx5                   1.7.0-3+deb10u1
ii  libx11-6                  2:1.6.7-1
ii  libx11-xcb1               2:1.6.7-1
ii  libxcb-shm0               1.13.1-2
ii  libxcb1                   1.13.1-2
ii  libxext6                  2:1.3.3-1+b2
ii  libxrender1               1:0.9.10-1
ii  libxt6                    1:1.1.5-1+b3
ii  psmisc                    23.2-1
ii  x11-utils                 7.7+4
ii  zlib1g                    1:1.2.11.dfsg-1

Versions of packages thunderbird recommends:
ii  hunspell-ca [hunspell-dictionary]     3.0.3+repack1-1
ii  hunspell-en-gb [hunspell-dictionary]  1:6.2.0-1
ii  hunspell-en-us [hunspell-dictionary]  1:2018.04.16-1
ii  hunspell-es [hunspell-dictionary]     1:6.2.0-1
ii  lightning                             1:68.8.0-1~deb10u1

Versions of packages thunderbird suggests:
ii  apparmor          2.13.2-10
ii  fonts-lyx         2.3.2-1
ii  libgssapi-krb5-2  1.17-3

-- no debconf information

Reply | Threaded
Open this post in threaded view
|

Bug#960230: thunderbird: Thunderbird doesn't run if DEBUG variable is exported

Carsten Schoenert
Hello Carlos,

Am 10.05.20 um 22:23 schrieb Carles Pina i Estany:
...

>     * Possible solutions:
>     -In the beginning of /usr/bin/thunderbird: perhaps do "unset DEBUG DEBUGGER" (and other variables?)
>
>     -Perhaps rename all the variables into THUNDERBIRD_DEBUGGER,
>     THUNDERBIRD_DEBUG, THUNDERBIRD_SHOW_BACKUP, etc. to avoid "generic
>     names" to conflict?
>
>     -At the end of the file if ${DEBUG} == 1 but ${DEBUGGER} == "": it
>     exits the launcher without launching and without saying anything: say
>     something? (it would have solved the problem but it would have been
>     easier to fix it)

good catch!
The wrapper script was written a bit in a hurry and as seen by your
report we haven't considered all the possible cases in the past.

To generic variable names are always problematic at some point, so your
suggestion to prefix all the DEBUG name is a thing that need to happen.
Would you be willing came up with a patch? If not I will try to work on
this later within the preparation for next ESR cycle in Debian.


--
Regards
Carsten

Reply | Threaded
Open this post in threaded view
|

Bug#960230: thunderbird: Thunderbird doesn't run if DEBUG variable is exported

Carles Pina i Estany-2

Hi Carsten,

On May/11/2020, Carsten Schoenert wrote:

> Hello Carlos,
>
> Am 10.05.20 um 22:23 schrieb Carles Pina i Estany:
> ...
> >     * Possible solutions:
> >     -In the beginning of /usr/bin/thunderbird: perhaps do "unset DEBUG DEBUGGER" (and other variables?)
> >
> >     -Perhaps rename all the variables into THUNDERBIRD_DEBUGGER,
> >     THUNDERBIRD_DEBUG, THUNDERBIRD_SHOW_BACKUP, etc. to avoid "generic
> >     names" to conflict?
> >
> >     -At the end of the file if ${DEBUG} == 1 but ${DEBUGGER} == "": it
> >     exits the launcher without launching and without saying anything: say
> >     something? (it would have solved the problem but it would have been
> >     easier to fix it)
>
> good catch!
> The wrapper script was written a bit in a hurry and as seen by your report
> we haven't considered all the possible cases in the past.
>
> To generic variable names are always problematic at some point, so your
> suggestion to prefix all the DEBUG name is a thing that need to happen.
> Would you be willing came up with a patch? If not I will try to work on this
> later within the preparation for next ESR cycle in Debian.

I'm happy to provide a patch (probably today later or tomorrow evening).
I didn't in case that someone else was working on it / something else.

Cheers,

--
Carles Pina i Estany

Reply | Threaded
Open this post in threaded view
|

Bug#960230: thunderbird: Thunderbird doesn't run if DEBUG variable is exported

Carles Pina i Estany-2

Hi Carsten,

On May/11/2020, Carles Pina i Estany wrote:

> > To generic variable names are always problematic at some point, so your
> > suggestion to prefix all the DEBUG name is a thing that need to happen.
> > Would you be willing came up with a patch? If not I will try to work on this
> > later within the preparation for next ESR cycle in Debian.
>
> I'm happy to provide a patch (probably today later or tomorrow evening).
> I didn't in case that someone else was working on it / something else.

I created a salsa.debian.org account and:

a) I was looking at the code and realised that some variables were
initialized to 0 probably for the same reason that the bug was found.
Initially I've done an unset, consistent with existing code: https://salsa.debian.org/carlespina/thunderbird/-/commit/eb0d71b9cdb386cd94dea9bd8acabd2374f13a97 . If you prefer me prefixing that in TB_ or THUNDERBIRD_ let me know.

b) I got a bit carried away:
https://salsa.debian.org/carlespina/thunderbird/-/commits/thunderbird-launcher-variables/
with some small refactoring that you might or might not agree / minor
fixes or deleting code for commented out fixes.

I'm happy to change the name of the variables, but well, it was interesting.

Cheers,

--
Carles Pina i Estany

Reply | Threaded
Open this post in threaded view
|

Bug#960230: Info received (Bug#960230: thunderbird: Thunderbird doesn't run if DEBUG variable is exported)

Carles Pina i Estany-2
In reply to this post by Carles Pina i Estany-2

Hi,

I've just seen that I in Salsa I forked it out from
https://salsa.debian.org/nitsch-guest/thunderbird instead of
https://salsa.debian.org/mozilla-team/thunderbird . I think that the two
files that I changed are the same, but tonight I could fork from the
mozilla-team/thunderbird (or prefix the variables/something else if it
was preferred).

Thank you,

--
Carles Pina i Estany

Reply | Threaded
Open this post in threaded view
|

Bug#960230: Info received (Bug#960230: thunderbird: Thunderbird doesn't run if DEBUG variable is exported)

Carsten Schoenert
Hello Carles,

Am 12.05.20 um 14:39 schrieb Carles Pina i Estany:
>
> Hi,
>
> I've just seen that I in Salsa I forked it out from
> https://salsa.debian.org/nitsch-guest/thunderbird instead of
> https://salsa.debian.org/mozilla-team/thunderbird . I think that the two
> files that I changed are the same, but tonight I could fork from the
> mozilla-team/thunderbird (or prefix the variables/something else if it
> was preferred).

just add a new remote source pointing to the "real" thunderbird tree on
salsa and rebase against the trees from there.

Otherwise you can create a new branch based on the correct sources and
cherry pick your commits from your old branch.

 From a quick view ...
The removal of the DEBUGGER stuff isn't something I'd do. The reason
behind that is simple, there is vagrant out there that is doing a better
job in showing the runtime state if you need to debug something. But we
never did added that to the wrapper script, it's not an easy task. So in
my eyes the removal of the these parts isn't desirable. For sure some
more comments will help further looking people.

--
Regards
Carsten

Reply | Threaded
Open this post in threaded view
|

Bug#960230: Info received (Bug#960230: thunderbird: Thunderbird doesn't run if DEBUG variable is exported)

Carles Pina i Estany-2

Hello Carsten,

On May/12/2020, Carsten Schoenert wrote:

> Hello Carles,
>
> Am 12.05.20 um 14:39 schrieb Carles Pina i Estany:
> >
> > Hi,
> >
> > I've just seen that I in Salsa I forked it out from
> > https://salsa.debian.org/nitsch-guest/thunderbird instead of
> > https://salsa.debian.org/mozilla-team/thunderbird . I think that the two
> > files that I changed are the same, but tonight I could fork from the
> > mozilla-team/thunderbird (or prefix the variables/something else if it
> > was preferred).
>
> just add a new remote source pointing to the "real" thunderbird tree on
> salsa and rebase against the trees from there.

I ended up doing a new fork (long story off-topic here :-) )
My previous code is in the same URL: https://salsa.debian.org/carlespina/thunderbird/-/tree/thunderbird-launcher-variables
The smallest patch would be here: https://salsa.debian.org/carlespina/thunderbird/-/tree/unsets-DEBUG-DEBUGGER (unless we went for renaming DEBUG/DEBUGGER to TB_DEBUG/TB_DEBUGGER).

> From a quick view ...
> The removal of the DEBUGGER stuff isn't something I'd do. The reason behind
> that is simple, there is vagrant out there that is doing a better job in
> showing the runtime state if you need to debug something. But we never did
> added that to the wrapper script, it's not an easy task. So in my eyes the
> removal of the these parts isn't desirable. For sure some more comments will
> help further looking people.

I haven't used vagrant and I don't know how the DEBUGGER variable would
be used in vagrant to show the runtime state. Either way, I understand
that for ESR it would be good to minimise changes, but me, as a casual
reader of the script it seems that DEBUGGER can be 1 only if DEBUG is
1 (by the option -g) making it not-useful...as it is now, of course!
(and making the last set of ifs harder to follow). I just got a bit
carried away yesterday.

I might have missed some code path and obviously future intentions :-)

I'm not sure what's the best way to fix the reported bug and/or if the
smallest patch is the way to go.

I'm happy to make other changes in the branch - my pleasure!

Cheers,

--
Carles Pina i Estany