Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*** Error in `python': double free or corruption (out): 0x00007ff5254d50d0 *** #77266

Open
chenkai mannequin opened this issue Mar 16, 2018 · 11 comments
Open

*** Error in `python': double free or corruption (out): 0x00007ff5254d50d0 *** #77266

chenkai mannequin opened this issue Mar 16, 2018 · 11 comments
Assignees
Labels
3.9 only security fixes type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@chenkai
Copy link
Mannequin

chenkai mannequin commented Mar 16, 2018

BPO 33085
Nosy @tirkarthi, @iritkatriel

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2021-09-09.23:11:14.876>
created_at = <Date 2018-03-16.06:59:49.998>
labels = ['type-crash']
title = "*** Error in `python': double free or corruption (out): 0x00007ff5254d50d0 ***"
updated_at = <Date 2021-09-09.23:11:14.875>
user = 'https://bugs.python.org/chenkai'

bugs.python.org fields:

activity = <Date 2021-09-09.23:11:14.875>
actor = 'iritkatriel'
assignee = 'none'
closed = True
closed_date = <Date 2021-09-09.23:11:14.876>
closer = 'iritkatriel'
components = []
creation = <Date 2018-03-16.06:59:49.998>
creator = 'chenkai'
dependencies = []
files = []
hgrepos = []
issue_num = 33085
keywords = []
message_count = 4.0
messages = ['313934', '325869', '336807', '401531']
nosy_count = 3.0
nosy_names = ['chenkai', 'xtreak', 'iritkatriel']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue33085'
versions = ['Python 3.6']

@chenkai
Copy link
Mannequin Author

chenkai mannequin commented Mar 16, 2018

When I finished the installation of readline (6.2.4.1) and then run python, it's crashed:
*** Error in `python': double free or corruption (out): 0x00007ff5254d50d0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7c503)[0x7ff52416e503]
/lib/libpython3.6m.so.1.0(PyOS_Readline+0xec)[0x7ff524e3ff3c]
/lib/libpython3.6m.so.1.0(+0x694d6)[0x7ff524e414d6]
/lib/libpython3.6m.so.1.0(+0x6ae78)[0x7ff524e42e78]
/lib/libpython3.6m.so.1.0(PyTokenizer_Get+0x9)[0x7ff524e43cb9]
/lib/libpython3.6m.so.1.0(+0x6811e)[0x7ff524e4011e]
/lib/libpython3.6m.so.1.0(PyParser_ASTFromFileObject+0x8b)[0x7ff524f76ecb]
/lib/libpython3.6m.so.1.0(+0x19f0ea)[0x7ff524f770ea]
/lib/libpython3.6m.so.1.0(PyRun_InteractiveLoopFlags+0x76)[0x7ff524f77416]
/lib/libpython3.6m.so.1.0(PyRun_AnyFileExFlags+0x3e)[0x7ff524f77c7e]
/lib/libpython3.6m.so.1.0(Py_Main+0xd97)[0x7ff524f93827]
python(main+0x16c)[0x400b1c]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7ff524113b35]
python[0x400bda]
======= Memory map: ========
00400000-00401000 r-xp 0000000 08:03 52652831 /root/python36/bin/python3
00601000-00602000 r--p 00001000 08:03 52652831 /root/python36/bin/python3
00602000-00603000 rw-p 00002000 08:03 52652831 /root/python36/bin/python3
01bb5000-01c92000 rw-p 0000000 00:00 0 [heap]
7ff518000000-7ff518021000 rw-p 0000000 00:00 0
7ff518021000-7ff51c000000 ---p 0000000 00:00 0
7ff51d0c4000-7ff51d0d9000 r-xp 0000000 08:03 84 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7ff51d0d9000-7ff51d2d8000 ---p 00015000 08:03 84 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7ff51d2d8000-7ff51d2d9000 r--p 00014000 08:03 84 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7ff51d2d9000-7ff51d2da000 rw-p 00015000 08:03 84 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7ff51d2da000-7ff51d2ff000 r-xp 0000000 08:03 106273 /usr/lib64/libtinfo.so.5.9
7ff51d2ff000-7ff51d4ff000 ---p 00025000 08:03 106273 /usr/lib64/libtinfo.so.5.9
7ff51d4ff000-7ff51d503000 r--p 00025000 08:03 106273 /usr/lib64/libtinfo.so.5.9
7ff51d503000-7ff51d504000 rw-p 00029000 08:03 106273 /usr/lib64/libtinfo.so.5.9
7ff51d504000-7ff51d52a000 r-xp 0000000 08:03 90038 /usr/lib64/libncurses.so.5.9
7ff51d52a000-7ff51d729000 ---p 00026000 08:03 90038 /usr/lib64/libncurses.so.5.9
7ff51d729000-7ff51d72a000 r--p 00025000 08:03 90038 /usr/lib64/libncurses.so.5.9
7ff51d72a000-7ff51d72b000 rw-p 00026000 08:03 90038 /usr/lib64/libncurses.so.5.9
7ff51d73e000-7ff51d779000 r-xp 0000000 08:03 18819792 /root/python36/lib/python3.6/site-packages/readline.cpython-36m-x86_64-linux-gnu.so
7ff51d779000-7ff51d979000 ---p 0003b000 08:03 18819792 /root/python36/lib/python3.6/site-packages/readline.cpython-36m-x86_64-linux-gnu.so
7ff51d979000-7ff51d97b000 r--p 0003b000 08:03 18819792 /root/python36/lib/python3.6/site-packages/readline.cpython-36m-x86_64-linux-gnu.so
7ff51d97b000-7ff51d982000 rw-p 0003d000 08:03 18819792 /root/python36/lib/python3.6/site-packages/readline.cpython-36m-x86_64-linux-gnu.so
7ff51d982000-7ff51d9c4000 rw-p 0000000 00:00 0
7ff51d9c4000-7ff51d9c6000 r-xp 0000000 08:03 35550108 /usr/lib/python3.6/lib-dynload/_heapq.cpython-36m-x86_64-linux-gnu.so
7ff51d9c6000-7ff51dbc6000 ---p 00002000 08:03 35550108 /usr/lib/python3.6/lib-dynload/_heapq.cpython-36m-x86_64-linux-gnu.so
7ff51dbc6000-7ff51dbc7000 r--p 00002000 08:03 35550108 /usr/lib/python3.6/lib-dynload/_heapq.cpython-36m-x86_64-linux-gnu.so
7ff51dbc7000-7ff51dbc9000 rw-p 00003000 08:03 35550108 /usr/lib/python3.6/lib-dynload/_heapq.cpython-36m-x86_64-linux-gnu.so
7ff51dbc9000-7ff5240f2000 r--p 0000000 08:03 16882256 /usr/lib/locale/locale-archive
7ff5240f2000-7ff5242a8000 r-xp 0000000 08:03 65201 /usr/lib64/libc-2.17.so
7ff5242a8000-7ff5244a8000 ---p 001b6000 08:03 65201 /usr/lib64/libc-2.17.so
7ff5244a8000-7ff5244ac000 r--p 001b6000 08:03 65201 /usr/lib64/libc-2.17.so
7ff5244ac000-7ff5244ae000 rw-p 001ba000 08:03 65201 /usr/lib64/libc-2.17.so
7ff5244ae000-7ff5244b3000 rw-p 0000000 00:00 0
7ff5244b3000-7ff5245b3000 r-xp 0000000 08:03 65209 /usr/lib64/libm-2.17.so
7ff5245b3000-7ff5247b3000 ---p 00100000 08:03 65209 /usr/lib64/libm-2.17.so
7ff5247b3000-7ff5247b4000 r--p 00100000 08:03 65209 /usr/lib64/libm-2.17.so
7ff5247b4000-7ff5247b5000 rw-p 00101000 08:03 65209 /usr/lib64/libm-2.17.so
7ff5247b5000-7ff5247b7000 r-xp 0000000 08:03 90003 /usr/lib64/libutil-2.17.so
7ff5247b7000-7ff5249b6000 ---p 00002000 08:03 90003 /usr/lib64/libutil-2.17.so
7ff5249b6000-7ff5249b7000 r--p 00001000 08:03 90003 /usr/lib64/libutil-2.17.so
7ff5249b7000-7ff5249b8000 rw-p 00002000 08:03 90003 /usr/lib64/libutil-2.17.so
7ff5249b8000-7ff5249ba000 r-xp 0000000 08:03 65207 /usr/lib64/libdl-2.17.so
7ff5249ba000-7ff524bba000 ---p 00002000 08:03 65207 /usr/lib64/libdl-2.17.so
7ff524bba000-7ff524bbb000 r--p 00002000 08:03 65207 /usr/lib64/libdl-2.17.so
7ff524bbb000-7ff524bbc000 rw-p 00003000 08:03 65207 /usr/lib64/libdl-2.17.so
7ff524bbc000-7ff524bd3000 r-xp 0000000 08:03 89995 /usr/lib64/libpthread-2.17.so
7ff524bd3000-7ff524dd2000 ---p 00017000 08:03 89995 /usr/lib64/libpthread-2.17.so
7ff524dd2000-7ff524dd3000 r--p 00016000 08:03 89995 /usr/lib64/libpthread-2.17.so
7ff524dd3000-7ff524dd4000 rw-p 00017000 08:03 89995 /usr/lib64/libpthread-2.17.so
7ff524dd4000-7ff524dd8000 rw-p 0000000 00:00 0
已放弃(吐核)

@chenkai chenkai mannequin added topic-2to3 type-crash A hard crash of the interpreter, possibly with a core dump labels Mar 16, 2018
@tirkarthi
Copy link
Member

Thanks for the report. Can you please add a little more description on reproducing this issue along with OS details ? By "the installation of readline (6.2.4.1) [1]" are you referring to a third party package that you have installed with Python that resulted in a crash in Python interpreter? I tried it with master in a virtual env and cannot reproduce the same. Is this reproducible with latest Python or Python 3.6 version? Also it seems you are installing it as a root user does this happen only for root user or even with a virtualenv?

(bpo33085-env) karthi@ubuntu-s-1vcpu-1gb-blr1-01:~$ pip install readline
[snip]
Installing collected packages: readline
  Running setup.py install for readline ... done
Successfully installed readline-6.2.4.1
(bpo33085-env) karthi@ubuntu-s-1vcpu-1gb-blr1-01:~$ python
Python 3.8.0a0 (heads/master:73820a6, Sep 14 2018, 18:33:26)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

[1] : https://pypi.org/project/readline/ (moved to https://pypi.org/project/gnureadline/)

Thanks

@chenkai
Copy link
Mannequin Author

chenkai mannequin commented Feb 28, 2019

OS:
(python36) [root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Python 3.6.5 (default, Feb 28 2019, 01:43:16) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
*** Error in `python': free(): invalid pointer: 0x00007f4eb7a64558 ***
======= Backtrace: 

