Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#4926 closed defect (fixed)

physics-28 fails to start on fedora 18 i386

Reported by: quozl Owned by:
Priority: High Milestone: Unspecified
Component: Physics Version: Unspecified
Severity: Major Keywords:
Cc: Distribution/OS: Unspecified
Bug Status: New

Description

Traceback (most recent call last):
  File "/usr/bin/sugar-activity", line 169, in <module>
    main()
  File "/usr/bin/sugar-activity", line 121, in main
    module = __import__(module_name)
  File "/home/olpc/Activities/Physics.activity/activity.py", line 64, in <module>
    import physics
  File "/home/olpc/Activities/Physics.activity/physics.py", line 40, in <module>
    import lib.Box2D as box2d
  File "/home/olpc/Activities/Physics.activity/lib/Box2D.py", line 9, in <module>
    from box2d_32 import *
  File "/home/olpc/Activities/Physics.activity/lib/box2d_32/__init__.py", line 20, in <module>
    from .Box2D import *
  File "/home/olpc/Activities/Physics.activity/lib/box2d_32/Box2D.py", line 32, in <module>
    _Box2D = swig_import_helper()
  File "/home/olpc/Activities/Physics.activity/lib/box2d_32/Box2D.py", line 28, in swig_import_helper
    _mod = imp.load_module('_Box2D', fp, pathname, description)
ImportError: /lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/olpc/Activities/Physics.activity/lib/box2d_32/_Box2D.so)
Exited with status 1, pid 3967 data (None, <open file '<fdopen>', mode 'w' at 0x93975a0>, '31759877edf9f16b3fe4686634e755226b26bc6a')

Change History (24)

comment:1 Changed 8 years ago by quozl

Reproduces outside Python using ldd:

-bash-4.2# find /usr/lib |grep libstdc
/usr/lib/libstdc++.so.6.0.17
/usr/lib/libstdc++.so.6
-bash-4.2# rpm -qf /usr/lib/libstdc++.so.6.0.17
libstdc++-4.7.2-8.fc18.i686
-bash-4.2# ldd /home/olpc/Activities/Physics.activity/lib/box2d_32/_Box2D.so
/home/olpc/Activities/Physics.activity/lib/box2d_32/_Box2D.so: /lib/libstdc++.so.6: \
    version `GLIBCXX_3.4.21' not found \
    (required by /home/olpc/Activities/Physics.activity/lib/box2d_32/_Box2D.so)
        linux-gate.so.1 =>  (0xb7765000)
        libpython2.7.so.1.0 => /lib/libpython2.7.so.1.0 (0xb7485000)
        libstdc++.so.6 => /lib/libstdc++.so.6 (0xb739b000)
        libm.so.6 => /lib/libm.so.6 (0xb735b000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb733d000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7322000)
        libc.so.6 => /lib/libc.so.6 (0xb716c000)
        libdl.so.2 => /lib/libdl.so.2 (0xb7167000)
        libutil.so.1 => /lib/libutil.so.1 (0xb7163000)
        /lib/ld-linux.so.2 (0xb7766000)
-bash-4.2# 

comment:2 Changed 8 years ago by walter

Seems F18 has old c libs. I'll have to figure out which ones we need to include with the activity. I suspect it will be more than just libstdc++.so.6

comment:3 follow-up: Changed 8 years ago by quozl

Does not occur on XO-4.

Does occur on XO-1.5.

Perhaps libstdc++.so.6 of build system differs from that of running system.

comment:4 Changed 8 years ago by quozl

Tested https://github.com/walterbender/physics/commit/8b28499c5a319f87b8c536df4ec206ad130b4b6f

Still fails to start, but logs show new error:

OSError: /lib/libc.so.6: version `GLIBC_2.18' not found (required by lib/libstdc++.so)

in full context:

