Hard dependency on libstdc++ 6.1.0 at runtime on ppc64el on xenial

Bug #1819013 reported by Jo Shields
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
firefox (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

$ firefox
XPCOMGlueLoad error for file /usr/lib/firefox/libxul.so:
/usr/lib/powerpc64le-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /usr/lib/firefox/libxul.so)
Couldn't load XPCOM.
$ ldd /usr/lib/firefox/libxul.so | head -1
/usr/lib/firefox/libxul.so: /usr/lib/powerpc64le-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /usr/lib/firefox/libxul.so)

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: firefox 65.0.1+build2-0ubuntu0.16.04.1
ProcVersionSignature: Ubuntu 4.15.0-29.31~16.04.1-generic 4.15.18
Uname: Linux 4.15.0-29-generic ppc64le
AddonCompatCheckDisabled: False
AlsaDevices:
 total 0
 crw-rw---- 1 root audio 116, 1 Mar 7 10:00 seq
 crw-rw---- 1 root audio 116, 33 Mar 7 10:00 timer
AplayDevices: Error: [Errno 2] No such file or directory: 'aplay'
ApportVersion: 2.20.1-0ubuntu2.18
Architecture: ppc64el
ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord'
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
BuildID: 20190215002040
Channel: Unavailable
Date: Thu Mar 7 10:02:49 2019
ForcedLayersAccel: False
InstallationDate: Installed on 2018-01-11 (419 days ago)
InstallationMedia: Ubuntu-Server 16.04.3 LTS "Xenial Xerus" - Release ppc64el (20170801)
IpRoute:
 default via 10.128.60.1 dev enP2p1s0f0
 10.128.60.0/25 dev enP2p1s0f0 proto kernel scope link src 10.128.60.99
NoProfiles: True
PciMultimedia:

ProcLoadAvg: 2.46 2.48 2.23 3/1329 109239
ProcSwaps:
 Filename Type Size Used Priority
 /dev/sda3 partition 37941184 1110016 -2
ProcVersion: Linux version 4.15.0-29-generic (buildd@bos02-ppc64el-002) (gcc version 5.4.0 20160609 (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.10)) #31~16.04.1-Ubuntu SMP Wed Jul 18 08:50:43 UTC 2018
RunningIncompatibleAddons: False
SourcePackage: firefox
UpgradeStatus: No upgrade log present (probably fresh install)
cpu_cores: Number of cores present = 16
cpu_coreson: Number of cores online = 16
cpu_smt: SMT=8

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

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

Changed in firefox (Ubuntu):
status: New → Confirmed
Revision history for this message
Ftarkin (francois-sabot) wrote :

I have the same issue

fxxxx@xxx:~$ firefox
XPCOMGlueLoad error for file /usr/lib/firefox/libxul.so:
/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /usr/lib/firefox/libxul.so)
Couldn't load XPCOM.

Firefox is the last version from Ubuntu 16.O4, firefox 65.0.1+build2-0ubuntu0.16.04.1

Revision history for this message
Ftarkin (francois-sabot) wrote :

BTW, teh bug is in X84_64 for me

$ strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_DEBUG_MESSAGE_LENGTH

Revision history for this message
Pat Clash (patclash) wrote :

Same issue too :

firefox -p
XPCOMGlueLoad error for file /usr/lib/firefox/libxul.so:
/usr/lib/i386-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /usr/lib/firefox/libxul.so)
Couldn't load XPCOM.

Revision history for this message
Pat Clash (patclash) wrote :

This hapend after today xenial update (32bits)

Revision history for this message
Pat Clash (patclash) wrote :

I install 66.0 rc3 version from the beta channel of Mozilla in the opt folder and it run without issue

Revision history for this message
Olivier Tilloy (osomon) wrote :

I don't have the hardware to test on ppc64el. Can anyone else with such hardware confirm?