=========
/lib64/libc.so.6(+0x81499)[0x7f4eb6c45499]
python(PyOS_Readline+0xec)[0x5cc48c]
python[0x447250]
python[0x448b98]
python(PyTokenizer_Get+0x9)[0x4499d9]
python[0x4457dd]
python(PyParser_ASTFromFileObject+0x89)[0x427909]
python[0x427b1b]
python(PyRun_InteractiveLoopFlags+0x76)[0x427e46]
python(PyRun_AnyFileExFlags+0x3c)[0x427fcc]
python(Py_Main+0xc44)[0x43b934]
python(main+0x162)[0x41d8b2]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f4eb6be6445]
python[0x41d970]
======= Memory map: ========

@iritkatriel
Copy link
Member

There isn't enough information here for us to do anything about this, and in any case Python 3.6 is no longer maintained. Please create a new issue if you are having this problem with a current version (>= 3.9) and can provide more information about how to reproduce it.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@umdstu
Copy link

umdstu commented Jun 22, 2022

@iritkatriel , FWIW I just had this happen with Python 3.9.13 if you are interesting in trying to debug this further. I can provide any requested information to assist. Thanks

$ uname -a
Linux 5.8.10-1.el7.elrepo.x86_64 #1 SMP Thu Sep 17 10:40:48 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux

$ wget https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tgz
$ sudo yum install libffi-devel zlib-devel gcc openssl-devel bzip2-devel -y
$ sudo ./configure --enable-optimizations
$ sudo make altinstall

After installing readline