Traceback (most recent call last):
  File "/usr/bin/sugar-activity", line 169, in <module>
    main()
  File "/usr/bin/sugar-activity", line 121, in main
    module = __import__(module_name)
  File "/home/olpc/Activities/Physics.activity/activity.py", line 64, in <module>
    import physics
  File "/home/olpc/Activities/Physics.activity/physics.py", line 40, in <module>
    import lib.Box2D as box2d
  File "/home/olpc/Activities/Physics.activity/lib/Box2D.py", line 10, in <module>
    libstdc = cdll.LoadLibrary("lib/libstdc++.so")
  File "/usr/lib/python2.7/ctypes/__init__.py", line 438, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 360, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /lib/libc.so.6: version `GLIBC_2.18' not found (required by lib/libstdc++.so)
Exited with status 1, pid 1148 data
 (None, <open file '<fdopen>', mode 'w' at 0xa895c28>,
 '3b824cc4f6c2eabfe557543598a32511eefa3cc5')

The symbolic link /lib/libc.so.6 points to libc-2.16.so and is provided by package glibc-2.16-34.fc18.i686

comment:5 Changed 8 years ago by walter

Added a symlink to libstdc++.so.6 and try loading the library under both names. Works on a 32 bit machine for me, but please test on F18/XO1.5

comment:6 Changed 8 years ago by quozl

Alas, unchanged; still your libstdc++.so requires glibc 2.18 but the system has 2.16, so either _Box2D.so needs to be built on Fedora 18, or you must add your libc.so.6 to the directory. Happy to test either.

comment:7 Changed 8 years ago by walter

libstdc++.so and libstdc++.so.6 (a sym link) are included in the bundle. But apparently they are not being loaded properly. I'll try a different approach.

comment:9 Changed 8 years ago by quozl

Alas, that takes us back to the original problem on the ticket; your _Box2D.so wants GLIBCXX_3.4.21 to be in libstdc++.so.6 but the system has a different version:

Traceback (most recent call last):
  File "/usr/bin/sugar-activity", line 169, in <module>
    main()
  File "/usr/bin/sugar-activity", line 121, in main
    module = __import__(module_name)
  File "/home/olpc/Activities/Physics.activity/activity.py", line 64, in <module>
    import physics
  File "/home/olpc/Activities/Physics.activity/physics.py", line 40, in <module>
    import lib.Box2D as box2d
  File "/home/olpc/Activities/Physics.activity/lib/Box2D.py", line 14, in <module>
    from box2d_32 import *
  File "/home/olpc/Activities/Physics.activity/lib/box2d_32/__init__.py", line 20, in <module>
    from .Box2D import *
  File "/home/olpc/Activities/Physics.activity/lib/box2d_32/Box2D.py", line 32, in <module>
    _Box2D = swig_import_helper()
  File "/home/olpc/Activities/Physics.activity/lib/box2d_32/Box2D.py", line 28, in swig_import_helper
    _mod = imp.load_module('_Box2D', fp, pathname, description)
ImportError: /lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found
 (required by /home/olpc/Activities/Physics.activity/lib/box2d_32/_Box2D.so)
Exited with status 1, pid 1368 data
 (None, <open file '<fdopen>', mode 'w' at 0xadad808>,
 '21988845277dfe418c44f81afa031f3451e02620')

So either;

  • you build _Box2D.so on Fedora 18, or
  • you add your libc.so.6 to the bundle.

comment:10 Changed 8 years ago by walter

Now I set the sys path *and* load the libraries. Not sure what else to try if that doesn't work. (I will also try to get my hands on an F18 machine 32-bit machine to build on)

comment:11 Changed 8 years ago by quozl

Alas, back to the second problem (comment:4); your libstdc++.so wants a later libc.so.6, so either;

  • you build _Box2d.so on Fedora 18, or
  • you add your libc.so.6 to the bundle.
Traceback (most recent call last):
  File "/usr/bin/sugar-activity", line 169, in <module>
    main()
  File "/usr/bin/sugar-activity", line 121, in main
    module = __import__(module_name)
  File "/home/olpc/Activities/Physics.activity/activity.py", line 64, in <module>
    import physics
  File "/home/olpc/Activities/Physics.activity/physics.py", line 40, in <module>
    import lib.Box2D as box2d
  File "/home/olpc/Activities/Physics.activity/lib/Box2D.py", line 12, in <module>
    libstdc = cdll.LoadLibrary("lib/box2d_32/libstdc++.so")
  File "/usr/lib/python2.7/ctypes/__init__.py", line 438, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 360, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /lib/libc.so.6: version `GLIBC_2.18' not found
 (required by lib/box2d_32/libstdc++.so)
Version 0, edited 8 years ago by quozl (next)

comment:12 Changed 8 years ago by walter

Oops. I've been adding libstdc++.so.6, not libc.so.6. I'll add libc.so.6.

comment:14 Changed 8 years ago by quozl

That's a very strange libc.so, it contains a few lines of text. I had expected a nice big binary like libstdc++.so. Also, the error is unchanged. ;-)

comment:15 Changed 8 years ago by walter

