Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 686760

Summary: mail-client/thunderbird-60.6.1 fails at start of install phase
Product: Gentoo Linux Reporter: Daniel Santos <daniel.santos>
Component: Current packagesAssignee: Mozilla Gentoo Team <mozilla>
Status: RESOLVED DUPLICATE    
Severity: normal CC: adpc, jstein
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: xz'd build log
emerge --info

Description Daniel Santos 2019-05-25 21:11:20 UTC
Please go ahead and mark #686644 a dupe of this.

It's a strange bug as their elfhack fails when run as root but not when run as a normal user.  gdb is crashing on a class template, so not having luck finding the root cause.

>>> Test phase [not enabled]: mail-client/thunderbird-60.6.1

>>> Install thunderbird-60.6.1 into /tmp/portage/mail-client/thunderbird-60.6.1/image/ category mail-client
 * PT_PAX marking -m /tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/tbird/dist/bin/xpcshell with scanelf
 * XATTR_PAX marking -me /tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/tbird/dist/bin/xpcshell with setfattr
 0:02.78 /usr/bin/gmake -C . -j16 -s -w install
 0:02.82 gmake: Entering directory '/tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/tbird'
 0:02.95 gmake[1]: Entering directory '/tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/tbird/comm/mail/installer'
 1:35.20 terminate called after throwing an instance of 'std::__ios_failure'
 1:35.21   what():  basic_ios::clear: iostream error
 1:36.97 Traceback (most recent call last):
 1:36.97   File "/tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/toolkit/mozapps/installer/packager.py", line 343, in <module>
 1:36.97     main()
 1:36.97   File "/tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/toolkit/mozapps/installer/packager.py", line 337, in main
 1:36.97     copier.copy(args.destination)
 1:36.97   File "/tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/python/mozbuild/mozpack/copier.py", line 431, in copy
 1:36.97     copy_results.append((destfile, f.copy(destfile, skip_if_older)))
 1:36.97   File "/tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/python/mozbuild/mozpack/files.py", line 296, in copy
 1:36.97     elfhack(dest)
 1:36.98   File "/tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/python/mozbuild/mozpack/executables.py", line 124, in elfhack
 1:36.98     errors.fatal('Error executing ' + ' '.join(cmd))
 1:36.98   File "/tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/python/mozbuild/mozpack/errors.py", line 103, in fatal
 1:36.98     self._handle(self.FATAL, msg)
 1:36.98   File "/tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/python/mozbuild/mozpack/errors.py", line 98, in _handle
 1:36.98     raise ErrorMessage(msg)
 1:36.98 mozpack.errors.ErrorMessage: Error: Error executing /tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/tbird/build/unix/elfhack/elfhack ../../../dist/thunderbird/libxul.so
 1:37.14 gmake[1]: *** [/tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/toolkit/mozapps/installer/packager.mk:22: stage-package] Error 1
 1:37.15 gmake[1]: Leaving directory '/tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/tbird/comm/mail/installer'
 1:37.15 gmake: *** [/tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/comm/mail/build.mk:16: install] Error 2
 1:37.15 gmake: Leaving directory '/tmp/portage/mail-client/thunderbird-60.6.1/work/thunderbird-60.6.1/tbird'
 * ERROR: mail-client/thunderbird-60.6.1::gentoo failed (install phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line 124:  Called src_install
 *   environment, line 5138:  Called die
 * The specific snippet of code:
 *       MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 DESTDIR="${D}" ./mach install || die;
 *
Comment 1 Daniel Santos 2019-05-25 21:15:36 UTC
Jonas Stein:  Can't attach 1452KiB gzipped log file:

Request Timeout

Server timeout waiting for the HTTP request from the client.
Apache Server at bugs.gentoo.org Port 443
Comment 2 Daniel Santos 2019-05-25 21:19:40 UTC
Created attachment 577800 [details]
xz'd build log

Attempting xz -9e of log file...
Comment 3 Daniel Santos 2019-05-25 21:24:51 UTC
Created attachment 577802 [details]
emerge --info

This is my emerge --info mail-client/thunderbird after I hacked the install to complete.  Of note, libxul.so was 2.1GiB which is causing me to suspect some 32-bit signed file size issue -- but again it doesn't happen when I run elfhack as a normal user.  HOWEVER, when I did so, I found no difference between the resulting file and a copy of the original file, so it could have just failed silently.  I'm not actually certain what their hackelf is supposed to be for.
Comment 4 Daniel Santos 2019-05-25 22:20:39 UTC
I've filed an upstream report: https://bugzilla.mozilla.org/show_bug.cgi?id=1554428

This is almost certainly due to using 32 bit values for offsets, even though it initially appears to be unsigned int, it's probably treated as signed elsewhere and ELF64 uses 64-bit offsets.

build/unix/elfhack/elfxx.h:284:
  ElfSection *getSectionAt(unsigned int offset);

The work-around is almost certainly to build without -g*.
Comment 5 ad PC 2019-05-26 12:44:54 UTC
I can confirm this bug. The option "-g" seems to cause this bug.
Comment 6 Jonas Stein gentoo-dev 2019-05-26 14:16:12 UTC
*** Bug 686644 has been marked as a duplicate of this bug. ***
Comment 7 Daniel Santos 2019-05-26 22:21:09 UTC
(In reply to ad PC from comment #5)
> I can confirm this bug. The option "-g" seems to cause this bug.

Thank you ad PC!  So I propose we configure with --disable-elf-hack if -g* is in CFLAGS or CXXFLAGS.
Comment 8 Jory A. Pratt gentoo-dev 2019-05-26 22:34:58 UTC
(In reply to Daniel Santos from comment #7)
> (In reply to ad PC from comment #5)
> > I can confirm this bug. The option "-g" seems to cause this bug.
> 
> Thank you ad PC!  So I propose we configure with --disable-elf-hack if -g*
> is in CFLAGS or CXXFLAGS.

what is to propose really, I have addressed the issue already.
Comment 9 Daniel Santos 2019-05-26 22:43:11 UTC
(In reply to Jory A. Pratt from comment #8)
> (In reply to Daniel Santos from comment #7)
> > (In reply to ad PC from comment #5)
> > > I can confirm this bug. The option "-g" seems to cause this bug.
> > 
> > Thank you ad PC!  So I propose we configure with --disable-elf-hack if -g*
> > is in CFLAGS or CXXFLAGS.
> 
> what is to propose really, I have addressed the issue already.

A comment in a bug report is not a fix.  It needs a patch to the ebuild that prevents the problem from occurring.  Also, upstream needs to fix their elfhack code to use appropriate data types.  They're already in C++, there's no reason to not detect if their 32 or 64 bit and use the correct templatized types, or just typedef them and build support for both elf32 and elf64.
Comment 10 Jory A. Pratt gentoo-dev 2019-05-26 23:14:40 UTC

*** This bug has been marked as a duplicate of bug 681438 ***
Comment 11 ad PC 2019-05-31 07:46:05 UTC
@Jory: The proposed patch does not work for me. I have only "-g" in CFLAGS and CXXFLAGS and not "-ggdb3".