libstdc++.so link in amd64 ia32-libs is wrong

Bug #360870 reported by Mark Mentovai
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ia32-libs (Ubuntu)
Fix Released
Medium
Fabien Tassin
Jaunty
Fix Released
Medium
Fabien Tassin

Bug Description

Binary package hint: ia32-libs

This bug is present in Ubuntu 9.04 ("Jaunty Jackalope") on amd64 in ia32-libs 2.7ubuntu4 or lib32stdc++6 4.3.3-5ubuntu4.

ia32-libs contains a libstdc++.so symbolic link for 32-bit C++ development. The symbolic link points to libstdc++.so.5. A 32-bit libstdc++.so.6 is installed as well, by virtue of ia32-libs' dependency on lib32stdc++6.

mark@ebony bash$ ls -l /usr/lib32/libstdc++.so*
lrwxrwxrwx 1 root root 14 2009-04-12 20:36 /usr/lib32/libstdc++.so -> libstdc++.so.5
lrwxrwxrwx 1 root root 18 2009-04-12 20:36 /usr/lib32/libstdc++.so.5 -> libstdc++.so.5.0.7
-rw-r--r-- 1 root root 737192 2008-05-10 02:18 /usr/lib32/libstdc++.so.5.0.7
lrwxrwxrwx 1 root root 19 2009-04-12 20:36 /usr/lib32/libstdc++.so.6 -> libstdc++.so.6.0.10
-rw-r--r-- 1 root root 950424 2009-03-16 21:03 /usr/lib32/libstdc++.so.6.0.10

However, the installed C++ headers are from libstdc++6. libstdc++6-4.3-dev is installed. These headers expect to be linked against libstdc++6, and are incompatible with libstdc++5.

Simple C++ compilations fail. For example, although it is possible to build the attached test.cc in 64-bit mode, a 32-bit compilation fails:

mark@ebony bash$ g++ -m32 test.cc -o test
/tmp/cc0c9S5e.o: In function `std::_Rb_tree_const_iterator<std::pair<char const* const, int> >::operator--()':
test.cc:(.text._ZNSt23_Rb_tree_const_iteratorISt4pairIKPKciEEmmEv[std::_Rb_tree_const_iterator<std::pair<char const* const, int> >::operator--()]+0xf): undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base const*)'
[...]
/tmp/cc0c9S5e.o: In function `std::_Rb_tree_iterator<std::pair<char const* const, int> >::operator++()':
test.cc:(.text._ZNSt17_Rb_tree_iteratorISt4pairIKPKciEEppEv[std::_Rb_tree_iterator<std::pair<char const* const, int> >::operator++()]+0xf): undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
collect2: ld returned 1 exit status

The libstdc++ headers are expecting these requirements to be satisfied by libstdc++6, but since the /usr/lib32/libstdc++.so symbolic link points to the incompatible libstdc++5, the link results in unresolved symbols.

A symbolic link from /usr/lib/gcc/x86_64-linux-gnu/4.3/32/libstdc++.so should be pointed at ../../../../../lib32/libstdc++.so.6. This mimics the symbolic link placed by libstdc++6-4.3-dev in /usr/lib/gcc/x86_64-linux-gnu/4.3. This symbolic link should be provided by the lib32stdc++6. Placing this symbolic link manually allows the above C++ compilation to succeed without incident.

At the same time, the symbolic link at /usr/lib32/libstdc++.so should be removed from ia32-libs. No C++ development should take place using libstdc++5 on this system, whose installed headers expect libstdc++6.

Tags: amd64 jaunty
Revision history for this message
Mark Mentovai (mark-moxienet) wrote :
tags: added: amd64 jaunty
Fabien Tassin (fta)
Changed in ia32-libs (Ubuntu Jaunty):
assignee: nobody → Fabien Tassin (fta)
importance: Undecided → Low
milestone: none → ubuntu-9.04
status: New → In Progress
Revision history for this message
Alexander Sack (asac) wrote :

ia32-libs shouldnt have a libstdc++ link at all.

its shipped by:

g++-4.3-multilib: /usr/lib/gcc/x86_64-linux-gnu/4.3/32/libstdc++.so

So please drop the libstdc++ links altogether to fix this bug.

Changed in ia32-libs (Ubuntu Jaunty):
importance: Low → Medium
status: In Progress → Triaged
Revision history for this message
Alexander Sack (asac) wrote :

subscribed motu-release to get the mandatory ack; this package looks ok, but i would suggest to apply comment i had here: https://bugs.edge.launchpad.net/ubuntu/jaunty/+source/ia32-libs/+bug/360870/comments/2

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

This bug was fixed in the package ia32-libs - 2.7ubuntu5

---------------
ia32-libs (2.7ubuntu5) jaunty; urgency=low

  * Remove the automatically created libstdc++.so symlink, it's not needed.
    g++-4.3-multilib provides the right symlink (LP: #360870)
  * Freshen packages (as of Jaunty RC) (LP: #362939)
  * Drop libfusionsound-1.0-0 which is now obsolete
  * Fix typo in the symlink creation code

 -- Fabien Tassin <email address hidden> Fri, 17 Apr 2009 18:40:13 +0200

Changed in ia32-libs (Ubuntu Jaunty):
status: Triaged → Fix Released
Revision history for this message
ktp420 (ktp420) wrote :

since yesterday's update I am starting to see following:

Gtk-Message: Failed to load module "canberra-gtk-module": /usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so: wrong ELF class: ELFCLASS64

Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so: wrong ELF class: ELFCLASS64

Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libclearlooks.so: wrong ELF class: ELFCLASS64

Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so: wrong ELF class: ELFCLASS64

Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libpixmap.so: wrong ELF class: ELFCLASS64

Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so: wrong ELF class: ELFCLASS64

Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libclearlooks.so: wrong ELF class: ELFCLASS64

Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so: wrong ELF class: ELFCLASS64

Can we get this regression fixed? I don't know what caused it but seems like ia32-lib update might be the issue.

Revision history for this message
Chi-Chih Chen (chichihchen) wrote :

The current i32-libs version from ubuntu is 2.7ubuntu6.
They removed the symbolic link, /usr/lib32/libstdc++.so -> libstdc++.so.5 but kept the rest the same.
It did fix the libmurrine.so, libpixmap.so, and libclearlooks.so problems but not with the canberra module.

in .xsession-errors:

Gtk-Message: Failed to load module "canberra-gtk-module": /usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so: wrong ELF class: ELFCLASS64

Revision history for this message
Fabien Tassin (fta) wrote :

The module thing is different. It is related to gtk2 unable to read from /usr/lib32.
This is https://bugs.edge.launchpad.net/ubuntu/+source/ia32-libs/+bug/369498
No need to re-open this bug (360870).

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

Other bug subscribers

Bug attachments

Remote bug watches

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