The other commenters on the bug (Ftarkin and Pat Clash) mention x86-64 and i386, which I cannot confirm, testing on those architectures works here. Could it be that you installed updates from the ubuntu-mozilla-security PPA, by any chance? There was a faulty early build of 66.0+build3 in there, which I fixed last night, so if this is the case updating again should resolve the issue. I'd appreciate if you could confirm/refute.

Revision history for this message
Pat Clash (patclash) wrote :

Yes , I update firefox from ubuntu-mozilla-security PPA (firefox (66.0+build3-0ubuntu0.16.04.1) xenial);

I just see that there is an other build, so I will try to update this evening when I go home

Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks for the confirmation Pat.
Please note the description of the PPA:

 « Staging PPA for Mozilla and other browser-related security updates. Unless you are testing updates, you should not install packages from this PPA »

So in general it is not recommended to use that PPA, you should wait to get the updates through the -security channel.

Revision history for this message
Jo Shields (directhex) wrote :

I'm not certain about the fine detail, but looking at the relevant build logs:

https://launchpadlibrarian.net/411366522/buildlog_ubuntu-xenial-ppc64el.firefox_65.0.1+build2-0ubuntu0.16.04.1_BUILDING.txt.gz
https://launchpadlibrarian.net/411366844/buildlog_ubuntu-xenial-amd64.firefox_65.0.1+build2-0ubuntu0.16.04.1_BUILDING.txt.gz

There's definitely something different about how they're building build/unix/stdc++compat/stdc++compat.cpp, the library which is supposed to handle hiding the libstdc++ ABI issues.

Revision history for this message
Jo Shields (directhex) wrote :

builder@xam-power8-1:~$ uname -m
ppc64le
builder@xam-power8-1:~$ objdump -T /usr/lib/firefox/libxul.so | grep GLIBCXX_3.4.22
0000000000000000 DF *UND* 0000000000000000 GLIBCXX_3.4.22 _ZNSt6thread15_M_start_threadESt10unique_ptrINS_6_StateESt14default_deleteIS1_EEPFvvE
0000000000000000 DF *UND* 0000000000000000 GLIBCXX_3.4.22 _ZNSt6thread6_StateD2Ev

vs

root@breakfast:/# uname -m
x86_64
root@breakfast:/# objdump -T /usr/lib/firefox/libxul.so | grep GLIBCXX_3.4.22

The mangling of std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) and std::thread::_State::~_State() is supposed to be handled by the block in build/unix/stdc++compat/stdc++compat.cpp starting at line 104:

#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 21)
/* Expose the definitions for the old ABI, allowing us to call its functions */
# define _GLIBCXX_THREAD_ABI_COMPAT 1
# include <thread>

namespace std {
/* The old ABI has a thread::_M_start_thread(shared_ptr<_Impl_base>),
 * while the new has thread::_M_start_thread(unique_ptr<_State>, void(*)()).
 * There is an intermediate ABI at version 3.4.21, with
 * thread::_M_start_thread(shared_ptr<_Impl_base>, void(*)()).
 * The void(*)() parameter is only there to keep a reference to pthread_create
 * on the caller side, and is unused in the implementation
 * We're creating an entry point for the new and intermediate ABIs, and make
 * them call the old ABI. */

__attribute__((weak)) void thread::_M_start_thread(shared_ptr<_Impl_base> impl,
                                                   void (*)()) {
  _M_start_thread(std::move(impl));
}

# if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 22)
/* We need a _Impl_base-derived class wrapping a _State to call the old ABI
 * from what we got by diverting the new API */
struct StateWrapper : public thread::_Impl_base {
  unique_ptr<thread::_State> mState;

  StateWrapper(unique_ptr<thread::_State> aState) : mState(std::move(aState)) {}

  void _M_run() override { mState->_M_run(); }
};

__attribute__((weak)) void thread::_M_start_thread(unique_ptr<_State> aState,
                                                   void (*)()) {
  auto impl = std::make_shared<StateWrapper>(std::move(aState));
  _M_start_thread(std::move(impl));
}

/* For some reason this is a symbol exported by new versions of libstdc++,
 * even though the destructor is default there too */
__attribute__((weak)) thread::_State::~_State() = default;
# endif
} // namespace std
#endif

