LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 04-13-2010, 03:57 PM   #1
robmoser
LQ Newbie
 
Registered: Mar 2010
Posts: 10

Rep: Reputation: 0
yum failed to map segment from shared object


Hello All,

I've got a redhat 5.5 machine which is supposedly up-to-date according to RHN. When I try to do anything with yum, I get the following error:

Code:
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   /usr/lib64/python2.4/lib-dynload/_weakref.so: failed to map segment from shared object: Cannot allocate memory

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.4.3 (#1, Jun 11 2009, 14:09:37) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]

If you cannot solve this problem yourself, please go to 
the yum faq at:
  http://yum.baseurl.org/wiki/Faq
RHN verifies both the python and yum packages as correct, and as near as I can tell the version of yum I have (yum-3.2.22-26.el5) should work fine with the version of python (python-2.4.3-27.el5). What's more, I have a separate brand new redhat machine with exactly the same versions of the software installed, and yum works fine on that machine. If I import the yum library into python myself I get a segmentation fault:
Code:
# python -vv
import zipimport # builtin
import site # precompiled from /usr/lib64/python2.4/site.pyc
import os # precompiled from /usr/lib64/python2.4/os.pyc
import posix # builtin
import posixpath # precompiled from /usr/lib64/python2.4/posixpath.pyc
import stat # precompiled from /usr/lib64/python2.4/stat.pyc
import errno # builtin
import UserDict # precompiled from /usr/lib64/python2.4/UserDict.pyc
import copy_reg # precompiled from /usr/lib64/python2.4/copy_reg.pyc
import types # precompiled from /usr/lib64/python2.4/types.pyc
import japanese # directory /usr/lib64/python2.4/site-packages/japanese
import japanese # precompiled from /usr/lib64/python2.4/site-packages/japanese/__init__.pyc
import japanese.aliases # directory /usr/lib64/python2.4/site-packages/japanese/aliases
import japanese.aliases # precompiled from /usr/lib64/python2.4/site-packages/japanese/aliases/__init__.pyc
import encodings # directory /usr/lib64/python2.4/encodings
import encodings # precompiled from /usr/lib64/python2.4/encodings/__init__.pyc
import codecs # precompiled from /usr/lib64/python2.4/codecs.pyc
import _codecs # builtin
import encodings.aliases # precompiled from /usr/lib64/python2.4/encodings/aliases.pyc
import warnings # precompiled from /usr/lib64/python2.4/warnings.pyc
import linecache # precompiled from /usr/lib64/python2.4/linecache.pyc
import encodings.utf_8 # precompiled from /usr/lib64/python2.4/encodings/utf_8.pyc
Python 2.4.3 (#1, Jun 11 2009, 14:09:37) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
dlopen("/usr/lib64/python2.4/lib-dynload/readline.so", 2);
import readline # dynamically loaded from /usr/lib64/python2.4/lib-dynload/readline.so

>>> import yum
import yum # directory /usr/lib/python2.4/site-packages/yum
import yum # precompiled from /usr/lib/python2.4/site-packages/yum/__init__.pyc
import rpm # directory /usr/lib64/python2.4/site-packages/rpm
import rpm # precompiled from /usr/lib64/python2.4/site-packages/rpm/__init__.pyc
dlopen("/usr/lib64/python2.4/site-packages/rpm/_rpmmodule.so", 2);
import rpm._rpm # dynamically loaded from /usr/lib64/python2.4/site-packages/rpm/_rpmmodule.so
import re # precompiled from /usr/lib64/python2.4/re.pyc
import sre # precompiled from /usr/lib64/python2.4/sre.pyc
import sre_compile # precompiled from /usr/lib64/python2.4/sre_compile.pyc
import _sre # builtin
import sre_constants # precompiled from /usr/lib64/python2.4/sre_constants.pyc
import sre_parse # precompiled from /usr/lib64/python2.4/sre_parse.pyc
dlopen("/usr/lib64/python2.4/lib-dynload/timemodule.so", 2);
import time # dynamically loaded from /usr/lib64/python2.4/lib-dynload/timemodule.so
import glob # precompiled from /usr/lib64/python2.4/glob.pyc
import fnmatch # precompiled from /usr/lib64/python2.4/fnmatch.pyc
import logging # directory /usr/lib64/python2.4/logging
import logging # precompiled from /usr/lib64/python2.4/logging/__init__.pyc
import string # precompiled from /usr/lib64/python2.4/string.pyc
dlopen("/usr/lib64/python2.4/lib-dynload/stropmodule.so", 2);
import strop # dynamically loaded from /usr/lib64/python2.4/lib-dynload/stropmodule.so
dlopen("/usr/lib64/python2.4/lib-dynload/cStringIO.so", 2);
import cStringIO # dynamically loaded from /usr/lib64/python2.4/lib-dynload/cStringIO.so
import traceback # precompiled from /usr/lib64/python2.4/traceback.pyc
import thread # builtin
import threading # precompiled from /usr/lib64/python2.4/threading.pyc
dlopen("/usr/lib64/python2.4/lib-dynload/collectionsmodule.so", 2);
import collections # dynamically loaded from /usr/lib64/python2.4/lib-dynload/collectionsmodule.so
import atexit # precompiled from /usr/lib64/python2.4/atexit.pyc
import logging.config # precompiled from /usr/lib64/python2.4/logging/config.pyc
import logging.handlers # precompiled from /usr/lib64/python2.4/logging/handlers.pyc
import socket # precompiled from /usr/lib64/python2.4/socket.pyc
dlopen("/usr/lib64/python2.4/lib-dynload/_socketmodule.so", 2);
import _socket # dynamically loaded from /usr/lib64/python2.4/lib-dynload/_socketmodule.so
dlopen("/usr/lib64/python2.4/lib-dynload/_ssl.so", 2);
import _ssl # dynamically loaded from /usr/lib64/python2.4/lib-dynload/_ssl.so
dlopen("/usr/lib64/python2.4/lib-dynload/cPickle.so", 2);
import cPickle # dynamically loaded from /usr/lib64/python2.4/lib-dynload/cPickle.so
dlopen("/usr/lib64/python2.4/lib-dynload/structmodule.so", 2);
import struct # dynamically loaded from /usr/lib64/python2.4/lib-dynload/structmodule.so
import SocketServer # precompiled from /usr/lib64/python2.4/SocketServer.pyc
dlopen("/usr/lib64/python2.4/lib-dynload/operator.so", 2);
import operator # dynamically loaded from /usr/lib64/python2.4/lib-dynload/operator.so
import gzip # precompiled from /usr/lib64/python2.4/gzip.pyc
dlopen("/usr/lib64/python2.4/lib-dynload/zlibmodule.so", 2);
import zlib # dynamically loaded from /usr/lib64/python2.4/lib-dynload/zlibmodule.so
import yum.i18n # precompiled from /usr/lib/python2.4/site-packages/yum/i18n.pyc
import iniparse # directory /usr/lib/python2.4/site-packages/iniparse
import iniparse # precompiled from /usr/lib/python2.4/site-packages/iniparse/__init__.pyc
import iniparse.ini # precompiled from /usr/lib/python2.4/site-packages/iniparse/ini.pyc
import iniparse.config # precompiled from /usr/lib/python2.4/site-packages/iniparse/config.pyc
import sets # precompiled from /usr/lib64/python2.4/sets.pyc
import __future__ # precompiled from /usr/lib64/python2.4/__future__.pyc
dlopen("/usr/lib64/python2.4/lib-dynload/itertoolsmodule.so", 2);
import itertools # dynamically loaded from /usr/lib64/python2.4/lib-dynload/itertoolsmodule.so
import ConfigParser # precompiled from /usr/lib64/python2.4/ConfigParser.pyc
import iniparse.compat # precompiled from /usr/lib/python2.4/site-packages/iniparse/compat.pyc
import yum.Errors # precompiled from /usr/lib/python2.4/site-packages/yum/Errors.pyc
import yum.rpmsack # precompiled from /usr/lib/python2.4/site-packages/yum/rpmsack.pyc
import rpmUtils # directory /usr/lib/python2.4/site-packages/rpmUtils
import rpmUtils # precompiled from /usr/lib/python2.4/site-packages/rpmUtils/__init__.pyc
import rpmUtils.miscutils # precompiled from /usr/lib/python2.4/site-packages/rpmUtils/miscutils.pyc
import locale # precompiled from /usr/lib64/python2.4/locale.pyc
dlopen("/usr/lib64/python2.4/lib-dynload/_localemodule.so", 2);
import _locale # dynamically loaded from /usr/lib64/python2.4/lib-dynload/_localemodule.so
import rpmUtils.transaction # precompiled from /usr/lib/python2.4/site-packages/rpmUtils/transaction.pyc
import yum.misc # precompiled from /usr/lib/python2.4/site-packages/yum/misc.pyc
import base64 # precompiled from /usr/lib64/python2.4/base64.pyc
dlopen("/usr/lib64/python2.4/lib-dynload/binascii.so", 2);
import binascii # dynamically loaded from /usr/lib64/python2.4/lib-dynload/binascii.so
import yum.pgpmsg # precompiled from /usr/lib/python2.4/site-packages/yum/pgpmsg.pyc
dlopen("/usr/lib64/python2.4/lib-dynload/shamodule.so", 2);
import sha # dynamically loaded from /usr/lib64/python2.4/lib-dynload/shamodule.so
dlopen("/usr/lib64/python2.4/lib-dynload/md5module.so", 2);
import md5 # dynamically loaded from /usr/lib64/python2.4/lib-dynload/md5module.so
import tempfile # precompiled from /usr/lib64/python2.4/tempfile.pyc
import random # precompiled from /usr/lib64/python2.4/random.pyc
dlopen("/usr/lib64/python2.4/lib-dynload/mathmodule.so", 2);
import math # dynamically loaded from /usr/lib64/python2.4/lib-dynload/mathmodule.so
dlopen("/usr/lib64/python2.4/lib-dynload/_randommodule.so", 2);
import _random # dynamically loaded from /usr/lib64/python2.4/lib-dynload/_randommodule.so
dlopen("/usr/lib64/python2.4/lib-dynload/fcntlmodule.so", 2);
import fcntl # dynamically loaded from /usr/lib64/python2.4/lib-dynload/fcntlmodule.so
import pwd # builtin
dlopen("/usr/lib64/python2.4/lib-dynload/bz2.so", 2);
import bz2 # dynamically loaded from /usr/lib64/python2.4/lib-dynload/bz2.so
import yum.packages # precompiled from /usr/lib/python2.4/site-packages/yum/packages.pyc
import rpmUtils.arch # precompiled from /usr/lib/python2.4/site-packages/rpmUtils/arch.pyc
import yum.constants # precompiled from /usr/lib/python2.4/site-packages/yum/constants.pyc
import urlparse # precompiled from /usr/lib64/python2.4/urlparse.pyc
dlopen("/usr/lib64/python2.4/lib-dynload/grpmodule.so", 2);
import grp # dynamically loaded from /usr/lib64/python2.4/lib-dynload/grpmodule.so
import yum.packageSack # precompiled from /usr/lib/python2.4/site-packages/yum/packageSack.pyc
import rpmUtils.updates # precompiled from /usr/lib/python2.4/site-packages/rpmUtils/updates.pyc
import yum.comps # precompiled from /usr/lib/python2.4/site-packages/yum/comps.pyc
import xml # directory /usr/lib64/python2.4/xml
import xml # precompiled from /usr/lib64/python2.4/xml/__init__.pyc
import _xmlplus # directory /usr/lib64/python2.4/site-packages/_xmlplus
import _xmlplus # precompiled from /usr/lib64/python2.4/site-packages/_xmlplus/__init__.pyc
dlopen("/usr/lib64/python2.4/site-packages/cElementTree.so", 2);
import copy # precompiled from /usr/lib64/python2.4/copy.pyc
import inspect # precompiled from /usr/lib64/python2.4/inspect.pyc
import dis # precompiled from /usr/lib64/python2.4/dis.pyc
import opcode # precompiled from /usr/lib64/python2.4/opcode.pyc
import imp # builtin
import tokenize # precompiled from /usr/lib64/python2.4/tokenize.pyc
import token # precompiled from /usr/lib64/python2.4/token.pyc
import elementtree # directory /usr/lib/python2.4/site-packages/elementtree
import elementtree # precompiled from /usr/lib/python2.4/site-packages/elementtree/__init__.pyc
import elementtree.ElementTree # precompiled from /usr/lib/python2.4/site-packages/elementtree/ElementTree.pyc
import elementtree.ElementPath # precompiled from /usr/lib/python2.4/site-packages/elementtree/ElementPath.pyc
dlopen("/usr/lib64/python2.4/lib-dynload/arraymodule.so", 2);
import array # dynamically loaded from /usr/lib64/python2.4/lib-dynload/arraymodule.so
import cElementTree # dynamically loaded from /usr/lib64/python2.4/site-packages/cElementTree.so
import yum.config # precompiled from /usr/lib/python2.4/site-packages/yum/config.pyc
import yum.parser # precompiled from /usr/lib/python2.4/site-packages/yum/parser.pyc
import urlgrabber # directory /usr/lib/python2.4/site-packages/urlgrabber
import urlgrabber # precompiled from /usr/lib/python2.4/site-packages/urlgrabber/__init__.pyc
import urlgrabber.grabber # precompiled from /usr/lib/python2.4/site-packages/urlgrabber/grabber.pyc
import rfc822 # precompiled from /usr/lib64/python2.4/rfc822.pyc
import urllib # precompiled from /usr/lib64/python2.4/urllib.pyc
import urllib2 # precompiled from /usr/lib64/python2.4/urllib2.pyc
import ftplib # precompiled from /usr/lib64/python2.4/ftplib.pyc
import gopherlib # precompiled from /usr/lib64/python2.4/gopherlib.pyc
import httplib # precompiled from /usr/lib64/python2.4/httplib.pyc
import mimetools # precompiled from /usr/lib64/python2.4/mimetools.pyc
import mimetypes # precompiled from /usr/lib64/python2.4/mimetypes.pyc
import bisect # precompiled from /usr/lib64/python2.4/bisect.pyc
dlopen("/usr/lib64/python2.4/lib-dynload/_bisect.so", 2);
import _bisect # dynamically loaded from /usr/lib64/python2.4/lib-dynload/_bisect.so
# trying cookielib.so
# trying cookielibmodule.so
# trying cookielib.py
# trying cookielib.pyc
# trying /usr/lib64/python24.zip/cookielib.so
# trying /usr/lib64/python24.zip/cookielibmodule.so
# trying /usr/lib64/python24.zip/cookielib.py
# trying /usr/lib64/python24.zip/cookielib.pyc
# trying /usr/lib64/python2.4/cookielib.so
# trying /usr/lib64/python2.4/cookielibmodule.so
# trying /usr/lib64/python2.4/cookielib.py
# /usr/lib64/python2.4/cookielib.pyc matches /usr/lib64/python2.4/cookielib.py
Segmentation fault
I've tried googling round but can't find anyone else having a similar problem; anyone have any suggestions? Thanks for any help,

- rob.
 
Old 04-13-2010, 05:36 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Reinstall yum from rpm. or you could reinstall python with a slightly earlier version.

http://rpm.pbone.net/index.php3/stat...86_64.rpm.html

The best thing to do is hassle RedHat, since you paid already.

BTW _weakref.so appears in at least 1000 hits on google for "_weakref.so problem"

Last edited by smoker; 04-13-2010 at 05:38 PM.
 
Old 04-16-2010, 12:44 PM   #3
robmoser
LQ Newbie
 
Registered: Mar 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by smoker View Post
Reinstall yum from rpm. or you could reinstall python with a slightly earlier version.
Tried that; no dice. I'm starting to suspect that I might have some sort of legitimate memory or memory configuration problem, as I've since seen a couple of similar messages from other libraries:

prelink: /usr/bin/gnome-about-me: Could not parse
`/usr/bin/gnome-about-me: error while loading shared libraries:
libasound.so.2: failed to map segment from shared object: Cannot
allocate memory'

I've very little truly "free" memory on the system, but I gathered this is pretty normal; the fact that so much is inactive, and the swap is essentially unused, I thought meant that I should still have plenty of memory to allocate?

Code:
# vmstat -s
      9437184  total memory
      9418056  used memory
      2132764  active memory
      3682956  inactive memory
        19128  free memory
      2913176  buffer memory
      1812444  swap cache
      6144852  total swap
          112  used swap
      6144740  free swap
Quote:
BTW _weakref.so appears in at least 1000 hits on google for "_weakref.so problem"
Its true; it does. But for the most part they don't appear to be memory allocation errors, and nothing I could find in wading through them looked relevant. I tried searching for "_weakref.so: failed to map" and got half a dozen hits, all of them different views of this post...
 
Old 04-19-2010, 12:06 PM   #4
robmoser
LQ Newbie
 
Registered: Mar 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Solved it.

For anyone else's reference, should they end up with the same problem and find this thread:

RedHat (and possibly other Linuxes, but I'll stick to what I'm sure of) does not reset user limits when you su to another user. Thus, when I logged in as me, my user limits were set to values reasonable for an individual user, but when I su-ed to root I had those same limits, but now applied to root processes. There being a fair number of root processes running on the machine eating memory, those limits were exceeded, and I couldn't get at any more memory. So the memory allocation error from yum was legitimate, but the problem wasn't system memory - which I'd checked - it was user limits.

Anyone finding themselves with the same error message should use ulimit -a to check their user limits, checking particularly the virtual memory limit, and reset it as necessary with ulimit -v.

Thanks again for your help guys.

- rob.
 
Old 04-19-2010, 12:22 PM   #5
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Interesting.
On my Fedora 12 I get unlimited for virtual memory no matter which user I am.

Code:
[user@localhost ~]$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 8192
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1024
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
[user@localhost ~]$ su
Password: 
[root@localhost user]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 8192
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1024
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
[root@localhost user]# su -
[root@localhost ~]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 8192
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1024
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
It's a similar situation with my (much) older Fedora core 4 machine.

Last edited by smoker; 04-19-2010 at 12:24 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error while loading shared libraries: libhid.so.0: cannot open shared object file: No misungs Linux - Software 4 06-10-2009 12:05 PM
gxine: error while loading shared libraries: libmozjs.so: cannot open shared object.. empcrono Slackware 10 11-10-2008 07:33 PM
error while loading shared libraries: libstdc++.so.5: cannot open shared object file PaulyWally Debian 2 10-18-2008 05:59 PM
error while loading shared libraries: libgvc.so.3: cannot open shared object file coolrock Slackware 6 01-17-2007 05:10 PM
Stopped due to shared library event - Failed to read a valid object file... tatchan Programming 3 01-16-2007 01:13 PM


All times are GMT -5. The time now is 12:29 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration