【问题标题】:Installing Python 2.4 on CentOS 8 fails with segmentation fault在 CentOS 8 上安装 Python 2.4 失败并出现分段错误
【发布时间】:2020-08-31 22:07:11
【问题描述】:

我在 CentOS 8 上安装 Python 2.4.6 时遇到问题。 我需要旧的 Python 2.4.6,因为我正在运行一些需要 Python 2.4 的应用程序。

我下载了 Python 2.4.6.tgz 包,将其解压缩并运行“./configure”,它可以工作。 当我尝试运行“make”时,我看到很多警告,最后显示以下错误消息:

gcc -pthread  -Xlinker -export-dynamic -o python \
        Modules/python.o \
        libpython2.4.a -lpthread -ldl  -lutil   -lm  
libpython2.4.a(posixmodule.o): In function `posix_tmpnam':
/usr/local/src/Python-2.4.6/./Modules/posixmodule.c:6240: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
libpython2.4.a(posixmodule.o): In function `posix_tempnam':
/usr/local/src/Python-2.4.6/./Modules/posixmodule.c:6195: warning: the use of `tempnam' is dangerous, better use `mkstemp'
case $MAKEFLAGS in \
*-s*)  CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-DNDEBUG -g -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build;; \
*)  CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-DNDEBUG -g -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py build;; \
esac
/bin/sh: line 1:  5296 Segmentation fault      (core dumped) CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-DNDEBUG -g -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py build
make: *** [Makefile:342: sharedmods] Error 139

任何想法,这里可能有什么问题?如果需要,我可以在运行“make”(很长)之后发布整个输出。 提前非常感谢。

【问题讨论】:

    标签: python centos8


    【解决方案1】:

    我建议采用与在您的操作系统上安装 Python 2.4 不同的方法。那东西很古老,只会带来安全问题。

    因此,如果您的应用程序甚至无法使用 Python 2.7,那么在 Docker 中运行 Python 2.4 可能会更好。参见例如https://github.com/pantuza/docker-python-2.4.3 用于 Python 2.4 的 docker 映像,https://www.docker.com/get-started 用于 docker 介绍。

    也许下一步应该将这些应用程序移植到 Python 3,这样您就可以彻底摆脱那个古老的 Python 版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-28
      • 1970-01-01
      • 1970-01-01
      • 2021-07-31
      • 2016-11-08
      • 1970-01-01
      相关资源
      最近更新 更多