Google App Engine - Hello World Tutorial - Segmentation Fault
I am just starting to use google app engine and have just started running the tutorial. When I do this:
$ python2.5 google_appengine/dev_appserver.py helloworld/
it says 'Segmentation Fault'.
I am running Ubuntu 10.10. I installe开发者_运维问答d Python 2.5 from the site with help from this site.
The reason I have python2.5 at the beginning of my command is that I did an altinstall of Python 2.5 so that I would still be able to use Python 2.7.
Everything looks like it should work but it isn't. Does anyone know what my issue is?
I am able to run Python 2.5 interactively. It is only when I run dev_appserver.py that I get a seg fault. I did more tests and even when I just run:
$ ./google_appengine/dev_appserver.py
it gives me a seg fault. I don't know if this helps, but I thought it might.
I ran it with the verbose output:
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/local/lib/python2.5/site.pyc matches /usr/local/lib/python2.5/site.py
import site # precompiled from /usr/local/lib/python2.5/site.pyc
# /usr/local/lib/python2.5/os.pyc matches /usr/local/lib/python2.5/os.py
import os # precompiled from /usr/local/lib/python2.5/os.pyc
import errno # builtin
import posix # builtin
# /usr/local/lib/python2.5/posixpath.pyc matches /usr/local/lib/python2.5/posixpath.py
import posixpath # precompiled from /usr/local/lib/python2.5/posixpath.pyc
# /usr/local/lib/python2.5/stat.pyc matches /usr/local/lib/python2.5/stat.py
import stat # precompiled from /usr/local/lib/python2.5/stat.pyc
# /usr/local/lib/python2.5/UserDict.pyc matches /usr/local/lib/python2.5/UserDict.py
import UserDict # precompiled from /usr/local/lib/python2.5/UserDict.pyc
# /usr/local/lib/python2.5/copy_reg.pyc matches /usr/local/lib/python2.5/copy_reg.py
import copy_reg # precompiled from /usr/local/lib/python2.5/copy_reg.pyc
# /usr/local/lib/python2.5/types.pyc matches /usr/local/lib/python2.5/types.py
import types # precompiled from /usr/local/lib/python2.5/types.pyc
import _types # builtin
# /usr/local/lib/python2.5/warnings.pyc matches /usr/local/lib/python2.5/warnings.py
import warnings # precompiled from /usr/local/lib/python2.5/warnings.pyc
# /usr/local/lib/python2.5/linecache.pyc matches /usr/local/lib/python2.5/linecache.py
import linecache # precompiled from /usr/local/lib/python2.5/linecache.pyc
import encodings # directory /usr/local/lib/python2.5/encodings
# /usr/local/lib/python2.5/encodings/__init__.pyc matches /usr/local/lib/python2.5/encodings/__init__.py
import encodings # precompiled from /usr/local/lib/python2.5/encodings/__init__.pyc
# /usr/local/lib/python2.5/codecs.pyc matches /usr/local/lib/python2.5/codecs.py
import codecs # precompiled from /usr/local/lib/python2.5/codecs.pyc
import _codecs # builtin
# /usr/local/lib/python2.5/encodings/aliases.pyc matches /usr/local/lib/python2.5/encodings/aliases.py
import encodings.aliases # precompiled from /usr/local/lib/python2.5/encodings/aliases.pyc
# /usr/local/lib/python2.5/encodings/utf_8.pyc matches /usr/local/lib/python2.5/encodings/utf_8.py
import encodings.utf_8 # precompiled from /usr/local/lib/python2.5/encodings/utf_8.pyc
Python 2.5.5 (r255:77872, Feb 17 2011, 21:03:23)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import google # directory /home/admin/google_app_engine/google_appengine/google
# /home/admin/google_app_engine/google_appengine/google/__init__.pyc matches /home/admin/google_app_engine/google_appengine/google/__init__.py
import google # precompiled from /home/admin/google_app_engine/google_appengine/google/__init__.pyc
import google.appengine # directory /home/admin/google_app_engine/google_appengine/google/appengine
# /home/admin/google_app_engine/google_appengine/google/appengine/__init__.pyc matches /home/admin/google_app_engine/google_appengine/google/appengine/__init__.py
import google.appengine # precompiled from /home/admin/google_app_engine/google_appengine/google/appengine/__init__.pyc
import google.appengine.tools # directory /home/admin/google_app_engine/google_appengine/google/appengine/tools
# /home/admin/google_app_engine/google_appengine/google/appengine/tools/__init__.pyc matches /home/admin/google_app_engine/google_appengine/google/appengine/tools/__init__.py
import google.appengine.tools # precompiled from /home/admin/google_app_engine/google_appengine/google/appengine/tools/__init__.pyc
# /home/admin/google_app_engine/google_appengine/google/appengine/tools/os_compat.pyc matches /home/admin/google_app_engine/google_appengine/google/appengine/tools/os_compat.py
import google.appengine.tools.os_compat # precompiled from /home/admin/google_app_engine/google_appengine/google/appengine/tools/os_compat.pyc
dlopen("/usr/local/lib/python2.5/lib-dynload/time.so", 2);
import time # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/time.so
# /usr/local/lib/python2.5/getopt.pyc matches /usr/local/lib/python2.5/getopt.py
import getopt # precompiled from /usr/local/lib/python2.5/getopt.pyc
import logging # directory /usr/local/lib/python2.5/logging
# /usr/local/lib/python2.5/logging/__init__.pyc matches /usr/local/lib/python2.5/logging/__init__.py
import logging # precompiled from /usr/local/lib/python2.5/logging/__init__.pyc
# /usr/local/lib/python2.5/string.pyc matches /usr/local/lib/python2.5/string.py
import string # precompiled from /usr/local/lib/python2.5/string.pyc
# /usr/local/lib/python2.5/re.pyc matches /usr/local/lib/python2.5/re.py
import re # precompiled from /usr/local/lib/python2.5/re.pyc
# /usr/local/lib/python2.5/sre_compile.pyc matches /usr/local/lib/python2.5/sre_compile.py
import sre_compile # precompiled from /usr/local/lib/python2.5/sre_compile.pyc
import _sre # builtin
# /usr/local/lib/python2.5/sre_constants.pyc matches /usr/local/lib/python2.5/sre_constants.py
import sre_constants # precompiled from /usr/local/lib/python2.5/sre_constants.pyc
# /usr/local/lib/python2.5/sre_parse.pyc matches /usr/local/lib/python2.5/sre_parse.py
import sre_parse # precompiled from /usr/local/lib/python2.5/sre_parse.pyc
dlopen("/usr/local/lib/python2.5/lib-dynload/strop.so", 2);
import strop # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/strop.so
dlopen("/usr/local/lib/python2.5/lib-dynload/cStringIO.so", 2);
import cStringIO # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/cStringIO.so
# /usr/local/lib/python2.5/traceback.pyc matches /usr/local/lib/python2.5/traceback.py
import traceback # precompiled from /usr/local/lib/python2.5/traceback.pyc
import thread # builtin
# /usr/local/lib/python2.5/threading.pyc matches /usr/local/lib/python2.5/threading.py
import threading # precompiled from /usr/local/lib/python2.5/threading.pyc
dlopen("/usr/local/lib/python2.5/lib-dynload/collections.so", 2);
import collections # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/collections.so
# /usr/local/lib/python2.5/atexit.pyc matches /usr/local/lib/python2.5/atexit.py
import atexit # precompiled from /usr/local/lib/python2.5/atexit.pyc
# /usr/local/lib/python2.5/tempfile.pyc matches /usr/local/lib/python2.5/tempfile.py
import tempfile # precompiled from /usr/local/lib/python2.5/tempfile.pyc
# /usr/local/lib/python2.5/random.pyc matches /usr/local/lib/python2.5/random.py
import random # precompiled from /usr/local/lib/python2.5/random.pyc
dlopen("/usr/local/lib/python2.5/lib-dynload/math.so", 2);
import math # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/math.so
dlopen("/usr/local/lib/python2.5/lib-dynload/binascii.so", 2);
import binascii # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/binascii.so
dlopen("/usr/local/lib/python2.5/lib-dynload/_random.so", 2);
import _random # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/_random.so
dlopen("/usr/local/lib/python2.5/lib-dynload/fcntl.so", 2);
import fcntl # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/fcntl.so
import google.appengine.api # directory /home/admin/google_app_engine/google_appengine/google/appengine/api
# /home/admin/google_app_engine/google_appengine/google/appengine/api/__init__.pyc matches /home/admin/google_app_engine/google_appengine/google/appengine/api/__init__.py
import google.appengine.api # precompiled from /home/admin/google_app_engine/google_appengine/google/appengine/api/__init__.pyc
# /home/admin/google_app_engine/google_appengine/google/appengine/api/yaml_errors.pyc matches /home/admin/google_app_engine/google_appengine/google/appengine/api/yaml_errors.py
import google.appengine.api.yaml_errors # precompiled from /home/admin/google_app_engine/google_appengine/google/appengine/api/yaml_errors.pyc
import google.appengine.dist # directory /home/admin/google_app_engine/google_appengine/google/appengine/dist
# /home/admin/google_app_engine/google_appengine/google/appengine/dist/__init__.pyc matches /home/admin/google_app_engine/google_appengine/google/appengine/dist/__init__.py
import google.appengine.dist # precompiled from /home/admin/google_app_engine/google_appengine/google/appengine/dist/__init__.pyc
# /home/admin/google_app_engine/google_appengine/google/appengine/dist/_library.pyc matches /home/admin/google_app_engine/google_appengine/google/appengine/dist/_library.py
import google.appengine.dist._library # precompiled from /home/admin/google_app_engine/google_appengine/google/appengine/dist/_library.pyc
import distutils # directory /usr/local/lib/python2.5/distutils
# /usr/local/lib/python2.5/distutils/__init__.pyc matches /usr/local/lib/python2.5/distutils/__init__.py
import distutils # precompiled from /usr/local/lib/python2.5/distutils/__init__.pyc
# /usr/local/lib/python2.5/distutils/version.pyc matches /usr/local/lib/python2.5/distutils/version.py
import distutils.version # precompiled from /usr/local/lib/python2.5/distutils/version.pyc
# /home/admin/google_app_engine/google_appengine/google/appengine/dist/py_zipimport.pyc matches /home/admin/google_app_engine/google_appengine/google/appengine/dist/py_zipimport.py
import google.appengine.dist.py_zipimport # precompiled from /home/admin/google_app_engine/google_appengine/google/appengine/dist/py_zipimport.pyc
# /usr/local/lib/python2.5/zipfile.pyc matches /usr/local/lib/python2.5/zipfile.py
import zipfile # precompiled from /usr/local/lib/python2.5/zipfile.pyc
# /usr/local/lib/python2.5/struct.pyc matches /usr/local/lib/python2.5/struct.py
import struct # precompiled from /usr/local/lib/python2.5/struct.pyc
dlopen("/usr/local/lib/python2.5/lib-dynload/_struct.so", 2);
import _struct # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/_struct.so
dlopen("/usr/local/lib/python2.5/lib-dynload/zlib.so", 2);
import zlib # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/zlib.so
# /home/admin/google_app_engine/google_appengine/google/appengine/tools/appcfg.pyc matches /home/admin/google_app_engine/google_appengine/google/appengine/tools/appcfg.py
import google.appengine.tools.appcfg # precompiled from /home/admin/google_app_engine/google_appengine/google/appengine/tools/appcfg.pyc
# /usr/local/lib/python2.5/calendar.pyc matches /usr/local/lib/python2.5/calendar.py
import calendar # precompiled from /usr/local/lib/python2.5/calendar.pyc
# /usr/local/lib/python2.5/__future__.pyc matches /usr/local/lib/python2.5/__future__.py
import __future__ # precompiled from /usr/local/lib/python2.5/__future__.pyc
dlopen("/usr/local/lib/python2.5/lib-dynload/datetime.so", 2);
import datetime # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/datetime.so
# /usr/local/lib/python2.5/locale.pyc matches /usr/local/lib/python2.5/locale.py
import locale # precompiled from /usr/local/lib/python2.5/locale.pyc
dlopen("/usr/local/lib/python2.5/lib-dynload/_locale.so", 2);
import _locale # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/_locale.so
dlopen("/usr/local/lib/python2.5/lib-dynload/operator.so", 2);
import operator # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/operator.so
# /usr/local/lib/python2.5/getpass.pyc matches /usr/local/lib/python2.5/getpass.py
import getpass # precompiled from /usr/local/lib/python2.5/getpass.pyc
dlopen("/usr/local/lib/python2.5/lib-dynload/termios.so", 2);
import termios # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/termios.so
# /usr/local/lib/python2.5/mimetypes.pyc matches /usr/local/lib/python2.5/mimetypes.py
import mimetypes # precompiled from /usr/local/lib/python2.5/mimetypes.pyc
# /usr/local/lib/python2.5/urllib.pyc matches /usr/local/lib/python2.5/urllib.py
import urllib # precompiled from /usr/local/lib/python2.5/urllib.pyc
# /usr/local/lib/python2.5/socket.pyc matches /usr/local/lib/python2.5/socket.py
import socket # precompiled from /usr/local/lib/python2.5/socket.pyc
import _socket # builtin
import _ssl # builtin
# /usr/local/lib/python2.5/urlparse.pyc matches /usr/local/lib/python2.5/urlparse.py
import urlparse # precompiled from /usr/local/lib/python2.5/urlparse.pyc
# /usr/local/lib/python2.5/optparse.pyc matches /usr/local/lib/python2.5/optparse.py
import optparse # precompiled from /usr/local/lib/python2.5/optparse.pyc
# /usr/local/lib/python2.5/textwrap.pyc matches /usr/local/lib/python2.5/textwrap.py
import textwrap # precompiled from /usr/local/lib/python2.5/textwrap.pyc
# /usr/local/lib/python2.5/gettext.pyc matches /usr/local/lib/python2.5/gettext.py
import gettext # precompiled from /usr/local/lib/python2.5/gettext.pyc
# /usr/local/lib/python2.5/copy.pyc matches /usr/local/lib/python2.5/copy.py
import copy # precompiled from /usr/local/lib/python2.5/copy.pyc
# /usr/local/lib/python2.5/sha.pyc matches /usr/local/lib/python2.5/sha.py
import sha # precompiled from /usr/local/lib/python2.5/sha.pyc
# /usr/local/lib/python2.5/hashlib.pyc matches /usr/local/lib/python2.5/hashlib.py
import hashlib # precompiled from /usr/local/lib/python2.5/hashlib.pyc
dlopen("/usr/local/lib/python2.5/lib-dynload/_hashlib.so", 2);
import _hashlib # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/_hashlib.so
Segmentation fault
I examined the verbose output and noted the bottommost line was
import _hashlib # dynamically loaded from /usr/local/lib/python2.5/lib-dynload/_hashlib.so
So I ran a couple more tests, and when I ran Python 2.5 interactively and tried to import the _hashlib module, it worked, there were no errors.
I also went to this blog and tried his approach. This did not work either.
Sorry, don't have the rep to leave comments, so I'll have to leave this as an answer.
Assuming that you've verified that your google app engine install isn't corrupted, my first instinct is that the python2.5 install is using some files from python2.7, causing it to segfault. Try running strace -o "log.txt" python2.5 ./google_appengine/dev_appserver.py
. This will give you a ton of output into log.txt, so try grepping that to find any files being loaded from your 2.7 installation.
If that doesn't lead to anything, try running under gdb to get a stacktrace. This'll require installing a python interpreter w/ debugging symbols -- probably not what you wanted to hear, but it's the quickest way to figure out what's going on. Instructions here: http://wiki.python.org/moin/DebuggingWithGdb If the stack trace doesn't make obvious what's happening, then post it to the python mailing list or bug tracker, and they should be able to help you.
精彩评论