Title: file /usr/local/lib/python3.1/lib-dynload/ symbol inet_aton: referenced symbol not found
Type: crash Stage: resolved
Components: Versions: Python 3.1, Python 2.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Jeff.Blaine, Per.Rosengren, alex_lai, drdevious, eric.araujo
Priority: normal Keywords:

Created on 2011-05-06 01:16 by alex_lai, last changed 2011-11-17 04:41 by Per.Rosengren. This issue is now closed.

Messages (18)
msg135257 - (view) Author: Alex Lai (alex_lai) Date: 2011-05-06 01:16
Hi guys,
  I was knocked down by a error related to a socket library when I was trying to compile distribute-0.6.14:

# python3 install
Before install bootstrap.
Scanning installed packages
No setuptools distribution found
running install
Traceback (most recent call last):
  File "", line 211, in <module>
    scripts = scripts,
  File "/usr/local/lib/python3.1/distutils/", line 149, in setup
  File "/usr/local/lib/python3.1/distutils/", line 919, in run_commands
  File "/usr/local/lib/python3.1/distutils/", line 938, in run_command
  File "build/src/setuptools/command/", line 73, in run
  File "build/src/setuptools/command/", line 82, in do_egg_install
    easy_install = self.distribution.get_command_class('easy_install')
  File "build/src/setuptools/", line 361, in get_command_class
    self.cmdclass[command] = cmdclass = ep.load()
  File "build/src/", line 1954, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "build/src/setuptools/command/", line 24, in <module>
    from setuptools.package_index import PackageIndex
  File "build/src/setuptools/", line 2, in <module>
    import sys, os.path, re, urllib.parse, urllib.request, urllib.error, urllib.parse, shutil, random, socket, io
  File "/usr/local/lib/python3.1/urllib/", line 88, in <module>
    import http.client
  File "/usr/local/lib/python3.1/http/", line 69, in <module>
    import email.parser
  File "/usr/local/lib/python3.1/email/", line 12, in <module>
    from email.feedparser import FeedParser
  File "/usr/local/lib/python3.1/email/", line 27, in <module>
    from email import message
  File "/usr/local/lib/python3.1/email/", line 17, in <module>
    from email import utils
  File "/usr/local/lib/python3.1/email/", line 28, in <module>
    import socket
  File "/usr/local/lib/python3.1/", line 45, in <module>
    import _socket
ImportError: python3: fatal: relocation error: file /usr/local/lib/python3.1/lib-dynload/ symbol inet_aton: referenced symbol not found

# ls -l /usr/local/lib/python3.1/lib-dynload/
-rwxr-xr-x   1 bin      bin       113860 Mar 23  2010 /usr/local/lib/python3.1/lib-dynload/
# ldd /usr/local/lib/python3.1/lib-dynload/ =>         /usr/local/lib/ =>     /lib/ =>     /lib/

Could anyone advise what does this error message mean?

Thanks in advance,

msg135335 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-05-06 17:12
Looks like a compilation problem.  Did you install that Python yourself?  Can you run the test suite to see if there are problems with the _socket module?
msg135349 - (view) Author: Alex Lai (alex_lai) Date: 2011-05-06 17:52
Hi Eric,
   Thank you for the reply. I installed Python 3.1.2 pre-compiled by on one of our sparc servers.
   Would you please let me know what command I should run to test the installation?


msg135464 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-05-07 14:15
$ python3.1 -m test.regrtest

If your distribution removes tests from the binary package, this won’t work.
msg135508 - (view) Author: Alex Lai (alex_lai) Date: 2011-05-07 22:20
The test fialed on my workstation while successul on another server. Both server has the same Pyton installation but different libc and libm version. I plan to reinstall the OS(solaris 10 pre-release) on my workstation next week and see how it goes.


msg135590 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-05-09 14:30
It would be helpful if you could attach the test log.  Alternatively, if the configure and build log for your Python package is available somewhere on the web, the link would be useful.
msg135637 - (view) Author: Alex Lai (alex_lai) Date: 2011-05-09 19:35
I've installed it successfully on another server. That is enough. I haven't got time to upgrade my workstation from s10 pre-release to latest s10 release yet.

Thanks for the information,

msg135782 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-05-11 15:13
Is the original bug still present in your new install?
msg135799 - (view) Author: Alex Lai (alex_lai) Date: 2011-05-11 20:00
I haven't get time to upgarde my workstation yet. I don't know when I'm going to do it. I compile the software successfully on the other server. and that's enough for me.