please try again

comment:16 Changed 8 years ago by quozl

Ugh, now my turn for mistake; at the time of cdll.LoadLibrary, our libc.so is already loaded by Python and can't be replaced. You would have to use a shell script wrapper with the LD_LIBRARY_PATH mechanism to get around it.

Or, you build _Box2d.so on Fedora 18.

(8005d96 gives same problem).

comment:17 Changed 8 years ago by quozl

On Fedora 18 x86, pybox2d was cloned from https://github.com/pybox2d/pybox2d and then built, the build files were copied into the activity tree, lib/Box2D.py was trimmed to a bare import, and the .so files removed; but while it got further, there was a new error that didn't make much sense to me;

Traceback (most recent call last):
  File "/usr/bin/sugar-activity", line 169, in <module>
    main()
  File "/usr/bin/sugar-activity", line 121, in main
    module = __import__(module_name)
  File "/home/olpc/Activities/Physics.activity/activity.py", line 64, in <module>
    import physics
  File "/home/olpc/Activities/Physics.activity/physics.py", line 40, in <module>
    import lib.Box2D as box2d
  File "/home/olpc/Activities/Physics.activity/lib/Box2D.py", line 14, in <module>
    from box2d_32 import *
  File "/home/olpc/Activities/Physics.activity/lib/box2d_32/__init__.py", line 20, in <module>
    from .Box2D import *
  File "/home/olpc/Activities/Physics.activity/lib/box2d_32/Box2D.py", line 435, in <module>
    _Box2D.RAND_LIMIT_swigconstant(_Box2D)
AttributeError: 'module' object has no attribute 'RAND_LIMIT_swigconstant'

Any ideas?

comment:18 Changed 8 years ago by walter

I think the problem is we really do need the new libraries. I've got one more import idea to try.

comment:19 in reply to: ↑ 3 Changed 8 years ago by JerryV

Just an observation,

Replying to quozl:

Does not occur on XO-4.

Does occur on XO-1.5.

That would suggest that the arm version of the supplied _Box2d.so library might be F18 based and most likely has been copied from the Box2D rpm. If that is true then one would want to use the matching version from the i686 x86_64 rpms.

http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/18/Everything/x86_64/os/Packages/b/Box2D-2.2.1-3.fc18.i686.rpm

http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/18/Everything/x86_64/os/Packages/b/Box2D-2.2.1-3.fc18.x86_64.rpm

The fly in the ointment would be dependencies that Box2d.so might have that would be met by installing the rpm directly, but a quick check of the rpm spec file shows that are no other dependencies. F22 is offering 2.2.1-7 so it looks like the source as not changed in a while.

comment:20 Changed 8 years ago by quozl

Thanks for the ideas. I've tried them, but it doesn't work, with

  File "/home/olpc/Activities/Physics.activity/lib/box2d_32/Box2D.py", \
    line 28, in swig_import_helper
    _mod = imp.load_module('_Box2D', fp, pathname, description)
ImportError: dynamic module does not define init function (init_Box2D)

What I did was;

  • install Box2D-2.2.1-3.fc18.i686.rpm,
  • copy /usr/lib/libBox2D.so.2.1.0 to lib/box2d_32/_Box2d.so
  • simplified lib/Box2D.py to only from box2d_32 import *

Then, since the Fedora 18 system already had pybox2d-2.0.2b2-8, I tried that too;

  • copy /usr/lib/python2.7/site-packages/Box2D/{Box2D.py,init.py,_Box2d.so} to lib/box2d_32/

That gave me:

  File "/home/olpc/Activities/Physics.activity/myelements/elements.py", \
    line 655, in <module>
    class Query_CB(box2d.b2QueryCallback):
AttributeError: 'module' object has no attribute 'b2QueryCallback'

Which says that the new code in Physics depends on new features of Box2d?

comment:21 Changed 8 years ago by quozl

Physics-30 retested with Fedora 18, it works fine on XO-4 and XO-1.75, but does not start on XO-1.5 or XO-1. Logs show GLIBC_2.18 not found.

comment:22 Changed 7 years ago by quozl

Problem unchanged on Physics-32.

comment:23 Changed 7 years ago by quozl

  • Resolution set to fixed
  • Status changed from new to closed

comment:24 Changed 7 years ago by quozl

Good test report received.

A bundle available also as http://people.sugarlabs.org/~quozl/Physics-32.1.xo

Note: See TracTickets for help on using tickets.