I don't know what's broken in the build process causing this code not to be included in ppc64el builds.

Revision history for this message
Pat Clash (patclash) wrote :

Issue fixed by the latest PPA : firefox (66.0+build3-0ubuntu0.16.04.2) xenial

Yes I use PPA because I would have the latest version from Mozilla (Firefox and Thunderbird)

I test also the beta channel directly from Mozilla

;)

Revision history for this message
Jo Shields (directhex) wrote :

@patclash I don't see any fix in the PPA package?

builder@xam-power8-1:/tmp$ dpkg -x firefox_66.0+build3-0ubuntu0.16.04.2_ppc64el.deb test/
builder@xam-power8-1:/tmp$ objdump -T /tmp/test/usr/lib/firefox/libxul.so | grep GLIBCXX_3.4.22
0000000000000000 DF *UND* 0000000000000000 GLIBCXX_3.4.22 _ZNSt6thread15_M_start_threadESt10unique_ptrINS_6_StateESt14default_deleteIS1_EEPFvvE
0000000000000000 DF *UND* 0000000000000000 GLIBCXX_3.4.22 _ZNSt6thread6_StateD2Ev

The lack of stdc++compat handling on ppc64el seems untouched.

Revision history for this message
Pat Clash (patclash) wrote :

@Jo Shields I don't knowwhat was wrong;

After the Friday update my Firefox don't start ;
I try to start it from Terminal and I got the error message that I googled with a link for this bug

I am only a (advanced) user , not a developer (I don't know how to debug for example)

With the today PPA update , Firefox start as normal and run perfectly ;)

Revision history for this message
Olivier Tilloy (osomon) wrote :

This report is about a problem on ppc64el.

Pat commented on a similar problem on amd64 in a PPA not meant for general use, which was later fixed (see comment #8). The original problem remains. Let's not mix the two, it makes tracking and understanding them harder.

Revision history for this message
Olivier Tilloy (osomon) wrote :

This doesn't appear to be a recent regression, at least. Builds for ppc64el as far back as 63.0.3+build1-0ubuntu0.16.04.1 are affected. 60.0.2+build1-0ubuntu0.16.04.1 isn't.

Revision history for this message
bat21sl (bat21sl) wrote :

I was also affected in 16.04 ppc64el and I fixed downloading IBM adv toolchain for Ubuntu from here
 https://developer.ibm.com/linuxonpower/advance-toolchain/.
Only rte is necessary and I also modify PATH to prepend /opt/at12.0/bin following the ibm istro.
If you want to avoid this hidden dependency you have to uninstall toolchain and rebuild the package.
AT replaces on the fly libstdc++ with a newer one with 3.4.22 in fact:

strings /opt/at12.0/lib64/libstdc++.so.6|grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_LDBL_3.4
GLIBCXX_LDBL_3.4.7
GLIBCXX_LDBL_3.4.10
GLIBCXX_LDBL_3.4.21
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH

Revision history for this message
bat21sl (bat21sl) wrote :

Please ignore it is wrong.

Revision history for this message
bat21sl (bat21sl) wrote :

I'm back with a workaround (i know, it is not elegant)

I copied the libstdc++ library from IBM toolchain (see my first post to find the url) to /usr/lib/powerpc64le-linux-gnu and made the symlink.

Now I have in /usr/lib/powerpc64le-linux-gnu :
libstdc++.so.6.0.25
and
libstdc++.so.6 -> libstdc++.so.6.0.25 (The symlink)

Firefox 66.0.2+build1-0ubuntu0.16.04.1 (update version) works fine.

lsb_releas -a
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
uname -a

Linux testubu16 4.4.0-143-generic #169-Ubuntu SMP Thu Feb 7 07:56:40 UTC 2019 ppc64le ppc64le ppc64le GNU/Linux

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.