msg135900 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-05-13 12:03
> Is the original bug still present in your new install?
I meant your server.  I’d like to know whether this is a legit but or not.
msg135906 - (view) Author: Alex Lai (alex_lai) Date: 2011-05-13 13:18
No bugs.
msg135907 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-05-13 13:20
All right.  Don’t hesitate to report any other bugs you find in the future.
msg135913 - (view) Author: dario frascatani (drdevious) Date: 2011-05-13 14:49
I guys I have the same problem with solaris 10 and the pre-compiled package python-3.1.2 downloaded from
msg135914 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-05-13 14:52
Can you download a Python 3.1.3 from (or better, clone the 3.1 repository from, try to compile it and report errors?  We can’t do anything for files provided by sunfreeware, but we can fix platform-specific problems if they come from our code.
msg136071 - (view) Author: dario frascatani (drdevious) Date: 2011-05-16 07:52
I have some problem to compile python source code to my server, I can't install make.
My problem is only when import the smtplib.
msg136098 - (view) Author: Alex Lai (alex_lai) Date: 2011-05-16 14:44
I install the Python package compiled by sunfreeware.

Alex Lai

Senior System Support Specialist
TAG-IPM Application Support, Scotia Capital,
720 King St. West, 6th Floor,
Toronto, Ontario M5V 2T3
Tel: (416) 607-4789
-----Original Message-----
From: dario frascatani [] 
Sent: May 16, 2011 3:53 AM
To: Alex Lai (Scotia Capital)
Subject: [issue12013] file /usr/local/lib/python3.1/lib-dynload/ symbol inet_aton: referenced symbol not found

dario frascatani <> added the comment:

I have some problem to compile python source code to my server, I can't install make.
My problem is only when import the smtplib.


Python tracker <>

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, re-transmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this email in error, please contact the sender immediately by return electronic transmission and then immediately delete this transmission, including all attachments, without copying, distributing or disclosing same. No member of the Scotiabank Group is liable for any errors or omissions in the content or transmission of this email or accepts any responsibility or liability for loss or damage arising from the receipt or use of this transmission. Scotiabank Group may monitor, retain and/or review email. Trading instructions received by e-mail or voicemail will not be accepted or acted upon. Unless indicated in writing, opinions contained in this email are those of the author and are not endorsed by any member of the Scotiabank Group. 

For information on some members of the Scotiabank Group:
For authorized users of the Scotia Capital trademark:

Pour obtenir la traduction en français:
Traducción en español:
msg140552 - (view) Author: Jeff Blaine (Jeff.Blaine) Date: 2011-07-18 00:56
FWIW, this same problem exists with 2.7.1, compiled by myself, and only on some Solaris 10 boxes of ours that have not had a lot of recent patching.


On an old-ish Solaris 10 box:

% /tmp/py271test/bin/python -m test.regrtest
Traceback (most recent call last):
  File "/tmp/py271test/lib/python2.7/", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/tmp/py271test/lib/python2.7/", line 72, in _run_code
    exec code in run_globals
  File "/tmp/py271test/lib/python2.7/test/", line 211, in <module>
    from test import test_support
  File "/tmp/py271test/lib/python2.7/test/", line 10, in <module>
    import socket
  File "/tmp/py271test/lib/python2.7/", line 47, in <module>
    import _socket
ImportError: python: fatal: relocation error: file /tmp/py271test/lib/python2.7/lib-dynload/ symbol inet_aton: referenced symbol not found

On a modern Solaris 10 box patched 2 months ago:

% /tmp/py271test/bin/python -m test.regrtest
[ runs, takes too long, so we'll test the stuff that ]
[ imports socket ... ]

Python-2.7.1:cairo> for i in `grep -l "import socket" /tmp/py271test/lib/python
2.7/test/*py | sed 's/\.py//g'`; do echo "RUNNING $i"; /tmp/py271test/bin/pytho
n -m test.`basename $i`; done 2>&1 | /usr/sfw/bin/ggrep -E '(OK|RUNNING)'
RUNNING /tmp/py271test/lib/python2.7/test/test_asyncore
OK (skipped=2)
RUNNING /tmp/py271test/lib/python2.7/test/test_docxmlrpc
RUNNING /tmp/py271test/lib/python2.7/test/test_epoll
RUNNING /tmp/py271test/lib/python2.7/test/test_ftplib
RUNNING /tmp/py271test/lib/python2.7/test/test_httplib
OK (skipped=1)
RUNNING /tmp/py271test/lib/python2.7/test/test_import
RUNNING /tmp/py271test/lib/python2.7/test/test_kqueue
RUNNING /tmp/py271test/lib/python2.7/test/test_logging
RUNNING /tmp/py271test/lib/python2.7/test/test_mailbox
RUNNING /tmp/py271test/lib/python2.7/test/test_multiprocessing
msg147790 - (view) Author: Per Rosengren (Per.Rosengren) Date: 2011-11-17 04:41
On Linux:
>nm -C /lib/ |grep ' inet_aton'
00000000000cbce0 W inet_aton

This means that when Python is build with GCC (like on linux), inet_aton
is in system libc. 

If you build with GCC in solaris, inet_aton will be taken from the GCC lib dir. You need to put that GCC lib dir in your LD_LIBRARY_PATH when you run Python.
Date User Action Args
2011-11-17 04:41:49Per.Rosengrensetnosy: + Per.Rosengren
messages: + msg147790
2011-07-18 00:57:06Jeff.Blainesetversions: + Python 2.7
2011-07-18 00:56:45Jeff.Blainesetnosy: + Jeff.Blaine
messages: + msg140552
2011-05-16 14:44:13alex_laisetmessages: + msg136098
title: file /usr/local/lib/python3.1/lib-dynload/ symbol inet_aton: referenced symbol not found -> file /usr/local/lib/python3.1/lib-dynload/ symbol inet_aton: referenced symbol not found
2011-05-16 07:52:34drdevioussetmessages: + msg136071
2011-05-13 14:52:30eric.araujosetmessages: + msg135914
2011-05-13 14:49:41drdevioussetnosy: + drdevious
messages: + msg135913
2011-05-13 13:20:41eric.araujosetstatus: open -> closed
resolution: not a bug
messages: + msg135907

stage: resolved
2011-05-13 13:18:59alex_laisetmessages: + msg135906
2011-05-13 12:03:07eric.araujosetmessages: + msg135900
2011-05-11 20:00:45alex_laisetmessages: + msg135799
2011-05-11 15:13:36eric.araujosetmessages: + msg135782
2011-05-09 19:35:13alex_laisetmessages: + msg135637
2011-05-09 14:30:16eric.araujosetmessages: + msg135590
2011-05-07 22:20:03alex_laisetmessages: + msg135508
2011-05-07 14:15:52eric.araujosetmessages: + msg135464
2011-05-06 17:52:22alex_laisetmessages: + msg135349
2011-05-06 17:12:02eric.araujosetnosy: + eric.araujo
messages: + msg135335
2011-05-06 01:16:24alex_laicreate