$ python
Python 3.9.13 (main, Jun 21 2022, 12:26:48) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
*** Error in `python': free(): invalid pointer: 0x00007f0d601771d0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x81329)[0x7f0d60433329]
python(PyOS_Readline+0xe3)[0x6543f3]
python[0x5bc221]
python[0x5bc908]
python[0x5beba9]
python[0x62f203]
python[0x650a39]
python[0x62ff80]
python[0x630356]
python[0x5315b7]
python(PyRun_InteractiveLoopFlags+0x86)[0x5317d6]
python(PyRun_AnyFileExFlags+0x3c)[0x5320fc]
python(Py_RunMain+0x8be)[0x42b80e]
python(Py_BytesMain+0x4f)[0x42bb1f]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f0d603d4555]
python[0x42a8f5]
======= Memory map: ========
00400000-00746000 r-xp 00000000 103:01 151729264                         /guest/home/.virtualenvs/39/bin/python3.9
00946000-00947000 r--p 00346000 103:01 151729264                         /guest/home/.virtualenvs/39/bin/python3.9
00947000-0097f000 rw-p 00347000 103:01 151729264                         /guest/home/.virtualenvs/39/bin/python3.9
0097f000-009a2000 rw-p 00000000 00:00 0 
0117a000-01204000 rw-p 00000000 00:00 0                                  [heap]
7f0d58000000-7f0d58021000 rw-p 00000000 00:00 0 
7f0d58021000-7f0d5c000000 ---p 00000000 00:00 0 
7f0d5f79d000-7f0d5f7b2000 r-xp 00000000 103:01 88845352                  /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7f0d5f7b2000-7f0d5f9b1000 ---p 00015000 103:01 88845352                  /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7f0d5f9b1000-7f0d5f9b2000 r--p 00014000 103:01 88845352                  /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7f0d5f9b2000-7f0d5f9b3000 rw-p 00015000 103:01 88845352                  /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7f0d5f9b3000-7f0d5f9d8000 r-xp 00000000 103:01 79693387                  /usr/lib64/libtinfo.so.5.9
7f0d5f9d8000-7f0d5fbd8000 ---p 00025000 103:01 79693387                  /usr/lib64/libtinfo.so.5.9
7f0d5fbd8000-7f0d5fbdc000 r--p 00025000 103:01 79693387                  /usr/lib64/libtinfo.so.5.9
7f0d5fbdc000-7f0d5fbdd000 rw-p 00029000 103:01 79693387                  /usr/lib64/libtinfo.so.5.9
7f0d5fbdd000-7f0d5fc03000 r-xp 00000000 103:01 79693267                  /usr/lib64/libncurses.so.5.9
7f0d5fc03000-7f0d5fe02000 ---p 00026000 103:01 79693267                  /usr/lib64/libncurses.so.5.9
7f0d5fe02000-7f0d5fe03000 r--p 00025000 103:01 79693267                  /usr/lib64/libncurses.so.5.9
7f0d5fe03000-7f0d5fe04000 rw-p 00026000 103:01 79693267                  /usr/lib64/libncurses.so.5.9
7f0d5fe04000-7f0d5fe40000 r-xp 00000000 103:01 144043210                 /guest/home/.virtualenvs/39/lib/python3.9/site-packages/readline.cpython-39-x86_64-linux-gnu.so
7f0d5fe40000-7f0d60040000 ---p 0003c000 103:01 144043210                 /guest/home/.virtualenvs/39/lib/python3.9/site-packages/readline.cpython-39-x86_64-linux-gnu.so
7f0d60040000-7f0d60042000 r--p 0003c000 103:01 144043210                 /guest/home/.virtualenvs/39/lib/python3.9/site-packages/readline.cpython-39-x86_64-linux-gnu.so
7f0d60042000-7f0d60049000 rw-p 0003e000 103:01 144043210                 /guest/home/.virtualenvs/39/lib/python3.9/site-packages/readline.cpython-39-x86_64-linux-gnu.so
7f0d60049000-7f0d601af000 rw-p 00000000 00:00 0 
7f0d601af000-7f0d601b1000 r-xp 00000000 103:01 88845348                  /usr/lib64/libfreebl3.so
7f0d601b1000-7f0d603b0000 ---p 00002000 103:01 88845348                  /usr/lib64/libfreebl3.so
7f0d603b0000-7f0d603b1000 r--p 00001000 103:01 88845348                  /usr/lib64/libfreebl3.so
7f0d603b1000-7f0d603b2000 rw-p 00002000 103:01 88845348                  /usr/lib64/libfreebl3.so
7f0d603b2000-7f0d60576000 r-xp 00000000 103:01 88359306                  /usr/lib64/libc-2.17.so
7f0d60576000-7f0d60775000 ---p 001c4000 103:01 88359306                  /usr/lib64/libc-2.17.so
7f0d60775000-7f0d60779000 r--p 001c3000 103:01 88359306                  /usr/lib64/libc-2.17.so
7f0d60779000-7f0d6077b000 rw-p 001c7000 103:01 88359306                  /usr/lib64/libc-2.17.so
7f0d6077b000-7f0d60780000 rw-p 00000000 00:00 0 
7f0d60780000-7f0d60881000 r-xp 00000000 103:01 92234057                  /usr/lib64/libm-2.17.so
7f0d60881000-7f0d60a80000 ---p 00101000 103:01 92234057                  /usr/lib64/libm-2.17.so
7f0d60a80000-7f0d60a81000 r--p 00100000 103:01 92234057                  /usr/lib64/libm-2.17.so
7f0d60a81000-7f0d60a82000 rw-p 00101000 103:01 92234057                  /usr/lib64/libm-2.17.so
7f0d60a82000-7f0d60a84000 r-xp 00000000 103:01 92243952                  /usr/lib64/libutil-2.17.so
7f0d60a84000-7f0d60c83000 ---p 00002000 103:01 92243952                  /usr/lib64/libutil-2.17.so
7f0d60c83000-7f0d60c84000 r--p 00001000 103:01 92243952                  /usr/lib64/libutil-2.17.so
7f0d60c84000-7f0d60c85000 rw-p 00002000 103:01 92243952                  /usr/lib64/libutil-2.17.so
7f0d60c85000-7f0d60c87000 r-xp 00000000 103:01 88758083                  /usr/lib64/libdl-2.17.so
7f0d60c87000-7f0d60e87000 ---p 00002000 103:01 88758083                  /usr/lib64/libdl-2.17.so
7f0d60e87000-7f0d60e88000 r--p 00002000 103:01 88758083                  /usr/lib64/libdl-2.17.so
7f0d60e88000-7f0d60e89000 rw-p 00003000 103:01 88758083                  /usr/lib64/libdl-2.17.so
7f0d60e89000-7f0d60ea0000 r-xp 00000000 103:01 92239857                  /usr/lib64/libpthread-2.17.so
7f0d60ea0000-7f0d6109f000 ---p 00017000 103:01 92239857                  /usr/lib64/libpthread-2.17.so
7f0d6109f000-7f0d610a0000 r--p 00016000 103:01 92239857                  /usr/lib64/libpthread-2.17.so
7f0d610a0000-7f0d610a1000 rw-p 00017000 103:01 92239857                  /usr/lib64/libpthread-2.17.so
7f0d610a1000-7f0d610a5000 rw-p 00000000 00:00 0 
7f0d610a5000-7f0d610ad000 r-xp 00000000 103:01 88665487                  /usr/lib64/libcrypt-2.17.so
7f0d610ad000-7f0d612ac000 ---p 00008000 103:01 88665487                  /usr/lib64/libcrypt-2.17.so
7f0d612ac000-7f0d612ad000 r--p 00007000 103:01 88665487                  /usr/lib64/libcrypt-2.17.so
7f0d612ad000-7f0d612ae000 rw-p 00008000 103:01 88665487                  /usr/lib64/libcrypt-2.17.so

Installing libs and recompiling python

$ sudo yum install ncurses-devel ncurses-libs -y
$ make clean
$ sudo ./configure --enable-optimizations
$ sudo make altinstall

Same error after doing so.

@iritkatriel iritkatriel reopened this Jun 22, 2022
@iritkatriel
Copy link
Member

Are you able to try newer versions, 3.10 and 3.11b?

@umdstu
Copy link

umdstu commented Jun 22, 2022

I could not use 3.10+ because of the openssl version installed, however, that doesn't matter now. I resolved this by yum (re) installing readline-devel and rebuilding from scratch. No more seg faults!

Hopefully this helps someone in the future. Thanks for the quick response!

@iritkatriel
Copy link
Member

@ambv (3.9 release manager)

FYI - a crash in 3.9 but not in 3.10.

@kumaraditya303
Copy link
Contributor

I'll close this as this isn't a security issue which can be backported to 3.9 and seems to be related to the readline lib version. Thanks

@kumaraditya303 kumaraditya303 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 3, 2022
@iritkatriel
Copy link
Member

A crash is potentially a security issue. Let’s let the release manager decide.

@iritkatriel iritkatriel reopened this Jul 3, 2022
@kumaraditya303 kumaraditya303 added the 3.9 only security fixes label Jul 3, 2022
@ambv
Copy link
Contributor

ambv commented Jul 4, 2022

Irit is right, crashers are considered denial-of-service security issues. An exception is recoverable and loggable, a segfault isn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.9 only security fixes type-crash A hard crash of the interpreter, possibly with a core dump
5 participants